From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 97D9F3858403; Sat, 27 Jan 2024 13:45:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97D9F3858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706363139; bh=v2wZGLEML+EWOWyJtWu8CQrlHCVY5P0/56ARS6HmyAY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ocaKtTj/iFtYg5XDqnIKJV9W8q45GhFxHOudZsz89V4mH2AYfkqaxHqeJ3w9smkIb u6NKckZue4FH6Gl2Q3Jk7HFDsh5mIJyvKLqM11wRgiLn52javSbLZ+3UyRYDhPWq/d sOZGtePab7F57v1r8KIv0UHWP9xKR2hJJ0oFVEFI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function Date: Sat, 27 Jan 2024 13:45:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal 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=3D38534 --- Comment #19 from Jakub Jelinek --- (In reply to H.J. Lu from comment #18) > (In reply to Jakub Jelinek from comment #17) > > E.g. shouldn't it at least be disabled for -O0 and -Og and shouldn't we >=20 > We can disable this for -O0 and -Og. I think we should go for that. > > somehow indicate in DWARF unwind info that the callee saved registers > > weren't saved and were clobbered? Even if backtrace itself still works= make >=20 > Is there such a DWARF bit? There is the undefined state (DW_CFA_undefined, .cfi_undefined directive in gas). But DWARF says undefined is the default state unless an ABI specifies somet= hing else for certain registers (or unless overridden in CIE or FDE), so I must = say I don't remember what is done usually and whether the default state isn't w= hat is enough. But it would really surprise me if the call saved registers weren't treated= as same_value at the start of the function and I believe nothing emits DW_CFA_same_value in the CIEs.=