From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16F673858C55; Sun, 3 Mar 2024 07:15:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16F673858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709450123; bh=zEyisBAy/d4qIQjtAafdHWFxiUdD2GdnfuK6H5tsE78=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dlwnw/+Xb17onWWhBoBUN/FlT3Egxr2DHSEC9sWVMF6CfweW+WSl6Cr/SnGtnpfLZ JEtJLEc62WrkLujaTVzUr/EcUVBfvzyTCQRheKvqDMrJiJcEXSYm53Dky/bOADM7t8 arKwnHasT0sAPGL2+lbZk8guEmzGOFc5PVmfTyKw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/114217] -fsanitize=alignment false positive with intended unaligned struct member access Date: Sun, 03 Mar 2024 07:15:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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=3D114217 --- Comment #2 from Andrew Pinski --- That is if we have: void f(void) { char t[sizeof(int)] __attribute__((aligned(1))); int *a =3D (int*)&t; // } The above code is undefined even if you have not accessed via *a at all.=