public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/98776] DW_AT_low_pc is inconsistent with function entry address, when enabling -fpatchable-function-entry
Date: Wed, 30 Jun 2021 06:28:06 +0000	[thread overview]
Message-ID: <bug-98776-4-xOx2gbplvW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98776-4@http.gcc.gnu.org/bugzilla/>

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

  parent reply	other threads:[~2021-06-30  6:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  6:32 [Bug debug/98776] New: " lvlin at mail dot ustc.edu.cn
2021-03-31 10:21 ` [Bug debug/98776] " rearnsha at gcc dot gnu.org
2021-06-29 17:06 ` luis.machado at linaro dot org
2021-06-30  6:28 ` rguenth at gcc dot gnu.org [this message]
2021-06-30  6:28 ` rguenth at gcc dot gnu.org
2021-06-30  7:12 ` marxin at gcc dot gnu.org
2021-06-30  8:06 ` rguenth at gcc dot gnu.org
2021-06-30  8:20 ` marxin at gcc dot gnu.org
2021-06-30  8:27 ` rguenth at gcc dot gnu.org
2022-09-29 20:50 ` spop at gcc dot gnu.org
2022-12-01  3:11 ` spop at gcc dot gnu.org
2022-12-08 17:12 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:08 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:10 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:12 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:15 ` spop at gcc dot gnu.org

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=bug-98776-4-xOx2gbplvW@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).