aliasing problem with va_arg
Andi Kleen
ak@muc.de
Wed Oct 28 06:43:00 GMT 1998
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
More information about the Gcc
mailing list