From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 357DF3973031; Thu, 28 May 2020 18:03:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 357DF3973031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590689037; bh=37zubJ7tlpslw3wXAVsdAcrKtbZNwgNc7avWmSsaJfA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xba2zI3OkAwj9PK2xyTMbpvLfLGz4GRQx7IG3Hpu1c2jqNKO8QgC76fFhHip5fY8L YXxONIXdA72X05X3nOw3htsD04JH521HWAlW6B4Nbo2dLrZUHLDB3O4FCgtE0rrQgf v87Bq9XBjsI5daZSKAlNplwwQ0mTphpZa5FAhu6A= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95361] Segfault when generating an epilogue for a partly-shrinked-wrapped SVE frame Date: Thu, 28 May 2020 18:03:57 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo 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: Thu, 28 May 2020 18:03:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95361 --- Comment #3 from CVS Commits --- The releases/gcc-10 branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:c082cb8a2523d8c5afe5710e265bc72dd71aa60b commit r10-8201-gc082cb8a2523d8c5afe5710e265bc72dd71aa60b Author: Richard Sandiford Date: Thu May 28 19:03:46 2020 +0100 aarch64: Fix segfault in aarch64_expand_epilogue [PR95361] The stack frame for the function in the testcase consisted of two SVE save slots. Both saves had been shrink-wrapped, but for different blocks, meaning that the stack allocation and deallocation were separate from the saves themselves. Before emitting the deallocation, we tried to attach a REG_CFA_DEF_CFA note to the preceding instruction, to redefine the CFA in terms of the stack pointer. But in this case there was no preceding instruction. This in practice only happens for SVE because: (a) We don't try to shrink-wrap wb_candidate* registers even when we've decided to treat them as normal saves and restores. I have a fix for that. (b) Even with (a) fixed, we're (almost?) guaranteed to emit a stack tie for frames that are 64k or larger, so we end up hanging the REG_CFA_DEF_CFA note on that instead. We should only need to redefine the CFA if it was previously defined in terms of the frame pointer. In other cases the CFA should already be defined in terms of the stack pointer, so redefining it is unnecessary but usually harmless. 2020-05-28 Richard Sandiford gcc/ PR testsuite/95361 * config/aarch64/aarch64.c (aarch64_expand_epilogue): Only redefine the CFA if we have CFI operations. gcc/testsuite/ PR testsuite/95361 * gcc.target/aarch64/sve/pr95361.c: New test.=