From: Jeff Law <jeffreyalaw@gmail.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [PATCH] Keep track of the FUNCTION_BEG note
Date: Tue, 9 Jan 2024 11:45:27 -0700 [thread overview]
Message-ID: <164587d3-383e-4617-8520-25d402bc8eb8@gmail.com> (raw)
In-Reply-To: <mptle934ue9.fsf@arm.com>
On 1/5/24 09:28, Richard Sandiford wrote:
> 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.
>
> Tested on aarch64-linux-gnu, where it's needed for fixing PR113196.
> OK to install?
>
> Richard
>
>
> 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.
OK
jeff
prev parent reply other threads:[~2024-01-09 18:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 16:28 Richard Sandiford
2024-01-09 18:45 ` Jeff Law [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=164587d3-383e-4617-8520-25d402bc8eb8@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).