Perl compilation problem at -O3: wilx@logout:::~/tmp/perl-5.8.6> gcc -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include -O3 -Wall -save-temps toke.c gcc: warning: -pipe ignored because -save-temps specified toke.c: In function 'Perl_yylex': toke.c:2193: internal compiler error: in merge_alias_info, at tree-ssa-copy.c:236 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. wilx@logout:::~/tmp/perl-5.8.6> gcc -v Reading specs from /home/4/wilx/lib/gcc/i386-unknown-freebsd4.10/4.0.0/specs Configured with: ../srcdir/configure --disable-nls --enable-version-specific-runtime-libs --enable-dwarf2 --with-cpu=pentium3 --with-arch=pentium3 --with-system-zlib --disable-shared --prefix=/home/4/wilx --enable-languages=c,c++ --disable-sjlj-exceptions --enable-shared=libstdc++ --enable-shared=libobjc --with-gc=zone Thread model: posix gcc version 4.0.0 20041215 (experimental)
Created attachment 7800 [details] Preprocessed source.
I can confirm this on the mainline, I am reducing it right now.
Created attachment 7801 [details] a little reduced This is as far as I have gotten (6899 lines).
Note there is another bug with "-O3 -fno-strict-aliasing -fno-tree-dominator-opts".
Reduced testcase (24 lines or so, yes it looks nothing like the original): typedef struct interpreter { char Itokenbuf[256]; } PerlInterpreter; static inline void S_missingterm(char *s) { char tmpbuf[3] = ""; char q; if (!s) s = tmpbuf; q = strchr(s,'"') ? '\'' : '"'; } void S_scan_heredoc(PerlInterpreter *my_perl, char *s, int i) { char term; term = *my_perl->Itokenbuf; if (i) { *s = term; S_missingterm(my_perl->Itokenbuf); } else S_missingterm(my_perl->Itokenbuf); }
(In reply to comment #5) > Reduced testcase (24 lines or so, yes it looks nothing like the original): Also note that -O2 is only needed to get the ICE.
It worked with 20041017.
I can also reproduce it this on powerpc-darwin.
This is definitely an problem in the aliasing code: D.1126_6 = &my_perl_5->Itokenbuf[0]; term_7 = *D.1126_6; if (i_8 != 0) goto <L0>; else goto <L6>; <L0>:; *s_18 = term_7; s_19 = &my_perl_5->Itokenbuf[0]; s_20 = s_19; tmpbuf = ""; if (s_20 == 0B) goto <L1>; else goto <L2>; <L1>:; s_27 = &tmpbuf; # s_1 = PHI <s_20(1), s_27(2)>; <L2>:; What DOM did was combined the two "&my_perl_5->Itokenbuf[0]" so s_19 = D.1126_6 and then say that s_20 will never be zero as we already loaded from D.1126_6 so it turned s_20==0 to false, then prograted D.1126_6 into the PHI of s_1 which causes the ICE.
Note this works on the tree cleanup branch.
: Search converges between 2004-10-26-161001-trunk (#611) and 2004-11-03-014001-trunk (#612).
Fixed. http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01071.html.
Subject: Bug 19121 CVSROOT: /cvs/gcc Module name: gcc Changes by: dnovillo@gcc.gnu.org 2005-01-18 03:54:38 Modified files: gcc : ChangeLog tree-ssa-alias.c tree-ssa-copy.c tree-ssa.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/compile: pr19121.c Log message: PR tree-optimization/19121 * tree-ssa-alias.c (compute_flow_sensitive_aliasing): When adding aliases to a name tag, also add them to the pointer's type tag. * tree-ssa-copy.c (merge_alias_info): Do not merge flow sensitive alias info at all. Only check that the two pointers have compatible pointed-to sets. * tree-ssa.c (verify_name_tags): Verify that the alias set of a pointer's type tag is a superset of the alias set of the pointer's name tag. testsuite/ChangeLog: PR tree-optimization/19121 * gcc.c-torture/compile/pr19121.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7163&r2=2.7164 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&r1=2.65&r2=2.66 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-copy.c.diff?cvsroot=gcc&r1=2.21&r2=2.22 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&r1=2.70&r2=2.71 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4899&r2=1.4900 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr19121.c.diff?cvsroot=gcc&r1=NONE&r2=1.1