This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83334] __builtin_ms_va_copy used in function with sysv_abi is broken
- From: "zenith432 at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Dec 2017 08:30:36 +0000
- Subject: [Bug target/83334] __builtin_ms_va_copy used in function with sysv_abi is broken
- Auto-submitted: auto-generated
- References: <bug-83334-4@http.gcc.gnu.org/bugzilla/>
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.