This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/83022] malloc & memset -> calloc is not always an optimization
- From: "nathan at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Nov 2017 22:10:06 +0000
- Subject: [Bug middle-end/83022] malloc & memset -> calloc is not always an optimization
- Auto-submitted: auto-generated
- References: <bug-83022-4@http.gcc.gnu.org/bugzilla/>
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.