*** empty log message ***
authorAlan Lehotsky <lehotsky@tiac.net>
Thu, 11 Jan 2001 23:01:40 +0000 (23:01 +0000)
committerAlan Lehotsky <alehotsky@gcc.gnu.org>
Thu, 11 Jan 2001 23:01:40 +0000 (18:01 -0500)
From-SVN: r38929

gcc/ChangeLog
gcc/builtins.c

index 0bb96469ddc34356a5551f984f670af5df1b1eb7..b1d8c07e1ab0de35e30440824f7ff6e053306cba 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-11  Alan Lehotsky  <lehotsky@tiac.net>
+
+       * builtins.c (std_expand_builtin_va_start): Handle varargs when
+       sizeof (int) is larger than sizeof(__word__).
+       
 2001-01-11  Neil Booth  <neil@daikokuya.demon.co.uk>
 
         * cppinit.c (do_includes): Fix typo.
index 1ad33f24826974b627fffd39ae37f68e98e207bd..b7db928d48c818ec800aeffaeb1015f11b948559 100644 (file)
@@ -2801,8 +2801,13 @@ std_expand_builtin_va_start (stdarg_p, valist, nextarg)
 
   if (! stdarg_p)
     {
+      /* The dummy named parameter is declared as a 'word' sized
+        object, but if a 'word' is smaller than an 'int', it would
+        have been promoted to int when it was added to the arglist.  */
       int align = PARM_BOUNDARY / BITS_PER_UNIT;
-      int offset = (((UNITS_PER_WORD + align - 1) / align) * align);
+      int size = MAX (UNITS_PER_WORD,
+                     GET_MODE_SIZE (TYPE_MODE (integer_type_node)));
+      int offset = ((size + align - 1) / align) * align;
       nextarg = plus_constant (nextarg, -offset);
     }