From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C6D6C3858417; Fri, 21 Jul 2023 04:09:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6D6C3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689912590; bh=QF2Yh5quKxqrHZriI+DtH49gAA6r6n4We/Z7AeI2Fz4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=enU6Xutf74W5s7v+2IdmcKRvjAMX5zlTMLizgxROLLR7FEymuFqZAbXvSbp7vFnmU 2RR7DzNA5W/jXNujRuMff1Y17rfXIeSXT4C4njWp/43Ee3Nn6XPboBnJ4nO5QOU8jx eyM5FcF40JuFHnYEvj6lOGy7YrS2Y8JIPExk3jCE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/80574] GCC fail to optimize nested ternary Date: Fri, 21 Jul 2023 04:09:50 +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: 7.0 X-Bugzilla-Keywords: missed-optimization 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: 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=3D80574 --- Comment #10 from Andrew Pinski --- (In reply to Andrew Pinski from comment #9) > One thing I noticed is that: > _2 =3D MAX_EXPR <_6, a3_7(D)>; > _3 =3D MAX_EXPR <_2, a3_7(D)>; >=20 > Is not optimized at all. >=20 > (for minmax (min max) > (simplify > (minmax:c (minmax:c@2 @0 @1) @0) > @2)) Submitted the patch for that as https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625135.html . Note after that patch we get decent code for the original testcases but it = is not fully optimized at the gimple level.=