Re: optimization/10877: [3.3/3.4 regression] miscompilation with -O3 -fPIC on x86
| Newsgroups | gmane.comp.gcc.prs,gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]> |
Old Synopsis: GCC 3.3 miscompiles code with -O3 -fPIC on x86
New Synopsis: [3.3/3.4 regression] miscompilation with -O3 -fPIC on x86
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue May 20 01:16:37 2003
State-Changed-Why:
Confirmed. This is a smaller snippet (it has nothing to
do with namespaces):
----------------------------
int* i;
int& get_x() {
return *i;
}
int main() {
int j;
i = &j;
get_x();
}
--------------------------
It crashed in get_x:
g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -O3 -fPIC x.cc
g/x> ./a.out
Segmentation fault
Note that we really need both -fPIC and -O3.
This crashes with both 3.3 and present mainline. It
doesn't with 2.95 and 3.2.3, so it's definitely a
regression worth fixing!
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10877