https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85390
Andrew Pinski <pinskia at gcc dot gnu.org> 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 <pinskia at gcc dot gnu.org> --- 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 = 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.