[Bug middle-end/83022] malloc & memset -> calloc is not always an optimization

nathan at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 16 22:10:00 GMT 2017


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

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Yes, this is a measurable degradation in going from gcc 4.9 -> 5.0 with myrocks
DB.  Apparently 25% more queries/sec with gcc 4.9 (I think it's from a
benchmark).  Profiling (by others) has fingered this optimization.

I am in the process of implementing a check to see if the only condition
between the malloc and memset is 'ptr != 0'.

I noticed the crazy default probabilities during investigating this.  I think
that's really a second-order problem.


More information about the Gcc-bugs mailing list