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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> This actually undos some of what phi-opt might do and only should be done
> for a few operations.  I think divide, multiple, shifts and rotates should
> be done and only with a constant operand.  This has to be done late very
> close to expand even.
> 
> I will be implementing this but might miss GCC 12 as I have a lot on my
> plate already for GCC 12.

It turns out this is still true. I had implemented the binary factoring out of
operations for phiopt and end up with a failure with
`gcc.dg/tree-prof/val-prof-1.c` which depends on phiopt not doing this. Note
only one of the phi nodes needs to be constant for when we want to handle it.

Oh I wonder if val-prof-1.c is still going to fail since we had originally:
if (a == CST) b = CST/c; else b = a/c;

And now we might have removed the if .. Woops. Anyways I will have to go and
dig into that failure some more but this issue is now needed again too.

Reply via email to