This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed] Delete use of MEMBER_TYPE_FORCES_BLK on HP PA


> 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.

The mode as passed to function_arg is SImode, but function_arg
treats it as BLKmode.  There's no difference in argument location,
justification in this case.  However, the following case shows
the difference.

struct {
  float f;
};

This aggregate would be passed in a general register while a
SFmode value would be passed in a floating point register.  If
your debugger treats it as SFmode, it may look in the wrong place
for the object.

In hppa64,

struct {
  char c;
};

and char are passed/returned differently.

> > 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.

That's effectively what I did by eliminating the use of MEMBER_TYPE_FORCES_BLK
in the PA backend.  However, I'm not sure the language layer can completely
divorce itself from the calling conventions as they impact promotion, etc.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]