summaryrefslogtreecommitdiff
path: root/gcc/tree-optimize.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-01 20:35:08 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-01 20:35:08 +0000
commit3b4fe4404cabb3a1db5cf86ab871dc86a5103725 (patch)
tree444592859a62623603f67efe10d11b809be02e54 /gcc/tree-optimize.c
parentc8f0c143cfb4c6031a3935dda0121b9dd767db7f (diff)
downloadgcc-3b4fe4404cabb3a1db5cf86ab871dc86a5103725.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r--gcc/tree-optimize.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index ed4676996dd..2631e14cce4 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);