From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D21633858C98; Thu, 4 Apr 2024 10:44:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D21633858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712227482; bh=AR7IBgT4+1oxKSLa7QJJ8Dd/Py5zGbH6maTwQ3zbpus=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YCAhNFctDnlaAT1isheHwFl9ZSbkSu9BSBlVrNWNCNnAA8j/QAhwmk8hBbreAkQJo iDOzv2Ib9Bfmz6mt9xpfU0mfFI2B2vyD+mZ7L96QT2WTWjuRgHdOvguIrB8pgHb78P NGqS0nzJHsDsfQirrBbgd4d8vnHuXAgE4Zh5F0DA= 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 10:44:41 +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: cc 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 Sainan changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sainan+gcc.bugzilla@calamit | |y.gg --- Comment #3 from Sainan --- I seem to be having a related issue, although in my case the struct looks l= ike this: template struct Data { T* data; std::atomic_uint count; bool flag; }; And it's crashing on `--count;` Surely this is not a user issue in this case because the pointer should alw= ays be 8 bytes, so count should be evenly aligned on a 8-byte boundary. (Unless= the atomic operation needs 16-byte alignment?) Same code also runs fine when compiled via MSVC and run on Windows, although it's unclear if this might simply be my Linux test machine running an older= ARM CPU compared to my Windows on ARM test machine.=