Question about alignment of struct _Unwind_Exception

Peter Bergner bergner@linux.ibm.com
Wed Nov 4 19:25:05 GMT 2020


On 11/4/20 6:44 AM, Matheus Castanho wrote:
> That struct is declared without a fixed alignment value:
> 
> struct _Unwind_Exception
> {
>   _Unwind_Exception_Class exception_class;
>   _Unwind_Exception_Cleanup_Fn exception_cleanup;
>   _Unwind_Word private_1;
>   _Unwind_Word private_2;
>   /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
>      Taking that literally does not make much sense generically.  Instead we
>      provide the maximum alignment required by any type for the machine.  */
> } __attribute__((__aligned__));
> 
> The GCC manual says [2]:
> 
>> Specifying no alignment argument implies the maximum alignment for the
> target
> 
> The maximum alignment has been recently increased for P10, which we
> suspect is causing the behavior we see.

FYI, I am looking at backing out the GCC BIGGEST_ALIGNMENT change.
I had done that as a way to increase the alignment of the MMA types,
which we want more aligned than 128 (the current BIGGEST_ALIGNMENT
value) for performance reasons.  Clearly, changing BIGGEST_ALIGNMENT
is the wrong way to do that given the problems you're encountering.
If I can align the MMA types a different way, then the default
alignment will go back to 128 bits, which should "fix" the issue
you are seeing.

That said, who's to say that a valid reason to increase BIGGEST_ALIGNMENT
won't come along and break this for real, so it seems adding a specific
alignment value in the code above rather than relying on the default
seems like a good idea to me.

Peter




More information about the Libc-alpha mailing list