This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: aliasing problem with va_arg
- To: law at cygnus dot com
- Subject: Re: aliasing problem with va_arg
- From: Andi Kleen <ak at muc dot de>
- Date: 28 Oct 1998 15:43:36 +0100
- Cc: Jim Wilson <wilson at cygnus dot com>, mark at markmitchell dot com, egcs at cygnus dot com
- References: <21508.909509785@hurl.cygnus.com>
In article <21508.909509785@hurl.cygnus.com>,
Jeffrey A Law <law@cygnus.com> writes:
> One possibility would be to have the va_arg macro expand in the normal fashion,
> but also emit something similar to __builtin_saveregs -- ie a marker to
> indicate that we're accessing stuff on a varargs list.
> When we see the marker we turn off type based alias analysis, or just generate
> alias set zero for all mems.
> We then have a different marker emitted by va_end which returns us to normal
> behavior.
> That's easier than fixing the varargs stuff to work strictly with builtins.
> We could even have the builtins be named __builtin_va_arg (ap, type) and
> __builtin_va_end (ap) as a step towards actually implementing them as builtins.
A __norestrict pointer qualifier and an appropiate cast in the va_* macros
looks a lot cleaner and more general purpose for me - I could imagine that
it would be very useful to fix other macros where the maintainers don't
have the possibility to change the compiler @)
-Andi