From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58CC33858D37; Fri, 3 Mar 2023 13:51:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58CC33858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677851509; bh=5bHqaXXBdsJ1As2AU6QHk4GXSBWyPOxa3nf0xu2oiXQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tW4Vni+eRsduqIDwfaSLrAYIMKpFWRvKHNIIHMSdNj2YsoPM3KYhyYKlSIj9zdnaY jNVt7q7QYWQbWg6Ed+d3d627qE7c8BhazxuEcpPuFPNgRQ75W5DqJ6b5saeni02XSg Mx21EaFrQxatul/6SJfAj0GPnmMiNzexoG3wCwEU= 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 13:51:49 +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: cc 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mark at gcc dot gnu.org --- Comment #5 from Jakub Jelinek --- (In reply to Ulrich Weigand from comment #4) > (In reply to Jakub Jelinek from comment #3) > > What is done on other arches? >=20 > That depends on the platform ABI. On some arches, including x86/x86_64 a= nd Ah, you're right here, such functions effectively return that invisible ret= urn address pointer on x86. Though, relying on DW_OP_entry_value is not reliable, if e.g. tail calls are (or could be) involved, then GDB needs to punt. So, I wonder if we just shouldn't ask for a DWARF 6 extension here, have so= me way for the compiler to specify DW_AT_location for the return value. Then for -O1+ -g with var-tracking that address could be for PowerPC r3 register in such functions or wherever its initial value is tracked (includ= ing DW_OP_entry_value). While for -O0, we'd see we've spilled that parameter to stack and would set DW_AT_location to that place spilled on the stack.=