public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104689] New: aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register
@ 2022-02-25 14:58 nsz at gcc dot gnu.org
  2022-05-25  8:20 ` [Bug target/104689] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2022-02-25 14:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689

            Bug ID: 104689
           Summary: aarch64: libgcc: DW_CFA_val_expression is not
                    supported for RA_SIGN_SATE register
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

gcc emits DW_CFA_AARCH64_negate_ra_state (DW_CFA_window_save) for pac-ret
but it's valid to set the RA_SIGN_STATE pseudo register via other dwarf
instructions.

currently libgcc unwinder can crash if DW_CFA_val_expression is used to
set the register value directly.
(reportedly the cranelift compiler can generate such code.)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/104689] aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register
  2022-02-25 14:58 [Bug target/104689] New: aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register nsz at gcc dot gnu.org
@ 2022-05-25  8:20 ` cvs-commit at gcc dot gnu.org
  2022-05-25  8:25 ` nsz at gcc dot gnu.org
  2022-11-20 22:34 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-25  8:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Szabolcs Nagy <nsz@gcc.gnu.org>:

https://gcc.gnu.org/g:0d344b557604e966dc7f91739881f03e1f221efd

commit r13-753-g0d344b557604e966dc7f91739881f03e1f221efd
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Feb 10 17:42:56 2022 +0000

    aarch64: Fix pac-ret with unusual dwarf in libgcc unwinder [PR104689]

    The RA_SIGN_STATE dwarf pseudo-register is normally only set using the
    DW_CFA_AARCH64_negate_ra_state (== DW_CFA_window_save) operation which
    toggles the return address signedness state (the default state is 0).
    (It may be set by remember/restore_state CFI too, those save/restore
    the state of all registers.)

    However RA_SIGN_STATE can be set directly via DW_CFA_val_expression too.
    GCC does not generate such CFI but some other compilers reportedly do.

    Note: the toggle operation must not be mixed with other dwarf register
    rule CFI within the same CIE and FDE.

    In libgcc we assume REG_UNSAVED means the RA_STATE is set using toggle
    operations, otherwise we assume its value is set by other CFI.

    libgcc/ChangeLog:

            PR target/104689
            * config/aarch64/aarch64-unwind.h (aarch64_frob_update_context):
            Handle the !REG_UNSAVED case.
            * unwind-dw2.c (execute_cfa_program): Fail toggle if !REG_UNSAVED.

    gcc/testsuite/ChangeLog:

            PR target/104689
            * gcc.target/aarch64/pr104689.c: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/104689] aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register
  2022-02-25 14:58 [Bug target/104689] New: aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register nsz at gcc dot gnu.org
  2022-05-25  8:20 ` [Bug target/104689] " cvs-commit at gcc dot gnu.org
@ 2022-05-25  8:25 ` nsz at gcc dot gnu.org
  2022-11-20 22:34 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nsz at gcc dot gnu.org @ 2022-05-25  8:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689

nsz at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from nsz at gcc dot gnu.org ---
fixed for gcc-13

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/104689] aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register
  2022-02-25 14:58 [Bug target/104689] New: aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register nsz at gcc dot gnu.org
  2022-05-25  8:20 ` [Bug target/104689] " cvs-commit at gcc dot gnu.org
  2022-05-25  8:25 ` nsz at gcc dot gnu.org
@ 2022-11-20 22:34 ` ramana at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ramana at gcc dot gnu.org @ 2022-11-20 22:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org

--- Comment #3 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
(In reply to nsz from comment #2)
> fixed for gcc-13

In an AArch64 Ubuntu 22.04 VM on my Apple Silicon M1 I see :  

Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit
uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint


i.e. PACA / PACG ,

I see this test failing with trunk as of
136029059686fed2d99c755baf35f98553fc0232 simply bootstrapped with
$srcdir/configure --enable-languages=c,c++ . 

I'll see if I can pull something out when I have some time.

Ramana

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-20 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 14:58 [Bug target/104689] New: aarch64: libgcc: DW_CFA_val_expression is not supported for RA_SIGN_SATE register nsz at gcc dot gnu.org
2022-05-25  8:20 ` [Bug target/104689] " cvs-commit at gcc dot gnu.org
2022-05-25  8:25 ` nsz at gcc dot gnu.org
2022-11-20 22:34 ` ramana at gcc dot gnu.org

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).