Index: function.c
===================================================================
--- function.c	(revision 162277)
+++ function.c	(working copy)
@@ -2940,18 +2940,18 @@ assign_parm_setup_reg (struct assign_par
 	 First, we try to emit an insn which performs the necessary
 	 conversion.  We verify that this insn does not clobber any
 	 hard registers.  */
-
+      enum machine_mode entry_mode = data->nominal_mode;
       enum insn_code icode;
       rtx op0, op1;
 
-      icode = can_extend_p (promoted_nominal_mode, data->passed_mode,
+      icode = can_extend_p (promoted_nominal_mode, entry_mode,
 			    unsignedp);
 
       op0 = parmreg;
       op1 = validated_mem;
       if (icode != CODE_FOR_nothing
 	  && insn_data[icode].operand[0].predicate (op0, promoted_nominal_mode)
-	  && insn_data[icode].operand[1].predicate (op1, data->passed_mode))
+	  && insn_data[icode].operand[1].predicate (op1, entry_mode))
 	{
 	  enum rtx_code code = unsignedp ? ZERO_EXTEND : SIGN_EXTEND;
 	  rtx insn, insns;
@@ -2959,7 +2959,7 @@ assign_parm_setup_reg (struct assign_par
 
 	  start_sequence ();
 	  insn = gen_extend_insn (op0, op1, promoted_nominal_mode,
-				  data->passed_mode, unsignedp);
+				  entry_mode, unsignedp);
 	  emit_insn (insn);
 	  insns = get_insns ();
 
