diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2016-05-18 12:58:57 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2016-05-18 12:58:57 +0200 |
commit | 63d0f6ab560336d34b0a8f9b9b111c4a17e8737f (patch) | |
tree | 2209c8792eab859e724568eab2cb9271ef198026 /gcc | |
parent | a1e71b01801dbf67c2dc9d598b3e62091b4677b2 (diff) | |
download | gcc-63d0f6ab560336d34b0a8f9b9b111c4a17e8737f.zip gcc-63d0f6ab560336d34b0a8f9b9b111c4a17e8737f.tar.gz gcc-63d0f6ab560336d34b0a8f9b9b111c4a17e8737f.tar.bz2 |
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.
From-SVN: r236372
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a011528..4d119bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-18 Segher Boessenkool <segher@kernel.crashing.org> + + * function.c (rest_of_handle_thread_prologue_and_epilogue): Call + cleanup_cfg with CLEANUP_EXPENSIVE after shrink-wrapping instead + of before. Add a comment. + 2016-05-18 Bin Cheng <bin.cheng@arm.com> * tree-ssa-loop-ivopts.c (get_computation_cost_at): Check invariant diff --git a/gcc/function.c b/gcc/function.c index 70584b9..9cbe71f 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) |