From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19F073858D33; Sun, 10 Sep 2023 20:52:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19F073858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694379153; bh=bndUwtWzZtbHGUzfNuLWQYTvJjmbbstv6VoFXp2xRus=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ImafxFV/urI2YSe2sID065yV9fhKbHWac/w2o0aONSUjhR6WodNHUQ/gJJ+HV9CY8 FZMB7F056eQtTptjxddVPjldlaGZs6/g+XQgugTFtqiNf6H59dq6NqXirz1TXnwrEc I7Lyq7R+VSFCb7gFvBbup5ZfQIjvu0euqBuFzuWQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111346] `X <= MINMAX` pattern is missing :c on the cmp Date: Sun, 10 Sep 2023 20:52:32 +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: internal-improvement, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also 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=3D111346 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D96708 --- Comment #2 from Andrew Pinski --- Reduced testcase: ``` static inline _Bool test1 (int a, int b, int c) { return c >=3D a; } int f(); int g(); _Bool test2(int a, int b) { a =3D f(); a =3D g(); int t =3D a; if (t < b) t =3D b; return test1(a,b,t); } ``` This should just reduced to: ``` f (); g (); return 1; ``` But currently we get: ``` f (); a_5 =3D g (); _3 =3D MAX_EXPR ; _7 =3D _3 >=3D a_5; return _7; ``` Which does not match the referenced pattern due to the missing :c on cmp.=