[Bug tree-optimization/82732] malloc+zeroing other than memset not optimized to calloc, so asm output is malloc+memset

peter at cordes dot ca gcc-bugzilla@gcc.gnu.org
Thu Oct 26 11:56:00 GMT 2017


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

--- Comment #3 from Peter Cordes <peter at cordes dot ca> ---
(In reply to Marc Glisse from comment #2)
> If you use size_t consistently (for size and i), then the resulting code is
> a call to calloc.

Ah interesting.

With a compile-time constant size and -O3 we get calloc as well, even with the
original types, so that's a good thing.


More information about the Gcc-bugs mailing list