[Bug tree-optimization/80487] redundant memset/strncpy calls not eliminated

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 22 07:57:00 GMT 2017


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

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
In tree-ssa-alias.c, stmt_kills_ref_p knows about memcpy but not about strncpy
(I had no idea until I read the man page just now that strncpy filled the
buffer with 0s). Since the 2 arguments of strncpy are not allowed to overlap,
the case for memcpy should also be valid for strncpy.


More information about the Gcc-bugs mailing list