summaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gmx.de>2015-04-08 16:08:19 +0200
committerAndre Vehreschild <vehre@gmx.de>2015-04-08 16:08:19 +0200
commitb70cd7cb6fd66a6f5dfbfb988861cec47c6e2c7a (patch)
tree018962a41f39c27ff33d256772fc4df8e1fdf43d /gcc/tree-cfgcleanup.c
parent47a288f4810b15cffd924582e91fc603b7b64b75 (diff)
parent6f59b325165f6794b1d13753d5a06b1d10fee669 (diff)
downloadgcc-b70cd7cb6fd66a6f5dfbfb988861cec47c6e2c7a.tar.gz
Merge remote-tracking branch 'trunk' of git://gcc.gnu.org/git/gcc into vehre/all
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index e7122e33c28..26258aad1ef 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -579,13 +579,15 @@ remove_forwarder_block (basic_block bb)
return true;
}
-/* STMT is a call that has been discovered noreturn. Fixup the CFG
- and remove LHS. Return true if something changed. */
+/* STMT is a call that has been discovered noreturn. Split the
+ block to prepare fixing up the CFG and remove LHS.
+ Return true if cleanup-cfg needs to run. */
bool
fixup_noreturn_call (gimple stmt)
{
basic_block bb = gimple_bb (stmt);
+ bool changed = false;
if (gimple_call_builtin_p (stmt, BUILT_IN_RETURN))
return false;
@@ -604,7 +606,10 @@ fixup_noreturn_call (gimple stmt)
gsi_remove (&gsi, true);
}
else
- split_block (bb, stmt);
+ {
+ split_block (bb, stmt);
+ changed = true;
+ }
}
/* If there is an LHS, remove it. */
@@ -626,9 +631,13 @@ fixup_noreturn_call (gimple stmt)
}
/* Mark the call as altering control flow. */
- gimple_call_set_ctrl_altering (stmt, true);
+ if (!gimple_call_ctrl_altering_p (stmt))
+ {
+ gimple_call_set_ctrl_altering (stmt, true);
+ changed = true;
+ }
- return remove_fallthru_edge (bb->succs);
+ return changed;
}