[Bug middle-end/86471] GCC/libstdc++ outputs inferior code for std::fill and std::fill_n vs std::memset on c-style arrays

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 13 07:19:00 GMT 2018


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

--- Comment #9 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> This is incorrect for floating point types

Because of negative 0 I assume.

> And it introduces an extra check at runtime if value is not known to compile time.

We could also use __builtin_constant_p, if the function is inlined often enough
(don't know if it is).

Best would still be to see if we can enable parts of ldist at -O2.


More information about the Gcc-bugs mailing list