[forwarded from http://bugs.debian.org/326026]

[EMAIL PROTECTED]:~% cat test.c
void abort(void);

unsigned long long f(unsigned long long x) {
    return ((x >> 8) | (x << 56)) ^ ((x >> 48) | (x << 16)) ^ (x >> 1);
}

int main() {
    volatile unsigned long long v = 0x1122334455667788ULL;
    if (f(v) != 0xb3c46ef7196e4c91ULL)
        abort();
    return 0;
}

[EMAIL PROTECTED]:~% gcc-4.0 -O1 -fno-schedule-insns test.c && ./a.out
[EMAIL PROTECTED]:~% gcc-4.0 -O1 -fschedule-insns test.c && ./a.out   
zsh: abort (core dumped)  ./a.out

Reproduced with 4.0.2 20050821 on hppa-linux and with 4.1.0 20050705 on
i686-linux.

-- 
           Summary: [4.0, 4.1 regression] Wrong code with -fschedule-insns
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23837

Reply via email to