builtins.c (unterminated_array): Pass in c_strlen_data * to c_strlen rather than...
commit7d583f4259a56c9054c28e883c375f9c57f8755d
authorJeff Law <law@redhat.com>
Sat, 29 Sep 2018 16:06:09 +0000 (29 10:06 -0600)
committerJeff Law <law@gcc.gnu.org>
Sat, 29 Sep 2018 16:06:09 +0000 (29 10:06 -0600)
tree797b7466a6780a7072c673f67d18031bf368e779
parent23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2
builtins.c (unterminated_array): Pass in c_strlen_data * to c_strlen rather than just a tree *.

* builtins.c (unterminated_array): Pass in c_strlen_data * to
c_strlen rather than just a tree *.
(c_strlen): Change NONSTR argument to a c_strlen_data pointer.
Update recursive calls appropriately.  If caller did not provide a
suitable data pointer, create a local one.  When a non-terminated
string is discovered, bubble up information about the string via the
c_strlen_data object.
* builtins.h (c_strlen): Update prototype.
(c_strlen_data): New structure.
* gimple-fold.c (get_range_strlen): Update calls to c_strlen.
For a type 2 call, if c_strlen indicates a non-terminated string
use the length of the non-terminated string.
(gimple_fold_builtin_stpcpy): Update calls to c_strlen.

From-SVN: r264712
gcc/ChangeLog
gcc/builtins.c
gcc/builtins.h
gcc/gimple-fold.c