From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C7FCB386CE4B; Thu, 30 Jun 2022 07:57:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7FCB386CE4B From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106131] [10/11/12/13 Regression] -fstrict-aliasing breaks normal program that does not use any pointer or reference Date: Thu, 30 Jun 2022 07:57:34 +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: 12.1.0 X-Bugzilla-Keywords: alias, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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: Thu, 30 Jun 2022 07:57:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106131 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org --- Comment #8 from Richard Biener --- So the issue seems to be that fre1 transforms : _1 =3D (long unsigned int) i_13; _2 =3D _1 * 8; _3 =3D _18 + _2; _40 =3D MEM[(const struct Pair &)_18].a; _3->a =3D _40; _44 =3D MEM[(const struct Pair &)_18].b; _3->b =3D _44; if (i_13 =3D=3D 0) goto ; [INV] else goto ; [INV] : _5 =3D (long unsigned int) i_13; _6 =3D _5 * 8; _7 =3D _18 + _6; _45 =3D MEM[(const struct Pair &)_18 + 16].a; _7->a =3D _45; _46 =3D MEM[(const struct Pair &)_18 + 16].b; _7->b =3D _46; : _9 =3D (long unsigned int) i_13; _10 =3D _9 * 8; _11 =3D _18 + _10; x =3D MEM[(const struct Pair &)_11]; y =3D MEM[(const struct Pair &)_18 + 8]; _47 =3D MEM[(const int &)&x + 4]; _48 =3D MEM[(const int &)&y + 4]; if (_47 < _48) goto ; [50.00%] else goto ; [50.00%] into ... : x =3D MEM[(const struct Pair &)_3]; y =3D MEM[(const struct Pair &)_18 + 8]; _48 =3D MEM[(const int &)&y + 4]; if (_44 < _48) goto ; [50.00%] else goto ; [50.00%] CSEing the load _47 =3D MEM[(const int &)&x + 4]; to _44 crossing the conditional clobber in BB4.=