summaryrefslogtreecommitdiff
path: root/gcc/gimple-iterator.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-01-05 01:46:14 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2017-01-05 01:46:14 +0000
commit556655048b30188a560f135ccde732bc436eded2 (patch)
tree97d67deb2126d6cba12c2c7c06b78b0d37401d62 /gcc/gimple-iterator.h
parent692216906ba1c7734183c4940122d5684c05141f (diff)
[-fcompare-debug] skip more debug stmts in cleanup_empty_eh
Various Ada RTS files failed -fcompare-debug compilation because debug stmts prevented EH cleanups from taking place. Adjusting cleanup_empty_eh to skip them fixes it. for gcc/ChangeLog * gimple-iterator.h (gsi_one_nondebug_before_end_p): New. * tree-eh.c (cleanup_empty_eh): Skip more debug stmts. From-SVN: r244088
Diffstat (limited to 'gcc/gimple-iterator.h')
-rw-r--r--gcc/gimple-iterator.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h
index 7b2c49c83a6..70f18beceff 100644
--- a/gcc/gimple-iterator.h
+++ b/gcc/gimple-iterator.h
@@ -305,6 +305,20 @@ gsi_last_nondebug_bb (basic_block bb)
return i;
}
+/* Return true if I is followed only by debug statements in its
+ sequence. */
+
+static inline bool
+gsi_one_nondebug_before_end_p (gimple_stmt_iterator i)
+{
+ if (gsi_one_before_end_p (i))
+ return true;
+ if (gsi_end_p (i))
+ return false;
+ gsi_next_nondebug (&i);
+ return gsi_end_p (i);
+}
+
/* Iterates I statement iterator to the next non-virtual statement. */
static inline void