public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1347] d: Fix build on aarch64-suse-linux
Date: Wed, 29 Jun 2022 16:33:14 +0000 (GMT)	[thread overview]
Message-ID: <20220629163314.83160384D19A@sourceware.org> (raw)

https://gcc.gnu.org/g:98c18e040e2c65db93f1498bb421e83165da3738

commit r13-1347-g98c18e040e2c65db93f1498bb421e83165da3738
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Jun 29 18:27:08 2022 +0200

    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.

Diff:
---
 gcc/d/intrinsics.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/d/intrinsics.cc b/gcc/d/intrinsics.cc
index 454d940d1b5..75d43186909 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));


                 reply	other threads:[~2022-06-29 16:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220629163314.83160384D19A@sourceware.org \
    --to=ibuclaw@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).