gcc/ChangeLog:
* tree-ssa-strlen.c (handle_builtin_stxncpy): Use full_string_p
rather than endptr as an indicator of nul-termination.
From-SVN: r269809
2019-03-19 Martin Sebor <msebor@redhat.com>
+ PR tree-optimization/89644
+ * tree-ssa-strlen.c (handle_builtin_stxncpy): Use full_string_p
+ rather than endptr as an indicator of nul-termination.
+
PR tree-optimization/89644
* tree-ssa-strlen.c (handle_builtin_stxncpy): Consider unterminated
arrays in determining sequence sizes in strncpy and stpncpy.
if it is known to be nul-terminated. */
if (sidst->nonzero_chars)
{
- if (sidst->endptr)
+ if (sidst->full_string_p)
{
/* String is known to be nul-terminated. */
tree type = TREE_TYPE (sidst->nonzero_chars);
nul if its known to be nul-terminated. */
if (sisrc->nonzero_chars)
{
- if (sisrc->endptr)
+ if (sisrc->full_string_p)
{
tree type = TREE_TYPE (sisrc->nonzero_chars);
srcsize = fold_build2 (PLUS_EXPR, type, sisrc->nonzero_chars,