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

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Paul Cercueil from comment #2)
> 
> Well, but I'm doing
> 
>     if (x < -1.0f)
>         x2 += -1.0f;
> 
> So that's only one constant, -1.0.

Yes, that's what you wrote in the code.  But the "+ -1" operation gets
canonicalized to "- +1" and the constant is changed, which is a valid
transformation.  This results in two constants being used.

This could be fixed with some SH specific RTL pass to look out for +1 and -1 fp
constant uses.  Not sure if there's a simpler way.

Reply via email to