[PATCH] Fix one-sized FP arrays returning on MIPS
Richard Sandiford
rsandifo@redhat.com
Wed Jun 23 17:05:00 GMT 2004
Richard Sandiford <rsandifo@redhat.com> writes:
> Eric Botcazou <ebotcazou@act-europe.fr> writes:
>> The only solution I see is something along the lines of
>> copy_blkmode_from_reg but this seems to be overkill
>
> I don't follow. I assumed we were just missing a subreg somewhere.
Try this. I'll regression-test it myself soon.
Richard
* calls.c (shift_returned_value): Fix handling of non-integer
TYPE_MODEs.
Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.315.2.5
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.315.2.5 calls.c
*** calls.c 15 Mar 2004 23:22:42 -0000 1.315.2.5
--- calls.c 23 Jun 2004 11:49:36 -0000
*************** shift_returned_value (tree type, rtx *va
*** 2043,2051 ****
- BITS_PER_UNIT * int_size_in_bytes (type));
if (shift > 0)
{
*value = expand_binop (GET_MODE (*value), lshr_optab, *value,
GEN_INT (shift), 0, 1, OPTAB_WIDEN);
! *value = convert_to_mode (TYPE_MODE (type), *value, 0);
return true;
}
}
--- 2043,2059 ----
- BITS_PER_UNIT * int_size_in_bytes (type));
if (shift > 0)
{
+ /* Shift the value into the low part of the register. */
*value = expand_binop (GET_MODE (*value), lshr_optab, *value,
GEN_INT (shift), 0, 1, OPTAB_WIDEN);
!
! /* Truncate it to the type's mode, or its integer equivalent.
! This is subject to TRULY_NOOP_TRUNCATION. */
! *value = convert_to_mode (int_mode_for_mode (TYPE_MODE (type)),
! *value, 0);
!
! /* Now convert it to the final form. */
! *value = gen_lowpart (TYPE_MODE (type), *value);
return true;
}
}
More information about the Gcc-patches
mailing list