aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
committerIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
commitaa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch)
tree886212591b1c9d127eaaf234a4a2e22452ea384a /gcc/fold-const.cc
parent97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff)
parent3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff)
downloadgcc-devel/gccgo.zip
gcc-devel/gccgo.tar.gz
gcc-devel/gccgo.tar.bz2
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'gcc/fold-const.cc')
-rw-r--r--gcc/fold-const.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index 3aa6851..ac90a59 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -12564,10 +12564,10 @@ fold_binary_loc (location_t loc, enum tree_code code, tree type,
tree targ1 = strip_float_extensions (arg1);
tree newtype = TREE_TYPE (targ0);
- if (TYPE_PRECISION (TREE_TYPE (targ1)) > TYPE_PRECISION (newtype))
+ if (element_precision (TREE_TYPE (targ1)) > element_precision (newtype))
newtype = TREE_TYPE (targ1);
- if (TYPE_PRECISION (newtype) < TYPE_PRECISION (TREE_TYPE (arg0)))
+ if (element_precision (newtype) < element_precision (TREE_TYPE (arg0)))
return fold_build2_loc (loc, code, type,
fold_convert_loc (loc, newtype, targ0),
fold_convert_loc (loc, newtype, targ1));
@@ -14530,7 +14530,8 @@ tree_expr_maybe_real_minus_zero_p (const_tree x)
static bool
tree_simple_nonnegative_warnv_p (enum tree_code code, tree type)
{
- if ((TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type))
+ if (!VECTOR_TYPE_P (type)
+ && (TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type))
&& truth_value_p (code))
/* Truth values evaluate to 0 or 1, which is nonnegative unless we
have a signed:1 type (where the value is -1 and 0). */