Bug 19604 - gcc miscompiles Mysql on IA32 with "-O2"(O1 works)
gcc miscompiles Mysql on IA32 with "-O2"(O1 works)
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 18620 18905
  Show dependency treegraph
 
Reported: 2000-10-23 10:31 EDT by Trond Eivind Glomsrxd
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-24 15:44:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
assembly file with "-O1" (47.34 KB, application/octet-stream)
2000-10-23 10:34 EDT, Trond Eivind Glomsrxd
no flags Details
assembly file with -O2 (48.14 KB, application/octet-stream)
2000-10-23 10:35 EDT, Trond Eivind Glomsrxd
no flags Details
ii file of field.cc (73.29 KB, application/octet-stream)
2000-10-23 10:37 EDT, Trond Eivind Glomsrxd
no flags Details
test script for mysql (984 bytes, text/plain)
2000-10-23 10:38 EDT, Trond Eivind Glomsrxd
no flags Details
test script for mysql (666 bytes, text/plain)
2000-10-23 10:39 EDT, Trond Eivind Glomsrxd
no flags Details
Patch for aliasing problems in mysql (2.01 KB, patch)
2000-10-25 15:00 EDT, Trond Eivind Glomsrxd
no flags Details | Diff

  None (edit)
Description Trond Eivind Glomsrxd 2000-10-23 10:31:52 EDT
gcc up to 2.96-60 miscompiles mysql (the file sql/field.cc) when compiled
with "-O2" as opposed to "-O1". This results in bad query results.
Comment 1 Trond Eivind Glomsrxd 2000-10-23 10:34:41 EDT
Created attachment 4553 [details]
assembly file with "-O1"
Comment 2 Trond Eivind Glomsrxd 2000-10-23 10:35:32 EDT
Created attachment 4554 [details]
assembly file with -O2
Comment 3 Trond Eivind Glomsrxd 2000-10-23 10:37:39 EDT
Created attachment 4555 [details]
ii file of field.cc
Comment 4 Trond Eivind Glomsrxd 2000-10-23 10:38:33 EDT
Created attachment 4556 [details]
test script for mysql
Comment 5 Trond Eivind Glomsrxd 2000-10-23 10:39:20 EDT
Created attachment 4557 [details]
test script for mysql
Comment 6 Jakub Jelinek 2000-10-24 08:40:01 EDT
That file is full of code dancing around the edge of what is and what is
not allowed with -fstrict-aliasing.
Either compile that file with -fno-strict-aliasing, or find out which exact
routine causes the testcase to fail and I'll tell you whether it is valid
C or not (but I assume the latter).
Basically, a char pointer can alias with any type, otherwise one should
access variables only through compatible types.
Comment 7 Trond Eivind Glomsrxd 2000-10-24 15:44:16 EDT
Is there a way to turn this on/off inside the source file? Suggestions on how to
find which function?
Comment 8 Trond Eivind Glomsrxd 2000-10-25 14:59:23 EDT
Closing - Jakub found bugs (aliasing) in the Mysql code.
Comment 9 Trond Eivind Glomsrxd 2000-10-25 15:00:36 EDT
Created attachment 4654 [details]
Patch for aliasing problems in mysql

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