Comment 2 for bug 689887

Revision history for this message
Jani Monoses (jani) wrote :

Here is a small program based on the traverso code, that exhibits the error when built with -O2

gcc (Ubuntu/Linaro 4.5.2-1ubuntu2) 4.5.2

internal compiler error: in get_arm_condition_code, at config/arm/arm.c:16985

any of these changes leads to successful build
 - using long instead of 'long long'
 - not using the shift operator
 - not wrapping in a loop

#include <limits.h>

void sample_move_d32u24_sS (char *dst, char *src, unsigned long nsamples, unsigned long dst_skip)

{
        long long y;

        while (nsamples--) {
                y = (long long)(*src) << 8;
                if (y < INT_MIN) {
                        *((int *) dst) = INT_MIN;
                } else {
                        *((int *) dst) = (int)y;
                }
        }
}