diff options
Diffstat (limited to 'gcc/fold-const-call.c')
-rw-r--r-- | gcc/fold-const-call.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/fold-const-call.c b/gcc/fold-const-call.c index 71f0b52..98ac091 100644 --- a/gcc/fold-const-call.c +++ b/gcc/fold-const-call.c @@ -60,7 +60,8 @@ host_size_t_cst_p (tree t, size_t *size_out) { if (types_compatible_p (size_type_node, TREE_TYPE (t)) && integer_cst_p (t) - && wi::min_precision (t, UNSIGNED) <= sizeof (size_t) * CHAR_BIT) + && (wi::min_precision (wi::to_wide (t), UNSIGNED) + <= sizeof (size_t) * CHAR_BIT)) { *size_out = tree_to_uhwi (t); return true; @@ -1041,8 +1042,8 @@ fold_const_call_1 (combined_fn fn, tree type, tree arg) if (SCALAR_INT_MODE_P (mode)) { wide_int result; - if (fold_const_call_ss (&result, fn, arg, TYPE_PRECISION (type), - TREE_TYPE (arg))) + if (fold_const_call_ss (&result, fn, wi::to_wide (arg), + TYPE_PRECISION (type), TREE_TYPE (arg))) return wide_int_to_tree (type, result); } return NULL_TREE; @@ -1322,7 +1323,8 @@ fold_const_call_1 (combined_fn fn, tree type, tree arg0, tree arg1) /* real, int -> real. */ REAL_VALUE_TYPE result; if (fold_const_call_sss (&result, fn, TREE_REAL_CST_PTR (arg0), - arg1, REAL_MODE_FORMAT (mode))) + wi::to_wide (arg1), + REAL_MODE_FORMAT (mode))) return build_real (type, result); } return NULL_TREE; @@ -1336,7 +1338,7 @@ fold_const_call_1 (combined_fn fn, tree type, tree arg0, tree arg1) { /* int, real -> real. */ REAL_VALUE_TYPE result; - if (fold_const_call_sss (&result, fn, arg0, + if (fold_const_call_sss (&result, fn, wi::to_wide (arg0), TREE_REAL_CST_PTR (arg1), REAL_MODE_FORMAT (mode))) return build_real (type, result); |