This is the mail archive of the 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: [PATCH] Fix one-sized FP arrays returning on MIPS

> Try this.

Thanks, works fine on the testcase.

> I'll regression-test it myself soon.

Wait :-)  I just discovered while playing with your patch that it is not 
sufficient for all types of arrays, namely arrays of Long_Float.  These are 
given DFmode and... they are returned in $f0 (i.e. no ICE)!

The problem lies in mips_function_value:

      /* If a value is passed in the most significant part of a register, see
	 whether we have to round the mode up to a whole number of words.  */
      if (mips_return_in_msb (valtype))
	  HOST_WIDE_INT size = int_size_in_bytes (valtype);
	  if (size % UNITS_PER_WORD != 0)
	      size += UNITS_PER_WORD - size % UNITS_PER_WORD;
	      mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);

Since the size of the mode is that of a word, it is left untouched and is 
subsequently caught by the normal FP handling code.

I presume you want to return them in $2 too?  In which case moving the 
'mode =  mode_for_size...' line out of the block should be sufficient.

Sorry for not seeing that earlier.

Eric Botcazou

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