This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch: teach assign_parm* about float parallels
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Wed, 27 Oct 2004 16:00:24 -0400
- Subject: patch: teach assign_parm* about float parallels
Hi Richard.
*digs up old emails*
Imagine this function, keeping in mind SF -> DF promotion:
float geee;
void alloc_float(efff)
float efff;
{ geee = efff; }
assign_parms() tries to call emit_group_store with:
orig_dst ==> (reg:SF)
src ==> (parallel:DF ...)
You can only imagine the havoc this creates.
The patch below fixes assign_parm_setup_block to do the following
conversion:
(parallel:DF src) -> (reg:DF temp)
convert_mode (orig_dst, temp) // where orig_dst was an SF
In your original email, when I showed you this, you mentioned I
should do this without the SCALAR_INT_MODE_P check, but now I'm all
paranoid because of the recent breakage.
I've also added a check for BLKmode, for good measure, but I doubt
any one is passing BLKmode's in parallels for function arguments.
(Ada? Does Ada even have unnamed arguments?)
I don't think this affects anything else, as it only relates to non
integer (float) hard registers in parallels, not memory like the
emit_group_* patch.
Testing currently underway on ppc-linux.
OK?
* function.c (assign_parm_setup_block): Handle parallles of
floats.
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.584
diff -c -p -r1.584 function.c
*** function.c 19 Oct 2004 14:43:52 -0000 1.584
--- function.c 27 Oct 2004 19:43:01 -0000
*************** assign_parm_setup_block (tree parm, stru
*** 2550,2557 ****
{
rtx parmreg = gen_reg_rtx (data->nominal_mode);
! emit_group_store (parmreg, entry_parm, data->nominal_type,
! int_size_in_bytes (data->nominal_type));
SET_DECL_RTL (parm, parmreg);
return;
}
--- 2550,2569 ----
{
rtx parmreg = gen_reg_rtx (data->nominal_mode);
! /* Handle parallels of floats. In this case we can't get at the
! individual words. */
! if (!SCALAR_INT_MODE_P (GET_MODE (parmreg))
! && GET_MODE (parmreg) != BLKmode
! && data->nominal_mode != data->passed_mode)
! {
! rtx t = gen_reg_rtx (GET_MODE (entry_parm));
! emit_group_store (t, entry_parm, NULL_TREE,
! GET_MODE_SIZE (GET_MODE (entry_parm)));
! convert_move (parmreg, t, 0);
! }
! else
! emit_group_store (parmreg, entry_parm, data->nominal_type,
! int_size_in_bytes (data->nominal_type));
SET_DECL_RTL (parm, parmreg);
return;
}