Created attachment 28426 [details] preprocessed source seen building the cone package on arm-linux-gnueabi, works with 4.6 branch, fails with 4.7. g++-4.7 -c -g -O[123] myserver.ii myserver.C: In static member function 'static bool myServer::eventloop(myServer::Callback*)': myserver.C:168:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. Program received signal SIGSEGV, Segmentation fault. 0x003b90ae in free_scc_vn() () (gdb) bt #0 0x003b90ae in free_scc_vn() () #1 0x003aee44 in ?? () #2 0x003aee44 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Please also check trunk.
trunk 20120820 and 20121008 do work.
I can reproduce the ICE with gcc-4.7.2 on armv5tel-linux-gnueabi, sparc64-linux -m32, x86_64-linux -m32, and m68k-linux. I haven't checked any other targets. The ICE stopped on trunk with Richard B's "Make gsi_remove return whether EH cleanup is required" patch in r186159: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00202.html http://gcc.gnu.org/ml/gcc-cvs/2012-04/msg00108.html Backporting r186159 and the follow-up fix in r186164 to gcc-4.7.2 eliminates the ICE there for the four targets mentioned above. The description of Richard's patch makes it sound more like a cleanup than a bug fix, so I'm not sure if it actually fixes the bug or just masks it.
Created attachment 28512 [details] gdb backtrace Root cause: PRE bases on the result of value numbering (run_scc_vn). At the end, it free_scc_vn. But before free_scc_vn, it might call cleanup_tree_cfg (); if (do_eh_cleanup || do_ab_cleanup) cleanup_tree_cfg (); cleanup_tree_cfg might call make_ssa_name which might reuse some "name" from the FREE_SSANAMES list. If the VN_INFO of the "name" is NULL, free_scc_vn will "Segmentation fault". Richard's patch makes "do_eh_cleanup" to false. So cleanup_tree_cfg is not called in PRE. Then no new ssa name will be created. bt.log shows the gdb backtrace to create a new ssa name.
Mine.
Created attachment 28517 [details] patch Patch I am testing.
Author: rguenth Date: Thu Oct 25 11:05:43 2012 New Revision: 192803 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192803 Log: 2012-10-25 Richard Biener <rguenther@suse.de> PR tree-optimization/54902 * tree-ssa-pre.c (fini_pre): Return TODO. (execute_pre): Adjust. * tree-ssa-tailmerge.c (tail_merge_optimize): Delete unreachable blocks before computing dominators. * g++.dg/torture/pr54902.C: New testcase. Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/torture/pr54902.C Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/testsuite/ChangeLog branches/gcc-4_7-branch/gcc/tree-ssa-pre.c branches/gcc-4_7-branch/gcc/tree-ssa-tail-merge.c
Author: rguenth Date: Thu Oct 25 11:16:12 2012 New Revision: 192804 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192804 Log: 2012-10-25 Richard Biener <rguenther@suse.de> PR tree-optimization/54902 * tree-ssa-pre.c (fini_eliminate): Return TODO. (do_pre): Adjust. (execute_fre): Likewise. * tree-ssa-tailmerge.c (tail_merge_optimize): Delete unreachable blocks before computing dominators. * g++.dg/torture/pr54902.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/torture/pr54902.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-pre.c trunk/gcc/tree-ssa-tail-merge.c
Fixed.