aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-cfgcleanup.cc')
-rw-r--r--gcc/tree-cfgcleanup.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-cfgcleanup.cc b/gcc/tree-cfgcleanup.cc
index 3535a7e..b4869ae 100644
--- a/gcc/tree-cfgcleanup.cc
+++ b/gcc/tree-cfgcleanup.cc
@@ -220,9 +220,10 @@ cleanup_call_ctrl_altering_flag (basic_block bb, gimple *bb_end)
return;
int flags = gimple_call_flags (bb_end);
- if (((flags & (ECF_CONST | ECF_PURE))
- && !(flags & ECF_LOOPING_CONST_OR_PURE))
- || (flags & ECF_LEAF))
+ if (!(flags & ECF_NORETURN)
+ && (((flags & (ECF_CONST | ECF_PURE))
+ && !(flags & ECF_LOOPING_CONST_OR_PURE))
+ || (flags & ECF_LEAF)))
gimple_call_set_ctrl_altering (bb_end, false);
else
{
@@ -328,6 +329,10 @@ cleanup_control_flow_bb (basic_block bb)
gsi_remove (&gsi, true);
if (remove_fallthru_edge (bb->succs))
retval = true;
+ tree lhs = gimple_call_lhs (stmt);
+ if (!lhs
+ || !should_remove_lhs_p (lhs))
+ gimple_call_set_ctrl_altering (stmt, true);
}
return retval;