gcc-2.96-81 -O2 miscompiles the attached code. RedHat 7.1 sym53c8xx SCSI driver is affected, on my system (Tekram 53C860) RH7.1 install program causes "oops" (non-fatal, but you can't access SCSI) when insmoding sym53c8xx.o. Reproducible: Always Steps to Reproduce: 1. install Tekram 310U (or possibly other NCR53C8xx-based) SCSI PCI card 2. run RH7.1 install from CD 3. watch the screen Actual Results: $ gcc -O2 test.c -o test $ ./test x = 0 (should be 8) int main(void) { unsigned int x = 8; if (x < 5) x = 4; else x = 8; printf("x = %u (should be 8)\n", x); } I haven't tested current gcc compilers, possibly the problem should be corrected there as well.
Verified, looks like a bug in ia32's ix86_expand_int_movcc, happens in gcc 3.0 and gcc 3.1 as well. Hope to have this debugged by tomorrow.
Fixed by http://gcc.gnu.org/ml/gcc-patches/2001-04/msg01057.html and will be included in the upcoming gcc-2.96-82.
*** Bug 39764 has been marked as a duplicate of this bug. ***