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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-06-30
     Ever confirmed|0                           |1
      Known to work|                            |11.1.0
                 CC|                            |rguenth at gcc dot gnu.org
      Known to fail|                            |10.3.0
             Target|x86,arm64                   |x86_64-*-* aarch64
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

void __attribute__((noipa)) foo() { }
int main() { foo (); }

> gcc-10 t.c -g -fpatchable-function-entry=16 -O
> gdb ./a.out 
GNU gdb (GDB; SUSE Linux Enterprise 15) 10.1
...
(gdb) disassemble foo
Dump of assembler code for function foo:
   0x00000000004004a6 <+0>:     ret    
End of assembler dump.
(gdb) b foo
Breakpoint 1 at 0x400496 (2 locations)

so the symbol is at 0x400496 but low-pc is 0x4004a6

On trunk the FDE start/end labels look correct:

foo:
.LFB0:
        .cfi_startproc
        .section        __patchable_function_entries,"awo",@progbits,foo
        .align 8
        .quad   .LPFE1
        .text
.LPFE1:
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        ret
        .cfi_endproc
.LFE0:

and it seems to work there.  Quick verification shows it works with GCC 11+
but fails with GCC 10 which has

foo:
        .section        __patchable_function_entries,"aw",@progbits
        .align 8
        .quad   .LPFE1
        .text
.LPFE1:
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
.LFB0:
        .file 1 "t.c"
        .loc 1 1 35 view -0
        .cfi_startproc
        .loc 1 1 37 view .LVU1
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo

Reply via email to