From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 190E83874C24; Mon, 1 Mar 2021 12:36:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 190E83874C24 From: "sebastian.huber@embedded-brains.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99151] Missed optimization: Superfluous stack frame and code with noreturn or __builtin_unreachable() Date: Mon, 01 Mar 2021 12:36:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: sebastian.huber@embedded-brains.de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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 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: Mon, 01 Mar 2021 12:36:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99151 --- Comment #6 from Sebastian Huber --- (In reply to Eric Botcazou from comment #5) > static void > sparc_asm_function_epilogue (FILE *file) > { > /* If the last two instructions of a function are "call foo; dslot;" > the return address might point to the first instruction in the next > function and we have to output a dummy nop for the sake of sane > backtraces in such cases. This is pointless for sibling calls since > the return address is explicitly adjusted. */ This nop behaviour could be a bit inconsistent across architectures. For example, arm and powerpc don't generate a nop here. I still think that the profiling counter increment in the __builtin_unreachable() path is a bug.=