Index: testsuite/gcc.c-torture/compile/pr30564-1.c =================================================================== --- testsuite/gcc.c-torture/compile/pr30564-1.c (revision 0) +++ testsuite/gcc.c-torture/compile/pr30564-1.c (revision 0) @@ -0,0 +1,15 @@ +static int spready[] = {0, 1, 2, 3}; +void explosion_map (int y) +{ + int i; + for (i = 0; i < 4; i++) + if (y * spready[i] < 0) + break; +} +void explosion (void) +{ + int i; + explosion_map (0); + for (i = 0; i < 2; i++) + continue; +} Index: testsuite/gcc.c-torture/compile/pr30564-2.c =================================================================== --- testsuite/gcc.c-torture/compile/pr30564-2.c (revision 0) +++ testsuite/gcc.c-torture/compile/pr30564-2.c (revision 0) @@ -0,0 +1,12 @@ + +static int RawOrEnc = 0; +static inline void addpair(int fp, int un) +{ + if (RawOrEnc == 0 && fp != un) + RawOrEnc = 1; +} +int f(int un0, char *a, unsigned int __s2_len) +{ + addpair(un0, un0); + __s2_len < 4 ? __builtin_strcmp (a, "-") : 0; +} Index: tree-inline.c =================================================================== --- tree-inline.c (revision 127625) +++ tree-inline.c (working copy) @@ -2823,10 +2823,6 @@ optimize_inline_calls (tree fn) gimple_expand_calls_inline (bb, &id); pop_gimplify_context (NULL); - /* Renumber the (code) basic_blocks consecutively. */ - compact_blocks (); - /* Renumber the lexical scoping (non-code) blocks consecutively. */ - number_blocks (fn); #ifdef ENABLE_CHECKING { @@ -2839,13 +2835,20 @@ optimize_inline_calls (tree fn) gcc_assert (e->inline_failed); } #endif + + /* Fold the statements before compacting/renumbering the basic blocks. */ + fold_marked_statements (last, id.statements_to_fold); + pointer_set_destroy (id.statements_to_fold); + + /* Renumber the (code) basic_blocks consecutively. */ + compact_blocks (); + /* Renumber the lexical scoping (non-code) blocks consecutively. */ + number_blocks (fn); /* We are not going to maintain the cgraph edges up to date. Kill it so it won't confuse us. */ cgraph_node_remove_callees (id.dst_node); - fold_marked_statements (last, id.statements_to_fold); - pointer_set_destroy (id.statements_to_fold); fold_cond_expr_cond (); if (current_function_has_nonlocal_label) make_nonlocal_label_edges ();