From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 708033858C42; Fri, 26 Apr 2024 18:39:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 708033858C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714156777; bh=nfpwuuIruD25A8sugvUBI5AotDu1sdl48waICwHSAfs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KR8bx/uDcCAp/w6lggrE+B7wMvRjn38y+5otgUlMMGfKyeQOFeExdJpaMRaECZ2oP 1nBMH//necoXQoTT9vLS4nDDhhQDtiNVtg/+Ndof141sbBUF4qXag26ayfmk7YsmFx 4DtUTFhfhEHgytILRgywgGhKVc8TCHKIw2Bo/F7s= 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: Fri, 26 Apr 2024 18:39:37 +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: 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 --- Comment #18 from Andrew Pinski --- (In reply to Wilco from comment #17) > So I don't believe you should change aarch64_pop_regs at all - it's too l= ate > to change things and just adds unnecessary complexity and more bugs. The > best option would be to handle eh_return explicitly and insert the extra > push/pops rather than treating them like a generic callee-save (because > clearly they are not anymore). Thinking about this I think you are right, I will work on an incremental pa= tch to change them to be in seperate array. Note I do have a fix for the issue = in comment #17, I had a premature optimization thinking only if regno1 was an eh_handler data register, then regno2 could be one; rather they should be checked independently. I will attach that patch to this bug once my testing= is finished. And then will work on splitting out the eh_handler data register load/stores.=