From: Alan Lehotsky Date: Thu, 11 Jan 2001 23:01:40 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbc7fda9b0e4596d55e7ae9bc73d918004f6e4f1;p=gcc.git *** empty log message *** From-SVN: r38929 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0bb96469ddc..b1d8c07e1ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-01-11 Alan Lehotsky + + * builtins.c (std_expand_builtin_va_start): Handle varargs when + sizeof (int) is larger than sizeof(__word__). + 2001-01-11 Neil Booth * cppinit.c (do_includes): Fix typo. diff --git a/gcc/builtins.c b/gcc/builtins.c index 1ad33f24826..b7db928d48c 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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); }