[PATCH] rs6000: Fix default alignment ABI break caused by MMA base support
Paul A. Clarke
pc@us.ibm.com
Mon Nov 9 15:17:32 GMT 2020
On Fri, Nov 06, 2020 at 04:18:00PM -0600, Peter Bergner via Gcc-patches 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.
[snip]
> diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
> index bbd8060e143..5a47aa14722 100644
> --- a/gcc/config/rs6000/rs6000.h
> +++ b/gcc/config/rs6000/rs6000.h
> @@ -776,8 +776,10 @@ extern unsigned rs6000_pointer_size;
> /* Allocation boundary (in *bits*) for the code of a function. */
> #define FUNCTION_BOUNDARY 32
>
> -/* No data type wants to be aligned rounder than this. */
> -#define BIGGEST_ALIGNMENT (TARGET_MMA ? 512 : 128)
> +/* No data type is required to be aligned rounder than this. Warning, if
> + BIGGEST_ALIGNMENT is changed, then this may be an ABI break. An example
> + of where this can break an ABI is in GLIBC's struct _Unwind_Exception. */
Instead of calling out something that is expected to be fixed, should you
instead call out that it will change the alignment of anything using
"__attribute__ ((__aligned__))"?
> +#define BIGGEST_ALIGNMENT 128
[snip]
PC
More information about the Gcc-patches
mailing list