[committed] Delete use of MEMBER_TYPE_FORCES_BLK on HP PA

Eric Botcazou ebotcazou@adacore.com
Wed Jul 6 14:59:00 GMT 2005


> Unfortunately, we are stuck with forcing BLKmode for aggregates that would
> otherwise have been given integral or float modes on HP PA.  It's
> explicitly mandated by HP in their 64-bit runtime.  In the 32-bit runtime,
> it's not explicited stated in the runtime documentation but it's necessary
> for compatibility with HP compilers.

I'm not sure I understand: what mode is supposed to be given to

struct {
  int i;
};

on HP-PA/HP-UX 32-bit?  My debugger shows SImode.

> There are a number of issues regarding the passing of small
> aggregates on HP PA:
>
> 1) They are always passed in the general registers.  This impacts
>    the passing and return of aggregates with a single float field
>    as the value would have otherwise been passed/returned in a
>    general register.
>
> 2) HP specifies that small aggregates be passed in the 32-bit runtime
>    right justified.  This is opposite to that normally specified for
>    a big endian target.  Thus, an aggregate with a single char field
>    ends up being passed in the same position as a char in the argument
>    register or stack slot.  However, the padding is undefined.  For
>    many years, there wasn't a method to achieve right justification
>    for 5-7 byte structs as padding only worked for structs smaller or
>    the same size as the word size.
>
> 3) The 64-bit runtime left justifies structs and aggregates, and always
>    passes them by value.  Thus, an aggregate with a single char field
>    is passed in a different location in the argument register/stack
>    slot than it would as a character.

You seem to imply that calling conventions and machine modes are necessarily 
tied.  I think the best practice is to uncouple them in the back-end.

> I doubt it matters to Ada whether BLKmode is forced for aggregates
> via MEMBER_TYPE_FORCES_BLK or internally with function_value/function_arg.

On the contrary, Ada doesn't really care about the calling conventions, but it 
does care about modes given to record types by the layout engine, and 
MEMBER_TYPE_FORCES_BLK may badly interact, like on IA-64/HP-UX.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list