Bug 37054 - GCC optimizer bug; miscompiles kernel sym53c8xx driver
GCC optimizer bug; miscompiles kernel sym53c8xx driver
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
: 39764 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-22 10:38 EDT by Krzysztof Halasa
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-22 15:03:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Krzysztof Halasa 2001-04-22 10:38:44 EDT
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.
Comment 1 Jakub Jelinek 2001-04-22 14:26:41 EDT
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.
Comment 2 Jakub Jelinek 2001-04-22 15:03:25 EDT
Fixed by http://gcc.gnu.org/ml/gcc-patches/2001-04/msg01057.html
and will be included in the upcoming gcc-2.96-82.
Comment 3 Matt Wilson 2001-05-08 23:24:15 EDT
*** Bug 39764 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.