From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 762F03858D37; Fri, 28 Apr 2023 08:56:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 762F03858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682672206; bh=Y4iArjILfclJEt8OxCzl1krbMgtwEmaEo+ZLqypsqno=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WqurXfg2myrXxU95ClhIXuN5qm6ide+VyWiUMxFP1LBO0N3U2UTYZb06zxnVuNPU3 DBD3VpbxTFSjUOTkecD/1lVP+sHCBD80TNxZDxo5V4zDI5luk4ykiN43jk6bzahk2/ Nkthi+iTA0biuJ+tPzuzYql54KDMPrQGwJeUjEPc= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109661] [13/14 Regression] ICE in aarch64_function_arg_alignment when building erlang Date: Fri, 28 Apr 2023 08:56:46 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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=3D109661 --- Comment #4 from rsandifo at gcc dot gnu.org --- Yeah, I'd come up with essentially the same fix locally. Was just trying to see whether it is an ABI problem. And I think it is. For: typedef unsigned long U __attribute__ ((aligned (16))); typedef enum : U { V =3D 0 } W; U foo (int x0, int x1, int x2, int x3, int x4, int x5, int x6, int x7, U a, W= b) { return a + b; } GCC aligns the b stack argument to 16 bytes: ldr x1, [sp] ldr x0, [sp, 16] add x0, x1, x0 ret whereas clang doesn't: ldp x8, x9, [sp] add x0, x9, x8 ret The clang behaviour is correct, so we'll need to fix it on the GCC side. (Neither compiler aligns for register arguments.)=