diff options
author | Jeff Law <law@redhat.com> | 2018-09-29 10:06:09 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-09-29 10:06:09 -0600 |
commit | 7d583f4259a56c9054c28e883c375f9c57f8755d (patch) | |
tree | 797b7466a6780a7072c673f67d18031bf368e779 /gcc/builtins.h | |
parent | 23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2 (diff) | |
download | gcc-7d583f4259a56c9054c28e883c375f9c57f8755d.zip gcc-7d583f4259a56c9054c28e883c375f9c57f8755d.tar.gz gcc-7d583f4259a56c9054c28e883c375f9c57f8755d.tar.bz2 |
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
Diffstat (limited to 'gcc/builtins.h')
-rw-r--r-- | gcc/builtins.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/builtins.h b/gcc/builtins.h index 45ad684..3801251 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -57,7 +57,14 @@ extern bool get_pointer_alignment_1 (tree, unsigned int *, unsigned HOST_WIDE_INT *); extern unsigned int get_pointer_alignment (tree); extern unsigned string_length (const void*, unsigned, unsigned); -extern tree c_strlen (tree, int, tree * = NULL, unsigned = 1); +struct c_strlen_data +{ + tree decl; + tree len; + tree off; +}; + +extern tree c_strlen (tree, int, c_strlen_data * = NULL, unsigned = 1); extern void expand_builtin_setjmp_setup (rtx, rtx); extern void expand_builtin_setjmp_receiver (rtx); extern void expand_builtin_update_setjmp_buf (rtx); |