This ice prevents the gcc svn head from building the LLVM svn head. regehr@john-home:~/volatile/tmp208$ current-g++ -c -O3 small.cpp small.cpp: In member function ‘(anonymous namespace)::StrongPHIElimination::runOnMachineFunction(llvm::MachineFunction&)’: small.cpp:281:1: internal compiler error: in rewrite_stmt, at tree-into-ssa.c:1302 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. regehr@john-home:~/volatile/tmp208$ current-g++ -v Using built-in specs. COLLECT_GCC=current-g++ COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153044-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --enable-lto --prefix=/home/regehr/z/tmp/gcc-r153044-install --program-prefix=r153044- --enable-languages=c,c++ Thread model: posix gcc version 4.5.0 20091020 (experimental) (GCC)
Created attachment 18848 [details] failure inducing input
Confirmed. Looks like invalid tree-sharing. On (gdb) call debug_gimple_stmt (stmt) # .MEM = VDEF <.MEM> llvm::LiveInterval::removeRange (PI_10, D.2378_13->start, D.2378_13->end, 1); we have replaced the first use but on replacing the 2nd one the INDIRECT_REF was shared. Both built from #1 0x0888e476 in build_ref_for_offset_1 (res=0xbffff068, type=0xb7d72a8c, offset=0, exp_type=0xb7d728fc) at /home/richard/src/trunk/gcc/tree-sra.c:1255 1255 expr = build3 (COMPONENT_REF, TREE_TYPE (fld), *res, fld, without unsharing *res. Thus, this is IPA-SRA.
Created attachment 18903 [details] Proposed fix Indeed, the users of build_ref_for_offset in ipa-prop.c and ipa-cp.c do not unshare the base expressions they should. I have looked at all other users and found that they either pass declarations or do their own unsharing and so decided to move the unsharing to build_ref_for_offset itself. The attached patch fixes the ICE when compiling the testcase, I am currently bootstrapping it.
I have just sent the patch to the mailing list: http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01625.html I had to change the testcase a bit so that it compiles on x86_64.
(In reply to comment #4) > I have just sent the patch to the mailing list: > > http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01625.html > > I had to change the testcase a bit so that it compiles on x86_64. You should also add: // { dg-require-visibility "" }
Subject: Bug 41775 Author: jamborm Date: Thu Oct 29 12:40:48 2009 New Revision: 153699 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153699 Log: 2009-10-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41775 * tree-sra.c (build_ref_for_offset): Unshare *expr if not NULL. (generate_subtree_copies): Do not unshare agg. (load_assign_lhs_subreplacements): Do not unshare rhs. (sra_modify_assign): Do not unshare exprs. (propagate_subacesses_accross_link): Renamed to propagate_subaccesses_across_link. * testsuite/g++.dg/torture/pr41775.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/torture/pr41775.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-sra.c
I did. This is now fixed.
Subject: Bug 41775 Author: hjl Date: Fri Oct 30 16:04:41 2009 New Revision: 153759 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153759 Log: 2009-10-30 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2009-10-30 Dodji Seketeli <dodji@redhat.com> PR c++/41863 * g++.dg/template/sizeof12.C: New test. 2009-10-29 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41775 * g++.dg/torture/pr41775.C: New testcase. 2009-10-28 Jakub Jelinek <jakub@redhat.com> PR debug/41801 * g++.dg/ext/sync-3.C: New test. 2009-10-27 Jakub Jelinek <jakub@redhat.com> PR c++/41020 * g++.dg/lookup/extern-c-redecl5.C: Fix up regexp. 2009-10-26 Jakub Jelinek <jakub@redhat.com> PR bootstrap/41345 * gcc.dg/pr41345.c: New test. 2009-10-26 Dodji Seketeli <dodji@redhat.com> PR c++/41785 * g++.dg/cpp0x/variadic96.C: New test. 2009-10-26 Dodji Seketeli <dodji@redhat.com> PR c++/41020 * g++.dg/lookup/extern-c-redecl2.C: New test. * g++.dg/lookup/extern-c-redecl3.C: Likewise. * g++.dg/lookup/extern-c-redecl4.C: Likewise. * g++.dg/lookup/extern-c-redecl5.C: Likewise. 2009-10-23 Joseph Myers <joseph@codesourcery.com> PR c/40033 * gcc.dg/noncompile/pr40033-1.c: New test. 2009-10-23 Joseph Myers <joseph@codesourcery.com> PR c/41673 * gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test. 2009-10-21 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/41497 * gcc.dg/tree-ssa/pr41497.c: New. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/variadic96.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/cpp0x/variadic96.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/sync-3.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/ext/sync-3.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl2.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/lookup/extern-c-redecl5.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/sizeof12.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/template/sizeof12.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr41775.C - copied unchanged from r153757, trunk/gcc/testsuite/g++.dg/torture/pr41775.C branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c - copied unchanged from r153758, trunk/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c - copied unchanged from r153758, trunk/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41345.c - copied unchanged from r153757, trunk/gcc/testsuite/gcc.dg/pr41345.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c - copied unchanged from r153758, trunk/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog