function.c (assign_parm_setup_reg): Use function argument promotion rules.
authorPaul Brook <paul@codesourcery.com>
Wed, 1 Feb 2006 19:44:47 +0000 (19:44 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Wed, 1 Feb 2006 19:44:47 +0000 (19:44 +0000)
2006-02-01  Paul Brook  <paul@codesourcery.com>

* function.c (assign_parm_setup_reg): Use function argument promotion
rules.
* expr.c (expand_expr_real_1): Use function argument promotion rules
for PARM_DECLs.

From-SVN: r110477

gcc/ChangeLog
gcc/expr.c
gcc/function.c

index 4375b7b6a5bb20a56e412b3b20b4a762e1c38a75..d9ebf254136879a7a5405f964576946321d83062 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-01  Paul Brook  <paul@codesourcery.com>
+
+       * function.c (assign_parm_setup_reg): Use function argument promotion
+       rules.
+       * expr.c (expand_expr_real_1): Use function argument promotion rules
+       for PARM_DECLs.
+
 2006-02-01  Steve Ellcey  <sje@cup.hp.com>
 
        * gcc.c (process_command): Change j to 'unsigned int'.
index 362ab8b57564ebf61a1f44b53c1e3b4d1e8e264d..832cc52a42158d325a9da964a228c9fe2c8a64b9 100644 (file)
@@ -6774,7 +6774,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
          /* Get the signedness used for this variable.  Ensure we get the
             same mode we got when the variable was declared.  */
          pmode = promote_mode (type, DECL_MODE (exp), &unsignedp,
-                               (TREE_CODE (exp) == RESULT_DECL ? 1 : 0));
+                               (TREE_CODE (exp) == RESULT_DECL
+                                || TREE_CODE (exp) == PARM_DECL) ? 1 : 0);
          gcc_assert (GET_MODE (DECL_RTL (exp)) == pmode);
 
          temp = gen_lowpart_SUBREG (mode, DECL_RTL (exp));
index 9ff5ce69c97e4c23ae6843510caa2eb082560667..61ee42127ad2c69fbd20951925bf3e6ab45698cb 100644 (file)
@@ -2624,8 +2624,10 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
   /* Store the parm in a pseudoregister during the function, but we may
      need to do it in a wider mode.  */
 
+  /* This is not really promoting for a call.  However we need to be
+     consistent with assign_parm_find_data_types and expand_expr_real_1.  */
   promoted_nominal_mode
-    = promote_mode (data->nominal_type, data->nominal_mode, &unsignedp, 0);
+    = promote_mode (data->nominal_type, data->nominal_mode, &unsignedp, 1);
 
   parmreg = gen_reg_rtx (promoted_nominal_mode);