summaryrefslogtreecommitdiff
path: root/gcc/gimple-iterator.h
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-10 14:07:47 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-10 14:07:47 +0000
commit92e5932309c2cb3ec3bd4aad5719139a2bf53daf (patch)
treeb600d3f7eb04d4c25ea190a2ab57744df220b515 /gcc/gimple-iterator.h
parent6c679c887c74f12d60de874393dc7a31b01ee817 (diff)
downloadgcc-92e5932309c2cb3ec3bd4aad5719139a2bf53daf.tar.gz
PR ipa/63909
* gimple-iterator.h (gsi_start_bb_nondebug): New function. * ipa-icf-gimple.c (func_checker::compare_bb): Correct iteration replaces loop based on precomputed number of non-debug statements. * gcc.dg/ipa/pr63909.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-iterator.h')
-rw-r--r--gcc/gimple-iterator.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h
index fb6cc0718fb..e9602b34ffe 100644
--- a/gcc/gimple-iterator.h
+++ b/gcc/gimple-iterator.h
@@ -211,6 +211,19 @@ gsi_stmt (gimple_stmt_iterator i)
return i.ptr;
}
+/* Return a new iterator pointing to the first non-debug statement
+ in basic block BB. */
+
+static inline gimple_stmt_iterator
+gsi_start_bb_nondebug (basic_block bb)
+{
+ gimple_stmt_iterator gsi = gsi_start_bb (bb);
+ while (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
+ gsi_next (&gsi);
+
+ return gsi;
+}
+
/* Return a block statement iterator that points to the first non-label
statement in block BB. */