function.c (assign_parms): Convert arguments passed by reference to the right mode.

* function.c (assign_parms): Convert arguments passed by
reference to the right mode.

From-SVN: r38528
This commit is contained in:
Alexandre Oliva 2000-12-29 08:38:19 +00:00 committed by Alexandre Oliva
parent fb8b656c65
commit f523247a94
2 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2000-12-29 Alexandre Oliva <aoliva@redhat.com>
* function.c (assign_parms): Convert arguments passed by
reference to the right mode.
2000-12-28 Geoffrey Keating <geoffk@redhat.com>
* c-parse.in (select_or_iter_stmt): Use truthvalue_conversion

View File

@ -4726,7 +4726,22 @@ assign_parms (fndecl)
Pmode above. We must use the actual mode of the parm. */
parmreg = gen_reg_rtx (TYPE_MODE (TREE_TYPE (parm)));
mark_user_reg (parmreg);
emit_move_insn (parmreg, DECL_RTL (parm));
if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
{
rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
push_to_sequence (conversion_insns);
emit_move_insn (tempreg, DECL_RTL (parm));
DECL_RTL (parm)
= convert_to_mode (GET_MODE (parmreg), tempreg,
TREE_UNSIGNED (TREE_TYPE (parm)));
emit_move_insn (parmreg, DECL_RTL (parm));
conversion_insns = get_insns();
did_conversion = 1;
end_sequence ();
}
else
emit_move_insn (parmreg, DECL_RTL (parm));
DECL_RTL (parm) = parmreg;
/* STACK_PARM is the pointer, not the parm, and PARMREG is
now the parm. */