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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #8)
> Thinking about this slightly. It might make sense to keep the loop exits
> seperate.

That works. And the patch is a few lines because there is already a check for
loop exit:
```
diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index ec3be8125f0..3065f755590 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -10305,7 +10305,7 @@ make_forwarders_with_degenerate_phis (function *fn,
bool skip_ifcvtable)
            continue;
          /* Skip loop exit edges when we are in loop-closed SSA form
             since the forwarder we'd create does not have a PHI node.  */
-         if (loops_state_satisfies_p (LOOP_CLOSED_SSA)
+         if ((loops_state_satisfies_p (LOOP_CLOSED_SSA) || skip_ifcvtable)
              && loop_exit_edge_p (e->src->loop_father, e))
            continue;


```
Though the full patch should change the argument name/comment in front of the
function.

I need to decide if this is the right thing to do. I still think it is working
around the register allocator here. (then again this whole code is working
around out of ssa in the first place). The big question comes will this make
things worse.

Reply via email to