Hi! On Fri, Nov 06, 2020 at 04:18:00PM -0600, Peter Bergner wrote: > As part of the MMA base support, we incremented BIGGEST_ALIGNMENT in > order to align the __vector_pair and __vector_quad types to 256 and 512 > bits respectively. This had the unintended effect of changing the > default alignment used by __attribute__ ((__aligned__)) which causes > an ABI break because of some dodgy code in GLIBC's struct pthread > (GLIBC is going to fix that too). The fix in GCC is to revert the > BIGGEST_ALIGNMENT change and to force the alignment on the type itself > rather than the mode used by the type.
The ABI break is all GCC's faultt, but it is exposed by that glibc code, sure :-) > This passes bootstrap and regtesting on powerpc64le-linux with no regressions. > Ok for mainline and the GCC 10 release branch after some burn in? Yes, okay for both. Thanks! (See note below though.) > gcc/ > * config/rs6000/rs6000.h (BIGGEST_ALIGNMENT): Revert previous commit > so as not to break the ABI. > * config/rs6000/rs6000-call.c (rs6000_init_builtins): Set the ABI > mandated alignment for __vector_pair and __vector_quad types. > > gcc/testsuite/ > * gcc.target/powerpc/mma-alignment.c: New test. > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/mma-alignment.c > @@ -0,0 +1,41 @@ > +/* { dg-do run } */ > +/* { dg-require-effective-target hard_float } */ > +/* { dg-options "-O2 -mhard-float" } */ > + > +#include <stdlib.h> > + > +/* The MMA types below are enabled for pre-power10 compiles, because the > + built-ins that use them must always be initialized in case the user has > + a target attribute or pragma on a function that uses the MMA built-ins. > + Since the test below doesn't need any other MMA support, we can enable > + this test case on basically any cpu that has hard floating point > + registers. */ Good comment, thanks :-) That "basically" does not sound super convincing, but this is just a testcase, we can fix it later if need be. Segher