From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F6FB3858D35; Wed, 30 Jun 2021 06:28:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F6FB3858D35 From: "rguenth at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed cf_known_to_work cc cf_known_to_fail cf_gcctarget bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2021 06:28:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98776 Richard Biener 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 --- Confirmed. void __attribute__((noipa)) foo() { } int main() { foo (); } > gcc-10 t.c -g -fpatchable-function-entry=3D16 -O > gdb ./a.out=20 GNU gdb (GDB; SUSE Linux Enterprise 15) 10.1 ... (gdb) disassemble foo Dump of assembler code for function foo: 0x00000000004004a6 <+0>: ret=20=20=20=20 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=