From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B22A3858C98; Thu, 4 Apr 2024 17:09:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B22A3858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712250550; bh=ifMPWU/LViPl1PKoTjCyvk6Yvibgv2zFNN5DwKKXZks=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E0ygFqy+mMWteXzaKHReaIN2TaTVAtu0gRpG3ojycS/OxUhf6y4nlg8DSJD+yc1yZ VvwtqqBPYaT5ZdbU4eDoxQLGu48DB2RYQ8yW9NRGZzW3/A7uTJD9QJUW78ZrN2qkEW nIuyPVlGpeMoCHsFCwiets4bIJT7vNImGGW/lmBQ= From: "sainan+gcc.bugzilla at calamity dot gg" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110773] [Aarch64] crash (SIGBUS) due to atomic instructions on under-aligned memory Date: Thu, 04 Apr 2024 17:09:09 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sainan+gcc.bugzilla at calamity dot gg X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110773 --- Comment #5 from Sainan --- (In reply to Wilco from comment #4) > The atomic will also set correct struct alignment. My thinking was that maybe this is not the case (=3D standard library issue) since both GCC and Clang seem to be causing this issue, but manually adding alignas(16) also didn't help. > You would get a crash if you build for LSE so you get a LDADDAL instructi= on > and then run it on a CPU that doesn't. So try -mcpu=3Dnative and it should > work. -mcpu=3Dnative didn't fix the SIGBUS, only removed __aarch64_ldadd4_acq_rel= from the stack trace. FWIW, the CPU on this system where I get the SIGBUS is Cortex-A76, which sh= ould support LSE and atomics, but it seems everytime it encounters atomics, it j= ust throws a SIGBUS. It works fine on Snapdragon 8cx Gen 3.=