From patchwork Wed Jun 29 16:35:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 55537 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D79CA384D14F for ; Wed, 29 Jun 2022 16:36:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D79CA384D14F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656520572; bh=SVXW+IXhYtrA9C+eMFQhRIiyOqpeyRkh8vAGBDx+xHk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=WGnpepf4f+brYIbV4xySTNskts+70lTr6PYf2OoNu++3tzC/WGwXCb7Fyh2oIkBiL dOB6vzM4iKJMDAl2EMo4rVlneTMrxZUzPjfeixpyncWBN5JF1o42s7l+1uyXcS3Tl5 PL+B9zTnOlao0pbC/V/sLuBUPJCQfpIh9ZYexxYQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by sourceware.org (Postfix) with ESMTPS id 384D5384D19A for ; Wed, 29 Jun 2022 16:35:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 384D5384D19A Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4LY6XD09rVz9sqh; Wed, 29 Jun 2022 18:35:40 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Fix build on aarch64-suse-linux Date: Wed, 29 Jun 2022 18:35:33 +0200 Message-Id: <20220629163533.1461114-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Cc: schwab@suse.de Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, 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. This patch is based on feedback from Andreas. Given the error they got, this seems obvious. Have only regstrapped on x86_64-linux-gnu though. Regards, Iain. --- 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. --- 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));