aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-12-29 08:38:19 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-12-29 08:38:19 +0000
commitf523247a949634754be7caa14bd4a76c427275e2 (patch)
tree4e4051d650c1ead12806be638f2bb43a26f6eb04 /gcc/function.c
parentfb8b656c65ec5df2bf16a8eb636577e8be619244 (diff)
downloadgcc-f523247a949634754be7caa14bd4a76c427275e2.zip
gcc-f523247a949634754be7caa14bd4a76c427275e2.tar.gz
gcc-f523247a949634754be7caa14bd4a76c427275e2.tar.bz2
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
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 0dabd91..278c432 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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. */