r11-2663 causes static_assert failure

Jakub Jelinek jakub@redhat.com
Thu Aug 13 13:00:18 GMT 2020


On Thu, Aug 13, 2020 at 01:46:53PM +0100, Iain Sandoe wrote:
> Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> > On Thu, Aug 13, 2020 at 02:06:21PM +0200, Tobias Burnus wrote:
> > > Build server is x86_64-gnu-linux, "i686-pc-linux-gnu-g++" is a
> > > native binary of GCC 5.2.0
> > > [Don't ask why i686 and not x86_64 is used.]
> > 
> > Ah, ok, so this boils down to:
> > int i = alignof (long long int);
> > struct TTT { char a; long long int b; };
> > int j = alignof (TTT);
> > ending up to be 8, 4 with -O2 -m32 in GCC 4.8 - 7.x and
> > only in GCC 8+ 4, 4.
> 
> Also the case for long long (darwin) and double (darwin, aix) where the
> embedded alignmen
> is 4 and the natural aligment is 8 - as ABI (so in dependent of compiler
> version).
> (which breaks bootstrap on all 32b Darwin hosts at least)
> 
> If the desired outcome is that the embedded vector is aligned to the natural
> alignment
> of the type that could be forced on that field of the vec?

The desired outcome is to get the offsetof value even for
vec with non-standard-layout type payload, and so in that case build

	Jakub



More information about the Gcc-patches mailing list