From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98AD9386196E; Wed, 5 May 2021 19:59:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98AD9386196E From: "ndesaulniers at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100363] gcc generating wider load/store than warranted at -O3 Date: Wed, 05 May 2021 19:59:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ndesaulniers at google dot com 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2021 19:59:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100363 Nick Desaulniers changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ndesaulniers at google dot= com --- Comment #20 from Nick Desaulniers --- (In reply to Alexander Monakov from comment #7) > Most likely the issue is that sout/sfrom are misaligned at runtime, whil= e the > vectorized code somewhere relies on them being sufficiently aligned= for a 'short'. > It is unsafe to dereference a misaligned pointer. The pointed-to-type must > have reduced alignment: C 6.3.2.3p7 (N1548) says: A pointer to an object type may be converted to a pointer to a different object type. If the resulting pointer is not correctly aligned) for the referenced type, the behavior is undefined. =3D=3D=3D We're working on adding diagnostics and UBSAN checks for these. Perhaps wi= th those in place, we'd be able to spot such a case in the kernel's initramfs decompression code.=