From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EBC8B3858D37; Fri, 3 Mar 2023 09:24:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBC8B3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677835462; bh=KJNqpsZsWKYIbiUGX3iO4smW5hARg7a0Pg87/itvZ/0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ay892k9Ky/QrEPQ73IZLMrr2lrZqEQHGMdDRtxYcX5WBDGAGdNq1UenGwUhfHgZCt 1708oRkIct6W9Pk4kVS1uHWo+2BA0e0V+yVC/uTtuqMSm1wH4jjy8rr4mOAoUgE5js 2FEPM5NT/1hsT0A9RP24eOhrVbC+/kCG3BkaIWIM= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/108996] Proposal for adding DWARF call site information in GCC with -O0 Date: Fri, 03 Mar 2023 09:24:22 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108996 --- Comment #3 from Jakub Jelinek --- What is done on other arches? I mean the situation is basically the same on x86_64, where the artificial return value pointer argument is spilled early, then clobbered on calls and again b debug info is correct after the spill: pushq %rbp movq %rsp, %rbp subq $16, %rsp movq %rdi, -8(%rbp) movl %esi, -12(%rbp) movl %edx, -16(%rbp) movq -8(%rbp), %rax movq %rax, %rdi call _ZN1BC1Ev movl -12(%rbp), %edx movl -16(%rbp), %eax addl %eax, %edx movq -8(%rbp), %rax movl %edx, (%rax) nop movq -8(%rbp), %rax leave ret ... .byte 0x1 # uleb128 0x1; (DIE (0xcc) DW_TAG_variable) .ascii "b\0" # DW_AT_name # DW_AT_decl_file (1, pr108996.C) .byte 0x1f # DW_AT_decl_line .byte 0x8 # DW_AT_decl_column .long 0x2a # DW_AT_type .byte 0x2 # uleb128 0x2; DW_AT_location .byte 0x91 # DW_OP_fbreg .byte 0x64 # sleb128 -28=