From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8CF303858D1E; Thu, 7 Sep 2023 20:50:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CF303858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694119829; bh=bJ2xn/F1WUoI7z3kC81qlrXwmE0rk1EQ4ZtlcWUBHAo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cYulLJAUyDqmdhVRLYDRU/FLHwNEJrCbXcvzC4ZoY4Kf6AZCAkoL2MUlAHmhDubmJ Y6JlcUw3MS/POLWZTO29CRz7UAF+daul1Z67jTBEjBZj5DFwlMJTEMnypBvDe0edCx vCals4W3wv84HH6RgguKD0ompmOWEYOC3BnL/RM8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111331] Wrong code at -O1 on x86_64-linux-gnu since Date: Thu, 07 Sep 2023 20:50:29 +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: 14.0 X-Bugzilla-Keywords: needs-bisection, 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: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component everconfirmed cf_reconfirmed_on target_milestone cf_known_to_work keywords cf_known_to_fail bug_status 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=3D111331 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c |tree-optimization Ever confirmed|0 |1 Last reconfirmed| |2023-09-07 Target Milestone|--- |11.5 Known to work| |5.1.0 Keywords| |needs-bisection, wrong-code Known to fail| |6.1.0 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski --- Confirmed, note that patch just exposed a latent bug. Here is a testcase wh= ich shows the failure even in GCC 6 but works in GCC 5: ``` int a; int b; int c(int d, int e, int f) { if (d < e) return e; return (d > f) ? f : d; } int main() { int g =3D -1; a =3D c(b + 30, 29, g + 29); volatile int t =3D a; if (a !=3D 28) __builtin_trap(); } ```=