[Bug middle-end/123111] [16 Regression] gcc.target/sh/pr51244-9.c fails after make_forwarders_with_degenerate_phis addition, missing ifconv

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Dec 14 00:36:19 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123111

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Thinking about this, we can do some basic ifconv in the last phiopt.
That is if we have:
```
if (a) goto bb1; else goto bb2;
bb1:
bb2:
b = PHI <c(bb1),d(bb0)>
```

This can be convert to:
b = a ? c : d;

if `fold_before_rtl_expansion_p()` is true (and the middle bb's are empty).

This will fix this issue and maybe even help other ifconv which we had issues
with before.

expand will then decide what is best for the COND_EXPR.

I might have a patch early next week.


More information about the Gcc-bugs mailing list