diff options
author | Jason Merrill <merrill@gnu.org> | 1994-06-02 22:28:22 +0000 |
---|---|---|
committer | Jason Merrill <merrill@gnu.org> | 1994-06-02 22:28:22 +0000 |
commit | 413ec213e4b98584833e0c0f5171802a04fa7d16 (patch) | |
tree | 61caa8a05e6524ab65356e082ab819f6cd0416a8 /gcc | |
parent | d9e1ab8d4e8b293dea59a751c9f5b98e05898dd7 (diff) | |
download | gcc-413ec213e4b98584833e0c0f5171802a04fa7d16.zip gcc-413ec213e4b98584833e0c0f5171802a04fa7d16.tar.gz gcc-413ec213e4b98584833e0c0f5171802a04fa7d16.tar.bz2 |
(expand_end_bindings): Don't bother emitting cleanups
after a barrier.
From-SVN: r7432
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/stmt.c | 44 |
1 files changed, 24 insertions, 20 deletions
@@ -2955,29 +2955,33 @@ expand_end_bindings (vars, mark_ends, dont_jump_in) if (thisblock->data.block.stack_level != 0 || thisblock->data.block.cleanups != 0) { - /* Don't let cleanups affect ({...}) constructs. */ - int old_expr_stmts_for_value = expr_stmts_for_value; - rtx old_last_expr_value = last_expr_value; - tree old_last_expr_type = last_expr_type; - expr_stmts_for_value = 0; - - /* Do the cleanups. */ - expand_cleanups (thisblock->data.block.cleanups, NULL_TREE); - do_pending_stack_adjust (); + /* Only clean up here if this point can actually be reached. */ + if (GET_CODE (get_last_insn ()) != BARRIER) + { + /* Don't let cleanups affect ({...}) constructs. */ + int old_expr_stmts_for_value = expr_stmts_for_value; + rtx old_last_expr_value = last_expr_value; + tree old_last_expr_type = last_expr_type; + expr_stmts_for_value = 0; + + /* Do the cleanups. */ + expand_cleanups (thisblock->data.block.cleanups, NULL_TREE); + do_pending_stack_adjust (); - expr_stmts_for_value = old_expr_stmts_for_value; - last_expr_value = old_last_expr_value; - last_expr_type = old_last_expr_type; + expr_stmts_for_value = old_expr_stmts_for_value; + last_expr_value = old_last_expr_value; + last_expr_type = old_last_expr_type; - /* Restore the stack level. */ + /* Restore the stack level. */ - if (thisblock->data.block.stack_level != 0) - { - emit_stack_restore (thisblock->next ? SAVE_BLOCK : SAVE_FUNCTION, - thisblock->data.block.stack_level, NULL_RTX); - if (nonlocal_goto_handler_slot != 0) - emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, - NULL_RTX); + if (thisblock->data.block.stack_level != 0) + { + emit_stack_restore (thisblock->next ? SAVE_BLOCK : SAVE_FUNCTION, + thisblock->data.block.stack_level, NULL_RTX); + if (nonlocal_goto_handler_slot != 0) + emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, + NULL_RTX); + } } /* Any gotos out of this block must also do these things. |