public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: will schmidt <will_schmidt@vnet.ibm.com>
Cc: gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH, rs6000] Fix Vector long long subtype (PR96139)
Date: Wed, 2 Sep 2020 05:13:12 -0500	[thread overview]
Message-ID: <20200902101312.GT28786@gate.crashing.org> (raw)
In-Reply-To: <15c6036f67ae9d5c516c9de8506bacc36f1af4f6.camel@vnet.ibm.com>

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

  reply	other threads:[~2020-09-02 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02  2:00 will schmidt
2020-09-02 10:13 ` Segher Boessenkool [this message]
2020-09-03 15:37   ` will schmidt
2020-09-03 18:09     ` Segher Boessenkool
2020-09-04  6:55       ` Richard Biener
2020-09-04  8:47         ` Segher Boessenkool
2020-09-04 14:47           ` will schmidt

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=20200902101312.GT28786@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=will_schmidt@vnet.ibm.com \
    /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).