summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-18 10:58:57 +0000
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-18 10:58:57 +0000
commite80af4553ce82e6167c27e58b926a8da70ac3d50 (patch)
tree2209c8792eab859e724568eab2cb9271ef198026 /gcc/function.c
parentb41fcb56cb6075698c4929a75e01f443ebccc206 (diff)
downloadgcc-e80af4553ce82e6167c27e58b926a8da70ac3d50.tar.gz
function: Do the CLEANUP_EXPENSIVE after shrink-wrapping, not before
We should do CLEANUP_EXPENSIVE after shrink-wrapping, because shrink- wrapping creates constructs that CLEANUP_EXPENSIVE can optimise, and nothing runs CLEANUP_EXPENSIVE later. * function.c (rest_of_handle_thread_prologue_and_epilogue): Call cleanup_cfg with CLEANUP_EXPENSIVE after shrink-wrapping instead of before. Add a comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236372 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 70584b95586..9cbe71f2521 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6369,8 +6369,10 @@ make_pass_leaf_regs (gcc::context *ctxt)
static unsigned int
rest_of_handle_thread_prologue_and_epilogue (void)
{
+ /* prepare_shrink_wrap is sensitive to the block structure of the control
+ flow graph, so clean it up first. */
if (optimize)
- cleanup_cfg (CLEANUP_EXPENSIVE);
+ cleanup_cfg (0);
/* On some machines, the prologue and epilogue code, or parts thereof,
can be represented as RTL. Doing so lets us schedule insns between
@@ -6384,7 +6386,7 @@ rest_of_handle_thread_prologue_and_epilogue (void)
/* Shrink-wrapping can result in unreachable edges in the epilogue,
see PR57320. */
- cleanup_cfg (0);
+ cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
/* The stack usage info is finalized during prologue expansion. */
if (flag_stack_usage_info)