[Bug c/67618] malloc+memset optimization breaks code
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 17 19:43:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67618
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Why do you call it wrong? It is always legal to replace malloc with calloc, and
if we do it, the memset becomes useless. It may not be optimal from a
performance POV, but I don't see where it breaks anything.
As for the infinite loop, that's a know problem not specific to this function
and there are already several PRs/emails about it. When you compile the C
library itself, you are supposed to pass some options to gcc so it knows not to
do that.
More information about the Gcc-bugs
mailing list