From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 409873858430; Tue, 7 Mar 2023 08:53:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 409873858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678179208; bh=qv6Ukqk5yggWqHyGzVhaZnpE9RWdozxeL7Nh7tVAXNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rQCBidTI4KesIL7WWnzV9LXTWjtGeDFHtuLGfySxiFHaVK259oP++HwxdW435YOPb +FUlYTcTxSxKNuVCMDhxCRzqyzjEeHJTb3Y8JIlsDXuRIbrGMXIXz0RiQg9cOVHpUc mMTAsQLcmuiGLU2HL22A1GRNcCsZgaGS2O5TXTS0= 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: Tue, 07 Mar 2023 08:53:28 +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 #10 from Jakub Jelinek --- (In reply to Ulrich Weigand from comment #8) > (In reply to Jakub Jelinek from comment #5) > > Though, relying on DW_OP_entry_value is not reliable, if e.g. tail call= s are > > (or could be) involved, then GDB needs to punt. >=20 > The only way a tail call could happen is if the return value is > passed through directly to the (caller's) caller, so the return > buffer address should still be correct, right? If there is just a single possible tail call, I think GDB still handles it, so that would be ok. But if you have multiple possible tail calls, I think= GDB for DW_OP_entry_value evaluation punts (at least should, because it doesn't know which sequence of calls has been taken). > I don't think it is possible to track the value in the callee - the value > may not be available *anywhere* because it is no longer needed. (Also, I > don't think the implicit return buffer address is guaranteed to be spilled > to the stack even at -O0.) Well, at -O0 we can certainly guarantee it is available somewhere, even if = we currently don't do it already (it would surprise me if it is not spilled).=