diff options
author | Richard Stallman <rms@gnu.org> | 1993-05-16 04:15:14 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-05-16 04:15:14 +0000 |
commit | 348ab17b3d00ebf8a5d210ae05aab5f73765cf05 (patch) | |
tree | d6a17d9727c25a87be2a3a52722d3a57b829213a | |
parent | 85b97c484e07b37746eea1670608e97ccb6383bf (diff) | |
download | gcc-348ab17b3d00ebf8a5d210ae05aab5f73765cf05.zip gcc-348ab17b3d00ebf8a5d210ae05aab5f73765cf05.tar.gz gcc-348ab17b3d00ebf8a5d210ae05aab5f73765cf05.tar.bz2 |
(va_arg) [__MIPSEB__]:
After incrementing, subtract the rounded size, not the size proper.
From-SVN: r4478
-rw-r--r-- | gcc/ginclude/va-mips.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/ginclude/va-mips.h b/gcc/ginclude/va-mips.h index ce96411..3d377be 100644 --- a/gcc/ginclude/va-mips.h +++ b/gcc/ginclude/va-mips.h @@ -47,17 +47,23 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #endif #define va_end(__AP) -#ifdef lint /* complains about constant in conditional context */ -#define va_arg(list, mode) ((mode *)(list += __va_rounded_size(mode)))[-1] - -#else /* !lint */ /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ +#ifdef __MIPSEB__ +/* For big-endian machines. */ +#define va_arg(__AP, __type) \ + ((__AP = (char *) ((__alignof__ (__type) > 4 \ + ? ((int)__AP + 8 - 1) & -8 \ + : ((int)__AP + 4 - 1) & -4) \ + + __va_rounded_size (__type))), \ + *(__type *) (void *) (__AP - __va_rounded_size (__type))) +#else +/* For little-endian machines. */ #define va_arg(__AP, __type) \ ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \ ? ((int)__AP + 8 - 1) & -8 \ : ((int)__AP + 4 - 1) & -4) \ + __va_rounded_size(__type))))[-1] -#endif /* lint */ +#endif #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ |