aboutsummaryrefslogtreecommitdiff
path: root/gcc/ginclude
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-04-30 08:06:23 -0700
committerRichard Henderson <rth@gcc.gnu.org>1999-04-30 08:06:23 -0700
commit2c4974b72a5f9a9744b2319b85e4eb239e601c44 (patch)
tree7706f72402a9c7f3fb2f9ab9b6a37610041e752f /gcc/ginclude
parentd8f8e9ba17173a2b929b6047c6892610271cf252 (diff)
downloadgcc-2c4974b72a5f9a9744b2319b85e4eb239e601c44.zip
gcc-2c4974b72a5f9a9744b2319b85e4eb239e601c44.tar.gz
gcc-2c4974b72a5f9a9744b2319b85e4eb239e601c44.tar.bz2
va-ppc.h (__va_start_common): Let __builtin_saveregs do the work.
* va-ppc.h (__va_start_common): Let __builtin_saveregs do the work. * rs6000.c (expand_builtin_saveregs): For V4, initialize a private va_list struct, and return a pointer to it. (setup_incoming_varargs): V4 save area based off virtual_stack_vars instead of frame_pointer. From-SVN: r26710
Diffstat (limited to 'gcc/ginclude')
-rw-r--r--gcc/ginclude/va-ppc.h35
1 files changed, 7 insertions, 28 deletions
diff --git a/gcc/ginclude/va-ppc.h b/gcc/ginclude/va-ppc.h
index 736369d..6d81497 100644
--- a/gcc/ginclude/va-ppc.h
+++ b/gcc/ginclude/va-ppc.h
@@ -59,34 +59,13 @@ typedef struct {
((TYPE *) (void *) (&(((__va_regsave_t *) \
(AP)->reg_save_area)->__gp_save[(int)(AP)->gpr])))
-/* Common code for va_start for both varargs and stdarg. This depends
- on the format of rs6000_args in rs6000.h. The fields used are:
-
- #0 WORDS # words used for GP regs/stack values
- #1 FREGNO next available FP register
- #2 NARGS_PROTOTYPE # args left in the current prototype
- #3 ORIG_NARGS original value of NARGS_PROTOTYPE
- #4 VARARGS_OFFSET offset from frame pointer of varargs area */
-
-#define __va_words __builtin_args_info (0)
-#define __va_fregno __builtin_args_info (1)
-#define __va_nargs __builtin_args_info (2)
-#define __va_orig_nargs __builtin_args_info (3)
-#define __va_varargs_offset __builtin_args_info (4)
-
-#define __va_start_common(AP, FAKE) \
-__extension__ ({ \
- register int __words = __va_words - FAKE; \
- \
- (AP)->gpr = (__words < 8) ? __words : 8; \
- (AP)->fpr = __va_fregno - 33; \
- (AP)->reg_save_area = (((char *) __builtin_frame_address (0)) \
- + __va_varargs_offset); \
- __va_overflow(AP) = ((char *)__builtin_saveregs () \
- + (((__words >= 8) ? __words - 8 : 0) \
- * sizeof (long))); \
- (void)0; \
-})
+/* Common code for va_start for both varargs and stdarg. We allow all
+ the work to be done by __builtin_saveregs. It returns a pointer to
+ a va_list that was constructed on the stack; we must simply copy it
+ to the user's variable. */
+
+#define __va_start_common(AP, FAKE) \
+ __builtin_memcpy ((AP), __builtin_saveregs (), sizeof(__gnuc_va_list))
#ifdef _STDARG_H /* stdarg.h support */