public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Srinath Parvathaneni <Srinath.Parvathaneni@arm.com>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>,
	Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>,
	Richard.Sandiford@arm.com
Subject: Re: [GCC][PATCH 13/15, v5] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.
Date: Fri, 13 Jan 2023 21:58:26 +0000	[thread overview]
Message-ID: <2b3432d1-587e-4c2e-4297-327ffbe6ad1d@arm.com> (raw)
In-Reply-To: <Y8Gcx43o8bv8jHwQ@tucnak>

On 13/01/2023 18:02, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Jan 13, 2023 at 05:44:15PM +0000, Srinath Parvathaneni via Gcc-patches wrote:
>> Hello,
>>
>> This patch teaches the DWARF support in gcc about RA_AUTH_CODE pseudo hard-register and also
>> updates the ".save", ".cfi_register", ".cfi_offset", ".cfi_restore" directives accordingly.
>> This patch also adds support to emit ".pacspval" directive when "pac ip, lr, sp" instruction
>> in generated in the assembly.
>>
>> RA_AUTH_CODE register number is 107 and it's dwarf register number is 143.
> 
> I'm afraid increasing number of DWARF registers is ABI incompatible change.
> E.g. libgcc __frame_state_for function fills in:
> typedef struct frame_state
> {
>    void *cfa;
>    void *eh_ptr;
>    long cfa_offset;
>    long args_size;
>    long reg_or_offset[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
>    unsigned short cfa_reg;
>    unsigned short retaddr_column;
>    char saved[PRE_GCC3_DWARF_FRAME_REGISTERS+1];
> } frame_state;
> 
> structure, where PRE_GCC3_DWARF_FRAME_REGISTERS defaults to
> __LIBGCC_DWARF_FRAME_REGISTERS__, which is defined to
> DWARF_FRAME_REGISTERS, which defaults to FIRST_PSEUDO_REGISTER.
> So, changing FIRST_PSEUDO_REGISTER is an ABI change unless you arrange for
> PRE_GCC3_DWARF_FRAME_REGISTERS to be defined to the old value.
> 
> 	Jakub
> 

So where's the red flag that warns about this?

I also note that Richard Sandiford made a similar type of change for 
AArch64 in r10-4195 (183bfdafc6f1f98711c5400498a7268cc1441096) and 
nothing was said about that at the time.

It seems incredibly fragile to me to have some ABI based off the number 
of machine registers.

R.

  reply	other threads:[~2023-01-13 21:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 17:44 Srinath Parvathaneni
2023-01-13 18:02 ` Jakub Jelinek
2023-01-13 21:58   ` Richard Earnshaw (lists) [this message]
2023-01-13 22:04     ` Richard Earnshaw
2023-01-13 22:12     ` Jakub Jelinek
2023-01-13 22:25       ` Richard Earnshaw (lists)
2023-01-13 22:39         ` Richard Earnshaw
2023-01-13 22:51           ` Jakub Jelinek
2023-01-18 16:41 ` Richard Earnshaw

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=2b3432d1-587e-4c2e-4297-327ffbe6ad1d@arm.com \
    --to=richard.earnshaw@arm.com \
    --cc=Kyrylo.Tkachov@arm.com \
    --cc=Richard.Sandiford@arm.com \
    --cc=Srinath.Parvathaneni@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).