From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B4CA93856DC2; Thu, 6 Oct 2022 18:02:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4CA93856DC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665079375; bh=9UHQio+WEFlZgUPTTdKkLm7/noKxPZ0OghmbATH+YG4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TQmKdEYlmxYty8B4eg1e413ELxvl2sSNA32+pom1u33+o1lsjekJrsW8UMxrFw54q 3J/Mu/bdHXersmwV94urVmSSb0D7QXnIIiKX78irgiipcoffHP/aXMR0WH/rBKrYvY ukblDYeHnkGUFM5e9sO2eyMkQcLyrJ4AA4HpPq4I= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu Date: Thu, 06 Oct 2022 18:02:55 +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: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal 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: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc bug_status cf_reconfirmed_on everconfirmed 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107172 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|wrong code with "-O1 |[13 Regression] wrong code |-ftree-vrp" on |with "-O1 -ftree-vrp" on |x86_64-linux-gnu |x86_64-linux-gnu Status|UNCONFIRMED |NEW Last reconfirmed| |2022-10-06 Ever confirmed|0 |1 Target Milestone|--- |13.0 --- Comment #1 from Andrew Pinski --- Confirmed. Reduced a little bit more: ``` int a, c, d; int main() { long e =3D 1; int f =3D a =3D 1; L1: if (a) a =3D 2; int h =3D e =3D ~e; c =3D -1; if (e >=3D a) goto L2; if (-1 > a) goto L1; if (a) f =3D -1; L2: d =3D (-f + d) & h; if (d) __builtin_abort(); return 0; } ``` Note the store for c is important there. I suspect otherwise the load to e = is figured out and does the correct thing.=