]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Fix default alignment ABI break caused by MMA base support
authorPeter Bergner <bergner@linux.ibm.com>
Fri, 6 Nov 2020 23:00:49 +0000 (17:00 -0600)
committerPeter Bergner <bergner@linux.ibm.com>
Thu, 12 Nov 2020 16:48:21 +0000 (10:48 -0600)
commitaec057c07ac6ea988a587b77a099c69ff3637520
treeff0ba71b9b4f2c5c49e0606e7bd14c5b4b810d1e
parent5eebaff9f992814a2f8f915e436716b1b2c983df
rs6000: Fix default alignment ABI break caused by MMA base support

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
bytes 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.
The fix is to revert the BIGGEST_ALIGNMENT change and to force the
alignment on the type itself rather than the mode used by the type.

2020-11-06  Peter Bergner  <bergner@linux.ibm.com>

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.

(cherry picked from commit a37b5bcf15a682f22ac10d8b7069aa8d115caaef)
gcc/config/rs6000/rs6000-call.c
gcc/config/rs6000/rs6000.h
gcc/testsuite/gcc.target/powerpc/mma-alignment.c [new file with mode: 0644]