diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2024-01-12 12:38:00 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-01-12 12:38:00 +0000 |
commit | 0d74ff2d7e6cb0698282c506b6655cc06bcfe3d8 (patch) | |
tree | 13caafe2d2f368ce3799f4537fc80b901ea7b33b /gcc/function.cc | |
parent | 81d309168b2a058d4c8ad5430abb56cfe1f82188 (diff) | |
download | gcc-0d74ff2d7e6cb0698282c506b6655cc06bcfe3d8.zip gcc-0d74ff2d7e6cb0698282c506b6655cc06bcfe3d8.tar.gz gcc-0d74ff2d7e6cb0698282c506b6655cc06bcfe3d8.tar.bz2 |
Keep track of the FUNCTION_BEG note
function.cc emits a NOTE_FUNCTION_BEG after all arguments have
been copied to pseudos. It then records this note in parm_birth_insn.
Various other pieces of code use this insn as a convenient place to
insert things at the start of the function.
However, cfgexpand later changes parm_birth_insn as follows:
/* If we emitted any instructions for setting up the variables,
emit them before the FUNCTION_START note. */
if (var_seq)
{
emit_insn_before (var_seq, parm_birth_insn);
/* In expand_function_end we'll insert the alloca save/restore
before parm_birth_insn. We've just insertted an alloca call.
Adjust the pointer to match. */
parm_birth_insn = var_seq;
}
But the FUNCTION_BEG note is still useful for things that aren't
sensitive to stack allocation, and it has the advantage that
(unlike the var_seq above) it is never deleted or combined.
This patch adds a separate variable to track it.
gcc/
* emit-rtl.h (rtl_data::x_function_beg_note): New member variable.
(function_beg_insn): New macro.
* function.cc (expand_function_start): Initialize function_beg_insn.
Diffstat (limited to 'gcc/function.cc')
-rw-r--r-- | gcc/function.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/function.cc b/gcc/function.cc index de356f7..5ffd438 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -5202,7 +5202,7 @@ expand_function_start (tree subr) gcc_assert (NOTE_P (get_last_insn ())); - parm_birth_insn = get_last_insn (); + function_beg_insn = parm_birth_insn = get_last_insn (); /* If the function receives a non-local goto, then store the bits we need to restore the frame pointer. */ |