summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-11-16 23:12:17 +0000
committermiod <miod@openbsd.org>2012-11-16 23:12:17 +0000
commit43d80ddcb3d2e7cf8a87d748d97ceebe79eec495 (patch)
treea558593edbb1c0064c2d45dc1467e7a2944ba83f
parentWarn about unknown volume or arch in Dt macro arguments; (diff)
downloadwireguard-openbsd-43d80ddcb3d2e7cf8a87d748d97ceebe79eec495.tar.xz
wireguard-openbsd-43d80ddcb3d2e7cf8a87d748d97ceebe79eec495.zip
In SETUP_INCOMING_VARARGS(), make sure to return in pretend_size the amount
of memory which will be used for the __va_reg register spill.
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
index d5263f4c6aa..4155c6667a3 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.c
@@ -2619,6 +2619,7 @@ m88k_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
CUMULATIVE_ARGS next_cum;
tree fntype;
int stdarg_p;
+ int regcnt;
if (no_rtl)
return;
@@ -2635,6 +2636,11 @@ m88k_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
m88k_function_arg_advance(&next_cum, mode, type, 1);
m88k_first_vararg = next_cum;
+
+ regcnt = m88k_first_vararg < 8 ? 8 - m88k_first_vararg : 0;
+ if (regcnt & 1)
+ regcnt++;
+ *pretend_size = regcnt * UNITS_PER_WORD;
}
/* Do what is necessary for `va_start'. We look at the current function