diff options
Diffstat (limited to 'gcc/c-family/c-format.c')
-rw-r--r-- | gcc/c-family/c-format.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 99cae172a5b..d0c07e41354 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -1459,7 +1459,7 @@ check_format_arg (void *ctx, tree format_tree, res->number_non_literal++; return; } - if (!host_integerp (arg1, 0) + if (!tree_fits_shwi_p (arg1) || (offset = tree_low_cst (arg1, 0)) < 0) { res->number_non_literal++; @@ -1506,7 +1506,7 @@ check_format_arg (void *ctx, tree format_tree, return; } if (TREE_CODE (format_tree) == ARRAY_REF - && host_integerp (TREE_OPERAND (format_tree, 1), 0) + && tree_fits_shwi_p (TREE_OPERAND (format_tree, 1)) && (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0) format_tree = TREE_OPERAND (format_tree, 0); if (TREE_CODE (format_tree) == VAR_DECL @@ -1537,7 +1537,7 @@ check_format_arg (void *ctx, tree format_tree, /* Variable length arrays can't be initialized. */ gcc_assert (TREE_CODE (array_size) == INTEGER_CST); - if (host_integerp (array_size, 0)) + if (tree_fits_shwi_p (array_size)) { HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size); if (array_size_value > 0 |