summaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-05 14:34:30 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-05 14:34:30 +0000
commitae3a21c97a3c4fe94c1702353834bdb36cb54edc (patch)
treeef3ace13aa552233ed60eea323f9044fc76c8274 /gcc/tree-eh.c
parent7ffa2d72c4897af02eee4b0223b07cb2a7e27235 (diff)
downloadgcc-ae3a21c97a3c4fe94c1702353834bdb36cb54edc.tar.gz
PR middle-end/57499
* tree-eh.c (cleanup_empty_eh): Bail out on totally empty bb with no successors. * g++.dg/torture/pr57499.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207504 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index e9c714c7714..857ee4581bc 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -4396,8 +4396,11 @@ cleanup_empty_eh (eh_landing_pad lp)
/* If the block is totally empty, look for more unsplitting cases. */
if (gsi_end_p (gsi))
{
- /* For the degenerate case of an infinite loop bail out. */
- if (infinite_empty_loop_p (e_out))
+ /* For the degenerate case of an infinite loop bail out.
+ If bb has no successors and is totally empty, which can happen e.g.
+ because of incorrect noreturn attribute, bail out too. */
+ if (e_out == NULL
+ || infinite_empty_loop_p (e_out))
return ret;
return ret | cleanup_empty_eh_unsplit (bb, e_out, lp);