diff options
author | Martin Liska <mliska@suse.cz> | 2014-12-10 15:07:47 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2014-12-10 14:07:47 +0000 |
commit | 42c0b54df5517af870ae4f50c32886ac77af2046 (patch) | |
tree | b600d3f7eb04d4c25ea190a2ab57744df220b515 /gcc/gimple-iterator.h | |
parent | ef9b7fad361c3b534588628ca8ae2b670aae934d (diff) | |
download | gcc-42c0b54df5517af870ae4f50c32886ac77af2046.zip gcc-42c0b54df5517af870ae4f50c32886ac77af2046.tar.gz gcc-42c0b54df5517af870ae4f50c32886ac77af2046.tar.bz2 |
re PR ipa/63909 (ICE: SIGSEGV in ipa_icf_gimple::func_checker::compare_bb())
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.
From-SVN: r218578
Diffstat (limited to 'gcc/gimple-iterator.h')
-rw-r--r-- | gcc/gimple-iterator.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h index fb6cc07..e9602b3 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. */ |