* function.c (assign_parm_setup_block): Handle parallels correctly.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 28 Oct 2004 12:29:36 +0000 (12:29 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 28 Oct 2004 12:29:36 +0000 (12:29 +0000)
From-SVN: r89750

gcc/ChangeLog
gcc/function.c

index c770da3417010fd706695f9eb16eddbd72f4edf1..4eb71fbc1496abd0d166a85c5088e4717b5a2226 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-28  Aldy Hernandez  <aldyh@redhat.com>
+
+       * function.c (assign_parm_setup_block): Handle parallels correctly.
+
 2004-10-28  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * final.c (shorten_branches): Initialize flags structure.
index d6fe2f5f4afdfc07e925fa77da60d7583f179a45..82776e7cd7a3491990f2ea4d355164442f1480d4 100644 (file)
@@ -2550,8 +2550,28 @@ assign_parm_setup_block (tree parm, struct assign_parm_data_one *data)
     {
       rtx parmreg = gen_reg_rtx (data->nominal_mode);
 
-      emit_group_store (parmreg, entry_parm, data->nominal_type,
-                       int_size_in_bytes (data->nominal_type));
+      /* For values returned in multiple registers, handle possible
+        incompatible calls to emit_group_store.
+
+        For example, the following would be invalid, and would have to
+        be fixed by the conditional below:
+
+          emit_group_store ((reg:SF), (parallel:DF))
+          emit_group_store ((reg:SI), (parallel:DI))
+
+        An example of this are doubles in e500 v2:
+          (parallel:DF (expr_list (reg:SI) (const_int 0))
+                       (expr_list (reg:SI) (const_int 4))).  */
+      if (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;
     }