From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 227453858002; Wed, 24 Mar 2021 09:13:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 227453858002 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99739] [11 Regression] missing optimization of a repeated conditional Date: Wed, 24 Mar 2021 09:13:20 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone 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, 24 Mar 2021 09:13:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99739 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |11.0 --- Comment #1 from Richard Biener --- Whether we handle this or not at -O1 is quite dependent on short-circuiting anyway - we only have jump threading at our hands at -O1 (we could consider enabling non-iterating EVRP). So I'm not sure this is an important regression. At -O2 we end up with [local count: 1073741824]: _7 =3D i_2(D) !=3D 0; _8 =3D j_3(D) !=3D 0; _9 =3D _7 & _8; if (_9 !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 536870911]: _23 =3D k_4(D) !=3D 0; _24 =3D _7 & _23; _11 =3D _8 & _24; if (_11 !=3D 0) goto ; [94.27%] else goto ; [5.73%] [count: 0]: __builtin_abort (); [local count: 1073741824]: return; where reassociation leaves redundant _9 on the plate.=