summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2004-05-19 21:38:02 +0000
committermiod <miod@openbsd.org>2004-05-19 21:38:02 +0000
commitda8351c8aaedfc190a648d71b21120b1b753c5f9 (patch)
tree6f4301ef689cbe45e28695d32b0d156721baa801
parentIn __builtin_saveregs(), initialize __va_stk to a correct value. (diff)
downloadwireguard-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.c8
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;