diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 0e553c8..dc3288b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4055,6 +4055,14 @@ fold_marked_statements (int first, struct pointer_set_t *statements) if (fold_stmt (&gsi)) { gimple new_stmt; + /* If a builtin at the end of a bb folded into nothing, + the following loop won't work. */ + if (gsi_end_p (gsi)) + { + cgraph_update_edges_for_call_stmt (old_stmt, + old_decl, NULL); + break; + } if (gsi_end_p (i2)) i2 = gsi_start_bb (BASIC_BLOCK (first)); else |