This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/79716] memset followed by overwrite not eliminated


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If we want to do something about this, we should do it regardless if user wrote
it as p = malloc (n); memset (p, 0, n); or p = calloc (n, 1); or p = calloc (1,
n); - if such a calloc is followed by overwriting all bytes in it, we can
transform the calloc back to malloc.  We need to be careful about padding bits
though.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]