summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 842db122d77..bf2a5fb61d5 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -850,12 +850,12 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
{
if (!tree_fits_uhwi_p (last.len)
|| integer_zerop (len)
- || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
- != (unsigned HOST_WIDE_INT) tree_low_cst (last.len, 1) + 1)
+ || (unsigned HOST_WIDE_INT) tree_to_uhwi (len)
+ != (unsigned HOST_WIDE_INT) tree_to_uhwi (last.len) + 1)
return;
/* Don't adjust the length if it is divisible by 4, it is more efficient
to store the extra '\0' in that case. */
- if ((((unsigned HOST_WIDE_INT) tree_low_cst (len, 1)) & 3) == 0)
+ if ((((unsigned HOST_WIDE_INT) tree_to_uhwi (len)) & 3) == 0)
return;
}
else if (TREE_CODE (len) == SSA_NAME)
@@ -1337,7 +1337,7 @@ handle_builtin_memcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
/* Handle memcpy (x, "abcd", 5) or
memcpy (x, "abc\0uvw", 7). */
if (!tree_fits_uhwi_p (len)
- || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
+ || (unsigned HOST_WIDE_INT) tree_to_uhwi (len)
<= (unsigned HOST_WIDE_INT) ~idx)
return;
}
@@ -1627,10 +1627,10 @@ handle_pointer_plus (gimple_stmt_iterator *gsi)
{
tree off = gimple_assign_rhs2 (stmt);
if (tree_fits_uhwi_p (off)
- && (unsigned HOST_WIDE_INT) tree_low_cst (off, 1)
+ && (unsigned HOST_WIDE_INT) tree_to_uhwi (off)
<= (unsigned HOST_WIDE_INT) ~idx)
ssa_ver_to_stridx[SSA_NAME_VERSION (lhs)]
- = ~(~idx - (int) tree_low_cst (off, 1));
+ = ~(~idx - (int) tree_to_uhwi (off));
return;
}