* config/alpha/alpha.c (alpha_va_arg): Read MUST_PASS_IN_STACK
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 09:07:10 +0000 (09:07 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Mar 2002 09:07:10 +0000 (09:07 +0000)
        types from the normal argument frame.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51380 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 89dc4be..15820db 100644 (file)
@@ -1,5 +1,11 @@
 2002-03-26  Richard Henderson  <rth@redhat.com>
 
+       * expr.h (ADD_PARM_SIZE): Cast INC to ssizetype.
+       (SUB_PARM_SIZE): Cast DEC to ssizetype.
+
+       * config/alpha/alpha.c (alpha_va_arg): Read MUST_PASS_IN_STACK
+       types from the normal argument frame.
+
        * config/sparc/sparc.c (function_arg_pass_by_reference): Pass
        variable sized objects by reference.
        (sparc_va_arg): Receive them by reference too.
index 08f4568..6033479 100644 (file)
@@ -5812,6 +5812,17 @@ alpha_va_arg (valist, type)
   offset_field = build (COMPONENT_REF, TREE_TYPE (offset_field),
                        valist, offset_field);
 
+  /* If the type could not be passed in registers, skip the block
+     reserved for the registers.  */
+  if (MUST_PASS_IN_STACK (TYPE_MODE (type), type))
+    {
+      t = build (MODIFY_EXPR, TREE_TYPE (offset_field), offset_field,
+                build (MAX_EXPR, TREE_TYPE (offset_field), 
+                       offset_field, build_int_2 (6*8, 0)));
+      TREE_SIDE_EFFECTS (t) = 1;
+      expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+    }
+
   wide_type = make_signed_type (64);
   wide_ofs = save_expr (build1 (CONVERT_EXPR, wide_type, offset_field));