[Bug tree-optimization/86043] strlen after memcpy partially overwriting a string not optimized
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 26 16:46:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86043
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Thu Jul 26 16:45:43 2018
New Revision: 263018
URL: https://gcc.gnu.org/viewcvs?rev=263018&root=gcc&view=rev
Log:
PR tree-optimization/86043 - strlen after memcpy partially overwriting a string
not optimized
PR tree-optimization/86042 - missing strlen optimization after second strcpy
gcc/ChangeLog:
PR tree-optimization/86043
PR tree-optimization/86042
* tree-ssa-strlen.c (handle_builtin_memcpy): Handle strict overlaps.
(get_string_cst_length): Rename...
(get_min_string_length): ...to this. Add argument.
(handle_char_store): Extend to handle multi-character stores by
MEM_REF.
* tree.c (initializer_zerop): Use new argument. Handle MEM_REF.
* tree.h (initializer_zerop): Add argument.
gcc/testsuite/ChangeLog:
PR tree-optimization/86043
PR tree-optimization/86042
* gcc/testsuite/gcc.dg/attr-nonstring-2.c: Xfail test cases due to
pr86688.
* gcc.dg/strlenopt-44.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/strlenopt-54.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/attr-nonstring-2.c
trunk/gcc/tree-ssa-strlen.c
trunk/gcc/tree.c
trunk/gcc/tree.h
More information about the Gcc-bugs
mailing list