ICE on Alpha in tree_split_edge, at tree-cfg.c:3107. Works with gcc 3.4 and current gcc 4.2, fails with 4.0 and 4.1. tbm@juist:~/delta/bin$ g++-4.1 -c -O1 mini.c mini.c: In function 'int domisc(const char*)': mini.c:27: internal compiler error: in tree_split_edge, at tree-cfg.c:3107 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. Preprocessed source stored into /tmp/cctyNtwC.out file, please attach this to your bugreport. tbm@juist:~/delta/bin$ g++-4.1 -c mini.c tbm@juist:~/delta/bin$ g++-4.0 -c -O2 mini.c mini.c: In function 'int domisc(const char*)': mini.c:27: internal compiler error: in tree_split_edge, at tree-cfg.c:3226 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>. tbm@juist:~/delta/bin$ /usr/lib/gcc-snapshot/bin/g++ -c -O2 mini.c tbm@juist:~/delta/bin$
Created attachment 11593 [details] test case
Here is a cleaned-up testcase: int firstkey(); void DBM_error(int); void domisc() { int i = 0; try { try { firstkey(); while (1) { i++; firstkey(); } } catch (int) { ; } DBM_error(i); } catch (int) { ; } } I have no idea why this would happen only on Alpha, it seems unlikely it's actually a target bug...
This bug is still there in 4.1, but not in mainline. Janis, can you perhaps do a regression hunt to see what fixed this and whether it is feasible to backport?
A regression hunt using the testcase from comment #2 with -O2 using an alpha-linux cross compiler identified this patch which fixed the ICE on mainline: http://gcc.gnu.org/viewcvs?view=rev&rev=110556 r110556 | rakdver | 2006-02-03 19:28:09 +0000 (Fri, 03 Feb 2006)
Zdenek, do you think this patch (or another fix) can be backported to 4.1? http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01259.html
> do you think this patch (or another fix) can be backported to 4.1? > > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01259.html Given the nature of the patch, I do not think this is the right approach to fixing this PR.
Subject: Bug 27891 Author: rakdver Date: Thu Nov 2 19:18:25 2006 New Revision: 118423 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118423 Log: PR tree-optimization/27891 * tree-ssa-loop-ivopts.c (rewrite_use_outer): Do not insert code on abnormal edge. * gcc++.dg/tree-ssa/pr27891.c: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr27891.C Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/tree-ssa-loop-ivopts.c
Subject: Bug 27891 Author: rakdver Date: Thu Nov 2 20:57:35 2006 New Revision: 118430 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118430 Log: PR tree-optimization/27891 * tree-ssa-loop-ivopts.c (rewrite_use_outer): Do not insert code on abnormal edge. * gcc++.dg/tree-ssa/pr27891.c: New test. Added: branches/gcc-4_0-branch/gcc/testsuite/g++.dg/tree-ssa/pr27891.C Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/testsuite/ChangeLog branches/gcc-4_0-branch/gcc/tree-ssa-loop-ivopts.c
This seems to be fixed both in 4.0 and in 4.1.