diff options
author | Jan Hubicka <jh@suse.cz> | 2010-06-01 22:35:08 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-06-01 20:35:08 +0000 |
commit | 566d09eff650c4722dad479494213ecf29372da7 (patch) | |
tree | 444592859a62623603f67efe10d11b809be02e54 /gcc/tree-optimize.c | |
parent | fb9ef4c18e7f5294fab9ba71f6d1fe1c03eae7aa (diff) | |
download | gcc-566d09eff650c4722dad479494213ecf29372da7.zip gcc-566d09eff650c4722dad479494213ecf29372da7.tar.gz gcc-566d09eff650c4722dad479494213ecf29372da7.tar.bz2 |
tree-cfgcleanup.c (fixup_noreturn_call): Break out from ...; remove return value.
* tree-cfgcleanup.c (fixup_noreturn_call): Break out from ...;
remove return value.
(split_bbs_on_noreturn_calls) .... here.
* tree-optimize.c (execute_fixup_cfg): Fixup noreturn calls too.
* tree-flow.h (fixup_noreturn_call): New.
* testsuite/gcc.dg/lto/noreturn-1_1.c: New testcase.
* testsuite/gcc.dg/lto/noreturn-1_0.c: New testcase.
From-SVN: r160122
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r-- | gcc/tree-optimize.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index ed46769..2631e14 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -231,7 +231,8 @@ execute_free_datastructures (void) } /* Pass: fixup_cfg. IPA passes, compilation of earlier functions or inlining - might have changed some properties, such as marked functions nothrow. + might have changed some properties, such as marked functions nothrow, + pure, const or noreturn. Remove redundant edges and basic blocks, and create new ones if necessary. This pass can't be executed as stand alone pass from pass manager, because @@ -267,19 +268,23 @@ execute_fixup_cfg (void) tree decl = is_gimple_call (stmt) ? gimple_call_fndecl (stmt) : NULL; - - if (decl - && gimple_call_flags (stmt) & (ECF_CONST - | ECF_PURE - | ECF_LOOPING_CONST_OR_PURE)) + if (decl) { - if (gimple_in_ssa_p (cfun)) + int flags = gimple_call_flags (stmt); + if (flags & (ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE)) { - todo |= TODO_update_ssa | TODO_cleanup_cfg; - mark_symbols_for_renaming (stmt); - update_stmt (stmt); + if (gimple_in_ssa_p (cfun)) + { + todo |= TODO_update_ssa | TODO_cleanup_cfg; + mark_symbols_for_renaming (stmt); + update_stmt (stmt); + } } - } + + if (flags & ECF_NORETURN + && fixup_noreturn_call (stmt)) + todo |= TODO_cleanup_cfg; + } maybe_clean_eh_stmt (stmt); } @@ -293,6 +298,13 @@ execute_fixup_cfg (void) if (count_scale != REG_BR_PROB_BASE) compute_function_frequency (); + /* We just processed all calls. */ + if (cfun->gimple_df) + { + VEC_free (gimple, gc, MODIFIED_NORETURN_CALLS (cfun)); + MODIFIED_NORETURN_CALLS (cfun) = NULL; + } + /* Dump a textual representation of the flowgraph. */ if (dump_file) gimple_dump_cfg (dump_file, dump_flags); |