http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49140
Summary: [4.6 regression] wrong code with -O2 and -O3, not with -O3 -no-inline Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: d...@ubuntu.com Created attachment 24342 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24342 preprocessed source [forwarded from http://bugs.debian.org/627084] seen with r174102 from the 4.6 branch, works with r173903 from the trunk Step to reproduce: wget 'http://pari.math.u-bordeaux.fr/~bill/pari-2.4.3.12000.tar.gz' tar xf pari-2.4.3.12000.tar.gz cd pari-2.4.3.alpha ./Configure make gp make bench Result: all test suite fail. Cause: The function pari_init_parser() in the file src/language/parsec.h is miscompiled. (This file is included by src/language/parse.y). If you replace the line 43: s_node.n=OPnboperator; by parsestate_reset(); (which does the same thing), then all test pass. It seems that the issue is that the function stack_alloc() is not inlined correctly, which cause pari_tree to be NULL (or maybe the call to pari_inline inside stack_alloc() is not inlined correctly. The command line used is gcc-4.6 -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I. -I../src/headers -fPIC -o parse.o ../src/language/parse.c It also happens with -O2, but not with -O3 -fno-inline. It works fine with gcc 4.3, 4.4 and 4.5.