This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] Delete use of MEMBER_TYPE_FORCES_BLK on HP PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: ebotcazou at adacore dot com (Eric Botcazou)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Jul 2005 12:14:54 -0400 (EDT)
- Subject: 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)