diff options
author | Martin Sebor <msebor@redhat.com> | 2019-01-02 06:02:37 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2019-01-01 23:02:37 -0700 |
commit | 5d6655ebcc96030644f99eb1c431dd96e374db90 (patch) | |
tree | 254a28a425e845f22414200219cf3f13aec1f0a6 /gcc/gimple-fold.h | |
parent | 79b1c2295b3031764904ce66ae294aa57aef50ae (diff) | |
download | gcc-5d6655ebcc96030644f99eb1c431dd96e374db90.zip gcc-5d6655ebcc96030644f99eb1c431dd96e374db90.tar.gz gcc-5d6655ebcc96030644f99eb1c431dd96e374db90.tar.bz2 |
gimple-fold.h (get_range_strlen): Update prototype.
* gimple-fold.h (get_range_strlen): Update prototype.
* builtins.c (check_access): Update call to get_range_strlen to use
c_strlen_data pointer. Change various variable accesses to instead
pull data from the c_strlen_data structure.
(check_strncat_sizes, expand_builtin_strncat): Likewise.
* calls.c (maybe_warn_nonstring_arg): Likewise.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Likewise. Reset
minimum length if maximum lengh is unknown.
* gimple-ssa-sprintf.c (get_string_length): Likewise. Drop code
that used c_strlen, it's no longer needed. Restructure slightly.
(format_string): Set unlikely range appropriately.
* gimple-fold.c (get_range_strlen): Update comments. Fix minor
formatting issues.
(get_range_strlen): Accept c_strlen_data pointer for external
call sites as well. Pass through to call to internal get_range_strlen.
Adjust minlen, maxlen and maxbound as needed.
(get_maxval_strlen): Update comments.
(gimple_fold_builtin_strlen): Update call to get_range_strlen
to use c_strlen_data pointer. Change variable accesses to instead
use c_strlen_data data members.
* gcc.dg/strlenopt-40.c: Disable a couple tests.
* gcc.dg/strlenopt-48.c: Twiddle test.
* gcc.dg/strlenopt-59.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-5.c: New test.
* g++.dg/init/strlen.C: New test.
Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r267503
Diffstat (limited to 'gcc/gimple-fold.h')
-rw-r--r-- | gcc/gimple-fold.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h index 76a6581..35f1ba26 100644 --- a/gcc/gimple-fold.h +++ b/gcc/gimple-fold.h @@ -25,8 +25,8 @@ along with GCC; see the file COPYING3. If not see extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL); extern tree canonicalize_constructor_val (tree, tree); extern tree get_symbol_constant_value (tree); -extern bool get_range_strlen (tree, tree[2], unsigned = 1, - bool = false, tree * = NULL); +struct c_strlen_data; +extern bool get_range_strlen (tree, c_strlen_data *, unsigned eltsize, bool = false); extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree); extern bool fold_stmt (gimple_stmt_iterator *); extern bool fold_stmt (gimple_stmt_iterator *, tree (*) (tree)); |