From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC2673858402; Sun, 3 Mar 2024 07:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC2673858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709449830; bh=oLXeSXn9I39wdhzCltfSntWAEUXml1RY2d7wIYKkr7I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rz4j1EW6cA9+L4Zu2sJAypo+rOU+1kprrMRub/Lqn3i47/o0keWVEr6/aRjgwvAEA CqJYLfpxQybOl3oj3xVQrbUg9zWupf7sysw+EczAy9G56MqlVhTMa9eIAJvWHyqdTI w5jrAHgK/BBtOezY4eWPAVB+4h3dYJflRIMZAAhQ= 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:10:30 +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: bug_status resolution 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 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- >but also emits code to assert alignment. Yes because the code is broken still. The alignment is not about when the access happens but rather when the poin= ter is casted to. So in this case when passing in the argument to f, the argument entry shoul= d be aligned to what the `struct dir_entry` is aligned to; otherwise it is undef= ined code.=