aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.cc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2023-10-17 23:45:43 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2023-10-17 23:45:43 +0100
commitaeb3f0436f8ae84e593eda9641fe4e6fdf0afb3e (patch)
tree884b646cf720144c0767d6ca90c65bbca772ebcf /gcc/function.cc
parent5e4abf4233cd34212680cca700d6438445e6a16a (diff)
downloadgcc-aeb3f0436f8ae84e593eda9641fe4e6fdf0afb3e.zip
gcc-aeb3f0436f8ae84e593eda9641fe4e6fdf0afb3e.tar.gz
gcc-aeb3f0436f8ae84e593eda9641fe4e6fdf0afb3e.tar.bz2
Handle epilogues that contain jumps
The prologue/epilogue pass allows the prologue sequence to contain jumps. The sequence is then partitioned into basic blocks using find_many_sub_basic_blocks. This patch treats epilogues in a similar way. Since only one block might need to be split, the patch (re)introduces a find_sub_basic_blocks routine to handle a single block. The new routine hard-codes the assumption that split_block will chain the new block immediately after the original block. The routine doesn't try to replicate the fix for PR81030, since that was specific to gimple->rtl expansion. The patch is needed for follow-on aarch64 patches that add conditional code to the epilogue. The tests are part of those patches. gcc/ * cfgbuild.h (find_sub_basic_blocks): Declare. * cfgbuild.cc (update_profile_for_new_sub_basic_block): New function, split out from... (find_many_sub_basic_blocks): ...here. (find_sub_basic_blocks): New function. * function.cc (thread_prologue_and_epilogue_insns): Handle epilogues that contain jumps.
Diffstat (limited to 'gcc/function.cc')
-rw-r--r--gcc/function.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/function.cc b/gcc/function.cc
index 336af28..afb0b33 100644
--- a/gcc/function.cc
+++ b/gcc/function.cc
@@ -6112,6 +6112,8 @@ thread_prologue_and_epilogue_insns (void)
&& returnjump_p (BB_END (e->src)))
e->flags &= ~EDGE_FALLTHRU;
}
+
+ find_sub_basic_blocks (BLOCK_FOR_INSN (epilogue_seq));
}
else if (next_active_insn (BB_END (exit_fallthru_edge->src)))
{
@@ -6210,6 +6212,8 @@ thread_prologue_and_epilogue_insns (void)
set_insn_locations (seq, epilogue_location);
emit_insn_before (seq, insn);
+
+ find_sub_basic_blocks (BLOCK_FOR_INSN (insn));
}
}