Bug 27891 - [4.0/4.1 regression] ICE in tree_split_edge, at tree-cfg.c:3107
Summary: [4.0/4.1 regression] ICE in tree_split_edge, at tree-cfg.c:3107
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P5 normal
Target Milestone: 4.1.3
Assignee: Zdenek Dvorak
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-06-04 11:13 UTC by Martin Michlmayr
Modified: 2007-02-14 09:49 UTC (History)
5 users (show)

See Also:
Host: alpha-linux-gnu
Target: alpha-linux-gnu
Build: alpha-linux-gnu
Known to work: 3.4.6 4.2.0
Known to fail: 4.0.3 4.1.0
Last reconfirmed: 2006-10-29 10:00:04


Attachments
test case (301 bytes, text/plain)
2006-06-04 11:14 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-06-04 11:13:39 UTC
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$
Comment 1 Martin Michlmayr 2006-06-04 11:14:26 UTC
Created attachment 11593 [details]
test case
Comment 2 Falk Hueffner 2006-06-04 12:51:34 UTC
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...
Comment 3 Falk Hueffner 2006-10-22 12:50:40 UTC
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?
Comment 4 Janis Johnson 2006-10-23 19:16:15 UTC
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)
Comment 5 Falk Hueffner 2006-10-29 09:57:29 UTC
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
Comment 6 Zdenek Dvorak 2006-10-29 10:00:04 UTC
> 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.
Comment 7 Zdenek Dvorak 2006-11-02 19:18:41 UTC
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

Comment 8 Zdenek Dvorak 2006-11-02 20:57:45 UTC
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

Comment 9 Zdenek Dvorak 2007-02-14 09:49:23 UTC
This seems to be fixed both in 4.0 and in 4.1.