builtins.c (std_expand_builtin_va_start): Take PARM_BOUNDARY into account.
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 11 Nov 2000 06:04:59 +0000 (06:04 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sat, 11 Nov 2000 06:04:59 +0000 (06:04 +0000)
* builtins.c (std_expand_builtin_va_start): Take PARM_BOUNDARY
into account.

From-SVN: r37381

gcc/ChangeLog
gcc/builtins.c

index 0b2e121efded4b50803612aac869be76831f3e52..d1db1dc3bd6c5e3fa9b7e654e42957493c5545f5 100644 (file)
@@ -1,5 +1,8 @@
 2000-11-11  Alexandre Oliva  <aoliva@redhat.com>
 
+       * builtins.c (std_expand_builtin_va_start): Take PARM_BOUNDARY
+       into account.
+
        * config/sh/sh.h (MODES_TIEABLE_P): Don't tie SFmode to other FP
        modes.
 
index 8430a23f82eeb0891daa152e5b4682ea60d48738..68a0e41a22fee7580a110dcf705f304abeb5a129 100644 (file)
@@ -2250,14 +2250,18 @@ stabilize_va_list (valist, needs_lvalue)
    the variable.  */
 void
 std_expand_builtin_va_start (stdarg_p, valist, nextarg)
-     int stdarg_p ATTRIBUTE_UNUSED;
+     int stdarg_p;
      tree valist;
      rtx nextarg;
 {
   tree t;
 
-  if (!stdarg_p)
-    nextarg = plus_constant (nextarg, -UNITS_PER_WORD);
+  if (! stdarg_p)
+    {
+      int align = PARM_BOUNDARY / BITS_PER_UNIT;
+      int offset = (((UNITS_PER_WORD + align - 1) / align) * align);
+      nextarg = plus_constant (nextarg, -offset);
+    }
 
   t = build (MODIFY_EXPR, TREE_TYPE (valist), valist,
             make_tree (ptr_type_node, nextarg));