aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-06-29 18:27:08 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2022-06-29 18:27:08 +0200
commit98c18e040e2c65db93f1498bb421e83165da3738 (patch)
tree83f955f9ea1042cbd90383a8025c9ec42c08f867
parentb01c075e7e6d84da846c2ff9087433a30ebeb0d2 (diff)
downloadgcc-98c18e040e2c65db93f1498bb421e83165da3738.zip
gcc-98c18e040e2c65db93f1498bb421e83165da3738.tar.gz
gcc-98c18e040e2c65db93f1498bb421e83165da3738.tar.bz2
d: Fix build on aarch64-suse-linux
The variables being used to get the result out of TYPE_VECTOR_SUBPARTS were being flagged by -Werror=maybe-uninitialized. As they have already been checked for being constant earlier, use `to_constant' instead. gcc/d/ChangeLog: * intrinsics.cc (build_shuffle_mask_type): Use to_constant when getting the number of subparts from a vector type. (expand_intrinsic_vec_shufflevector): Likewise.
-rw-r--r--gcc/d/intrinsics.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/d/intrinsics.cc b/gcc/d/intrinsics.cc
index 454d940..75d4318 100644
--- a/gcc/d/intrinsics.cc
+++ b/gcc/d/intrinsics.cc
@@ -273,8 +273,7 @@ build_shuffle_mask_type (tree type)
printed (this should really be handled by a D tree printer). */
Type *t = build_frontend_type (inner);
gcc_assert (t != NULL);
- unsigned HOST_WIDE_INT nunits;
- TYPE_VECTOR_SUBPARTS (type).is_constant (&nunits);
+ unsigned HOST_WIDE_INT nunits = TYPE_VECTOR_SUBPARTS (type).to_constant ();
return build_ctype (TypeVector::create (t->sarrayOf (nunits)));
}
@@ -1190,9 +1189,10 @@ expand_intrinsic_vec_shufflevector (tree callexp)
tree vec0 = CALL_EXPR_ARG (callexp, 0);
tree vec1 = CALL_EXPR_ARG (callexp, 1);
- unsigned HOST_WIDE_INT v0elems, v1elems;
- TYPE_VECTOR_SUBPARTS (TREE_TYPE (vec0)).is_constant (&v0elems);
- TYPE_VECTOR_SUBPARTS (TREE_TYPE (vec1)).is_constant (&v1elems);
+ unsigned HOST_WIDE_INT v0elems =
+ TYPE_VECTOR_SUBPARTS (TREE_TYPE (vec0)).to_constant ();
+ unsigned HOST_WIDE_INT v1elems =
+ TYPE_VECTOR_SUBPARTS (TREE_TYPE (vec1)).to_constant ();
unsigned HOST_WIDE_INT num_indices = call_expr_nargs (callexp) - 2;
unsigned HOST_WIDE_INT masklen = MAX (num_indices, MAX (v0elems, v1elems));