From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B72073858425; Sun, 12 Dec 2021 12:30:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B72073858425 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/83541] Missed optimization with int overflow Date: Sun, 12 Dec 2021 12:30: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: 8.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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_severity keywords cf_known_to_work cf_known_to_fail 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: Sun, 12 Dec 2021 12:30:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83541 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Keywords| |needs-bisection Known to work| |12.0 Known to fail| |11.2.0 --- Comment #5 from Andrew Pinski --- Seems to be fixed on the trunk. Folding statement: if (x_2(D) =3D=3D 2147483647) Visiting conditional with predicate: if (x_2(D) =3D=3D 2147483647) With known ranges x_2(D): int VARYING Predicate evaluates to: DON'T KNOW Matching expression match.pd:2077, gimple-match.c:819 Matching expression match.pd:2080, gimple-match.c:892 Matching expression match.pd:2087, gimple-match.c:952 Not folded Folding statement: _4 =3D x_2(D) + 1; gimple_simplified to _4 =3D -2147483648; Folded into: _4 =3D -2147483648; Folding statement: // predicted unlikely by early return (on trees) predict= or. Not folded Folding PHI node: _1 =3D PHI <_4(3), 42(2)> Queued PHI for removal. Folds to: 42 Folding statement: return _1; Folded into: return 42;=