From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E22763858C42; Thu, 25 Apr 2024 23:55:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E22763858C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714089341; bh=iXtTUjOX5i+WO9/eXCIhCl4blsTFilatZ5aHtnome4U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H6m04fF8z+ZBQqZU0XUteJl9VdG7f+CSmCmhY2aeDT+UlJMh/SYjtIhHtctFqhVsl DVvGN/1TiKyh2rcKaCsnSRNdYGdASs5Dup46VXGD/qVfrycEeD4/m1G77QPuvx1G5O ojLhwqr4YNLe+5dhhjtwPfVEzSAWhp6N0V29HWOc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114843] aarch64: epilogue in _Unwind_RaiseException corrupts return value due to __builtin_eh_return Date: Thu, 25 Apr 2024 23:55:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: critical X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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=3D114843 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org --- Comment #11 from Andrew Pinski --- I have a fix for aarch64, able to produce now: ``` f: .LFB0: .cfi_startproc stp x0, x1, [sp, -32]! .cfi_def_cfa_offset 32 .cfi_offset 0, -32 .cfi_offset 1, -24 stp x2, x3, [sp, 16] .cfi_offset 2, -16 .cfi_offset 3, -8 ldr w0, [x0] cmp w0, 5 bne .L8 add sp, sp, 32 .cfi_remember_state .cfi_def_cfa_offset 0 ret .L8: .cfi_restore_state mov x5, x1 ldp x2, x3, [sp, 16] ldp x0, x1, [sp], 32 .cfi_restore 1 .cfi_restore 0 .cfi_restore 2 .cfi_restore 3 .cfi_def_cfa_offset 0 add sp, sp, x5 ret .cfi_endproc ``` Which is exactly what we should produce I think. The patch is a bit more complex than I expected but that is due to how aarc= h64 has some of the most complex epilogues.=