From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 1104A3857C48 for ; Wed, 2 Sep 2020 10:13:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1104A3857C48 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 082ADD9X018325; Wed, 2 Sep 2020 05:13:13 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 082ADCWc018324; Wed, 2 Sep 2020 05:13:12 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 2 Sep 2020 05:13:12 -0500 From: Segher Boessenkool To: will schmidt Cc: gcc-patches@gcc.gnu.org, David Edelsohn Subject: Re: [PATCH, rs6000] Fix Vector long long subtype (PR96139) Message-ID: <20200902101312.GT28786@gate.crashing.org> References: <15c6036f67ae9d5c516c9de8506bacc36f1af4f6.camel@vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15c6036f67ae9d5c516c9de8506bacc36f1af4f6.camel@vnet.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 02 Sep 2020 10:13:15 -0000 Hi Will, On Tue, Sep 01, 2020 at 09:00:20PM -0500, will schmidt wrote: > This corrects an issue with the powerpc vector long long subtypes. > As reported by SjMunroe in PR96139. When building some code with -Wall > and attempting to print an element of a "long long vector" with a long long > printf format string, we will report a error because the vector sub-type > was improperly defined as int. > > When defining a V2DI_type_node we use a TARGET_POWERPC64 ternary to > define the V2DI_type_node with "vector long" or "vector long long". > We also need to specify the proper sub-type when we define the type. > - V2DI_type_node = rs6000_vector_type (TARGET_POWERPC64 ? "__vector long" > - : "__vector long long", > - intDI_type_node, 2); > + V2DI_type_node > + = rs6000_vector_type (TARGET_POWERPC64 > + ? "__vector long" : "__vector long long", > + TARGET_POWERPC64 > + ? long_long_integer_type_node : intDI_type_node, > + 2); Can't you just use long_long_integer_type_node in all cases? Or, what else is intDI_type_node for 32 bit? > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr96139-a.c > @@ -0,0 +1,32 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -Wall -m32 " } */ (trailing space, here and elsewhere -- not that it matters of course) Segher