[Bug target/83334] __builtin_ms_va_copy used in function with sysv_abi is broken

zenith432 at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Mon Dec 11 08:31:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83334

--- Comment #2 from zenith432 at users dot sourceforge.net ---
You're misquoting my summary.  It does not say sysv ABI varargs function.  It
says sys ABI function.  Check the samples.  A __builtin_ms_va_list is
constructed (__builtin_ms_va_started) in an ms ABI varargs function, then
passed as an argument to a sysv ABI function.  sysv ABI functions can already
iterate over __builtin_ms_va_lists today with __builtin_va_arg.  But using
__builtin_ms_va_copy on a __builtin_ms_va_list in a sysv ABI function (that got
one passed in as a parameter) emits incorrect code.
These features are all non-standard and undocumented, so it is difficult to
separate a "bug report" from a "feature request".  A __builtin_ms_va_list is a
char*, and calling __builtin_ms_va_copy on it is just to assign the pointer to
another pointer.  It is the same complexity as passing it as an argument.  On
the other hand, iterating over a __builtin_ms_va_list (with __builtin_va_arg)
emits more complicated code, and this can already be done in a sysv ABI
function.  So it seems like an omission or bug that __builtin_ms_va_copy
doesn't work in a sysv ABI function.


More information about the Gcc-bugs mailing list