This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Annoying silly warning emitted by gcc?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Warren D Smith <warren dot wds at gmail dot com>
- Cc: Joe Buck <joe dot buck at synopsys dot com>, Andrew Pinski <pinskia at gmail dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 24 Jan 2019 06:56:01 +0100
- Subject: Re: Annoying silly warning emitted by gcc?
- References: <CAAJP7Y1Dc0DWBO7UsTcYxjsofx9a8zQOtKFc=UhvY2Ck5h3GmA@mail.gmail.com> <CA+=Sn1mSjOW7TpJ1UpcQj+DxdqcFA19-0iCefWOa3QcA7gwLBQ@mail.gmail.com> <CCD865889A560649BA947E1B934A8D7D023F73536A@US01WEMBX2.internal.synopsys.com> <CAAJP7Y2CoWcxuh1T5q7n=zsNH=S_3u14qoAELiPoV-yZjWV0Wg@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jan 23, 2019 at 09:05:15PM -0500, Warren D Smith wrote:
> The x=x "initialization" idea by paulkoning@comcast.net
> failed to turn off the warning for me.
>
> Joe Buck may be right that gcc "already does the right thing"
> but actually I was dealing with not a 64-bit wide, but
> actually a 128-bit-wide type, which might
> later become 256-wide or even 512; and to load it with 0s actually needs a lot
> of loading of constants from the instruction stream.
Do you mean vectors or aggregates or something else?
GCC doesn't support integral scalar types with 256 or higher bit precision.
And we vectors gcc does use xor internally too:
typedef int V __attribute__((vector_size (64)));
struct S { __int128_t x, y; };
V
foo (void)
{
return (V) {};
}
struct S
bar (void)
{
return (struct S) {};
}
emits
vpxor %xmm0, %xmm0, %xmm0
with -O2 -mavx512f in foo and
vpxor %xmm0, %xmm0, %xmm0
movq %rdi, %rax
vmovaps %xmm0, (%rdi)
vmovaps %xmm0, 16(%rdi)
in bar.
As has been said, the recommendation by Intel is for compiler developers and
assembly writers.
Jakub