Bug 13476 - wrong code with -O3 -fPIC (segmentation fault)
Summary: wrong code with -O3 -fPIC (segmentation fault)
Status: RESOLVED DUPLICATE of bug 10877
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-23 11:48 UTC by Krzysztof Strasburger
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i386-slackware-linux
Target: i386-slackware-linux
Build: i386-slackware-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Strasburger 2003-12-23 11:48:58 UTC
The following code is miscompiled (no error with -O2 -fPIC or
without -fPIC):
int xargc;
int iargcx() { return (xargc); }
int main(int argc, char **argv) {
xargc=argc; return (iargcx()); }

The function "iargcx" is responsible for the problem.
Command line: gcc -O3 -fPIC file.c, gcc configured with: ./configure --prefix=/usr --enable-languages=c --host=i386-slackware-linux --disable-libgcj --disable-nls
Comment 1 Andrew Pinski 2003-12-23 17:02:44 UTC
This is a dup of bug 10877 which means you have to have a newer binutils.

*** This bug has been marked as a duplicate of 10877 ***