aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c
index cdd2721..5dafb8c 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5919,16 +5919,25 @@ thread_prologue_and_epilogue_insns (void)
edge entry_edge = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun));
edge orig_entry_edge = entry_edge;
- rtx_insn *split_prologue_seq = make_split_prologue_seq ();
rtx_insn *prologue_seq = make_prologue_seq ();
- rtx_insn *epilogue_seq = make_epilogue_seq ();
/* Try to perform a kind of shrink-wrapping, making sure the
prologue/epilogue is emitted only around those parts of the
function that require it. */
-
try_shrink_wrapping (&entry_edge, prologue_seq);
+ /* If the target can handle splitting the prologue/epilogue into separate
+ components, try to shrink-wrap these components separately. */
+ try_shrink_wrapping_separate (entry_edge->dest);
+
+ /* If that did anything for any component we now need the generate the
+ "main" prologue again. If that does not work for some target then
+ that target should not enable separate shrink-wrapping. */
+ if (crtl->shrink_wrapped_separate)
+ prologue_seq = make_prologue_seq ();
+
+ rtx_insn *split_prologue_seq = make_split_prologue_seq ();
+ rtx_insn *epilogue_seq = make_epilogue_seq ();
rtl_profile_for_bb (EXIT_BLOCK_PTR_FOR_FN (cfun));