public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* MEMBER_TYPE_FORCES_BLK on IA-64/HP-UX
@ 2005-06-08 10:27 Eric Botcazou
  2005-07-01 22:45 ` James E Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Botcazou @ 2005-06-08 10:27 UTC (permalink / raw)
  To: gcc

Hi,

The HP-UX port on the IA-64 architecture defines the MEMBER_TYPE_FORCES_BLK 
macro with this comment:

/* This needs to be set to force structure arguments with a single
   integer field to be treated as structures and not as the type of
   their field.  Without this a structure with a single char will be
   returned just like a char variable, instead of being returned at the
   top of the register as specified for big-endian IA64.  */

#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \
  (!FLOAT_MODE_P (MODE) || (MODE) == TFmode)

That's problematic for Ada because record types with BLKmode are far less easy 
to manipulate (in particular to pack in containing records) than record types 
with integer modes.

It seems to me that it's an implementation bias that can be eliminated.  
Firstly, SPARC64 has the same set of constraints and doesn't define 
MEMBER_TYPE_FORCES_BLK.  Secondly, ia64_function_value reads:

  else
    {
      if (BYTES_BIG_ENDIAN
	  && (mode == BLKmode || (valtype && AGGREGATE_TYPE_P ('))))
	{
	  rtx loc[8];
	  int offset;
	  int bytesize;
	  int i;

	  offset = 0;
	  bytesize = int_size_in_bytes (valtype);
	  for (i = 0; offset < bytesize; i++)
	    {
	      loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
					  gen_rtx_REG (DImode,
						       GR_RET_FIRST + i),
					  GEN_INT (offset));
	      offset += UNITS_PER_WORD;
	    }
	  return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
	}
      else
	return gen_rtx_REG (mode, GR_RET_FIRST);
    }

Note that we already test the type 'valtype'.  Moreover, int_size_in_bytes is 
invoked unconditionally on 'valtype' and would segfault if it was 0, so 
valtype is set every time mode == BLKmode.  So I think having a non-BLKmode 
on records with a single integer field would not change anything as far as 
the return value is concerned.

What do you think?  Thanks in advance.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-06  1:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-08 10:27 MEMBER_TYPE_FORCES_BLK on IA-64/HP-UX Eric Botcazou
2005-07-01 22:45 ` James E Wilson
2005-07-02 10:04   ` Eric Botcazou
2005-07-03 16:13   ` Steve Ellcey
2005-07-03 16:32     ` Eric Botcazou
2005-07-06  1:09     ` James E Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).