public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110722] New: FP is Saved/Restored around inline assembly
@ 2023-07-18 15:35 palmer at gcc dot gnu.org
  2023-07-18 19:29 ` [Bug target/110722] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: palmer at gcc dot gnu.org @ 2023-07-18 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110722
           Summary: FP is Saved/Restored around inline assembly
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: palmer at gcc dot gnu.org
  Target Milestone: ---

I'm not sure if this is some ABI-related requirement that I've managed to
forget about, but it looks like we're saving/restoring FP around inline
assembly.

long fp_asm(long arg0)
{
    asm volatile ("addi a0, a0, 1" : "+r"(arg0));
    return arg0;
}

produces

fp_asm(long):
        addi    sp,sp,-16
        sd      s0,8(sp)
        addi    s0,sp,16
        addi a0, a0, 1
        ld      s0,8(sp)
        addi    sp,sp,16
        jr      ra

We've got a ton of inline assembly in Linux these days and defconfig has
`-fno-omit-frame-pointer`, so this probably manifests as a performance issue
for someone somewhere -- though Clement just ran into it because he was
curious, so I don't have anything concrete.

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

* [Bug target/110722] FP is Saved/Restored around inline assembly
  2023-07-18 15:35 [Bug target/110722] New: FP is Saved/Restored around inline assembly palmer at gcc dot gnu.org
@ 2023-07-18 19:29 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-18 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this will be fixed with -momit-leaf-frame-pointer patch at :
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624752.html

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

end of thread, other threads:[~2023-07-18 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 15:35 [Bug target/110722] New: FP is Saved/Restored around inline assembly palmer at gcc dot gnu.org
2023-07-18 19:29 ` [Bug target/110722] " pinskia 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).