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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #5)
> (In reply to Jakub Jelinek from comment #2)
> >     b[i] = __builtin_fma (0.0f, 0.0f, a[i]);
> 
> I am surprised we don't optimize that line, at least with -fno-signed-zeros.
> If the testcase still works with less trivial numbers, that might be better,
> in case we add such optimizations in the future?

I've changed the testcase to
__builtin_fma (1024.0f, 1024.0f, a[i]);
which ICEs without the patch the same way.

Feel free to open an enhancement PR for the fma (0, 0, ...) or fma (..., ...,
0)
cases which indeed could be folded at least for -ffast-math to the last
argument or multiplication of the first two arguments.

Reply via email to