diff options
author | 2004-05-19 21:38:02 +0000 | |
---|---|---|
committer | 2004-05-19 21:38:02 +0000 | |
commit | da8351c8aaedfc190a648d71b21120b1b753c5f9 (patch) | |
tree | 6f4301ef689cbe45e28695d32b0d156721baa801 | |
parent | In __builtin_saveregs(), initialize __va_stk to a correct value. (diff) | |
download | wireguard-openbsd-da8351c8aaedfc190a648d71b21120b1b753c5f9.tar.xz wireguard-openbsd-da8351c8aaedfc190a648d71b21120b1b753c5f9.zip |
When passing a variable of 32 bytes or larger, as argument to a function,
pass all the subsequent arguments on the stack.
This is necessary for proper varargs operation, if used.
-rw-r--r-- | gnu/egcs/gcc/config/m88k/m88k.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gnu/egcs/gcc/config/m88k/m88k.c b/gnu/egcs/gcc/config/m88k/m88k.c index 1ff84aa30a2..b57d56b68b0 100644 --- a/gnu/egcs/gcc/config/m88k/m88k.c +++ b/gnu/egcs/gcc/config/m88k/m88k.c @@ -2595,6 +2595,14 @@ m88k_function_arg_advance (args_so_far, mode, type, named) || ((type != 0) && TYPE_ALIGN (type) > BITS_PER_WORD))) (*args_so_far)++; + /* as soon as we put a structure of 32 bytes or more on stack, everything + needs to go on stack, or varargs will lose. */ + if (bytes >= 8 * UNITS_PER_WORD) + { + (*args_so_far) += 8; + return; + } + if (mode == BLKmode && (TYPE_ALIGN (type) != BITS_PER_WORD || bytes != UNITS_PER_WORD)) return; |