From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 73945385841C; Thu, 16 Dec 2021 07:01:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73945385841C From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/85390] [9/10/11/12 Regression] possible missed optimisation / regression from 6.3 with conditional expression Date: Thu, 16 Dec 2021 07:01:08 +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.1 X-Bugzilla-Keywords: missed-optimization, needs-bisection 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: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_known_to_fail cf_reconfirmed_on target_milestone keywords everconfirmed short_desc cc bug_status component cf_known_to_work 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: Thu, 16 Dec 2021 07:01:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D85390 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |7.1.0 Last reconfirmed| |2021-12-16 Target Milestone|--- |9.5 Keywords| |needs-bisection Ever confirmed|0 |1 Summary|possible missed |[9/10/11/12 Regression] |optimisation / regression |possible missed |from 6.3 with conditional |optimisation / regression |expression |from 6.3 with conditional | |expression CC| |pinskia at gcc dot gnu.org Status|UNCONFIRMED |NEW Component|rtl-optimization |tree-optimization Known to work| |6.4.0 --- Comment #3 from Andrew Pinski --- Ok, the issue is just dumb luck: Take: extern int a, b, c; int f(int x) { __builtin_prefetch((void *) (__SIZE_TYPE__)(x ? a : b)); return c; } int f1(int x) { int t =3D x ? a :b; __builtin_prefetch((void *)(__SIZE_TYPE__)t); return c; } The f1 uses cmov while f does not. The gimple level difference is there is two cast (one in each branch) for f while only one cast outside of the PHI node. But that was that way even in GCC 6. I wonder what changed in GCC 7 which caused this issue to appear.=