summaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2018-07-26 16:45:43 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2018-07-26 10:45:43 -0600
commitaca8570e11d28b8c33d26593df6d4725a6140aab (patch)
treebea2270f62332f8d85e1bcd3adcb0c246cb32648 /gcc/tree.h
parent4b8b1f5997e7f16713be5c05e7fd40c122fa9381 (diff)
PR tree-optimization/86043 - strlen after memcpy partially overwriting a string not optimized
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. From-SVN: r263018
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 70ac78130c0..7bed03553b2 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4429,9 +4429,13 @@ extern int list_length (const_tree);
extern tree first_field (const_tree);
/* Given an initializer INIT, return TRUE if INIT is zero or some
- aggregate of zeros. Otherwise return FALSE. */
+ aggregate of zeros. Otherwise return FALSE. If NONZERO is not
+ null, set *NONZERO if and only if INIT is known not to be all
+ zeros. The combination of return value of false and *NONZERO
+ false implies that INIT may but need not be all zeros. Other
+ combinations indicate definitive answers. */
-extern bool initializer_zerop (const_tree);
+extern bool initializer_zerop (const_tree, bool * = NULL);
extern wide_int vector_cst_int_elt (const_tree, unsigned int);
extern tree vector_cst_elt (const_tree, unsigned int);