aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-10-01 12:07:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-10-01 12:07:47 +0000
commit0d228a5255e2e2917cc8807f427221a36a583f4b (patch)
tree974de03023548fefebe5bb8532c965356aca9565 /gcc/tree-eh.c
parent33f49367016b4bf543de30324c580a317970b5e8 (diff)
downloadgcc-0d228a5255e2e2917cc8807f427221a36a583f4b.zip
gcc-0d228a5255e2e2917cc8807f427221a36a583f4b.tar.gz
gcc-0d228a5255e2e2917cc8807f427221a36a583f4b.tar.bz2
re PR middle-end/45854 (ICE in redirect_eh_edge_1, at tree-eh.c:2131)
2010-10-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/45854 * tree-eh.c (cleanup_empty_eh): Avoid degenerate case. * g++.dg/torture/pr45854.C: New testcase. From-SVN: r164881
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 2174276..8a99ad3 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3743,7 +3743,13 @@ cleanup_empty_eh (eh_landing_pad lp)
/* If the block is totally empty, look for more unsplitting cases. */
if (gsi_end_p (gsi))
- return cleanup_empty_eh_unsplit (bb, e_out, lp);
+ {
+ /* For the degenerate case of an infinite loop bail out. */
+ if (e_out->dest == bb)
+ return false;
+
+ return cleanup_empty_eh_unsplit (bb, e_out, lp);
+ }
/* The block should consist only of a single RESX statement. */
resx = gsi_stmt (gsi);