https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955
--- Comment #6 from zenith432 at users dot sourceforge.net ---
(In reply to H.J. Lu from comment #5)
> This may be related to PR 50818.
PR 50818 has morphed into a feature request that the canonical
__builtin_va_{list,start,end,copy} builtins behave according to the ABI of the
function they're in. Today they behave according to the '-mabi=' setting on
the command line.
This is bug report that the specialized __builtin_ms_va_{list,start,end,copy}
builtins have stopped working when -flto is used. They worked until gcc 5.3,
both with or without -flto. In gcc 6.1 with -flto, the canonical iterator
__builtin_va_arg ignores them and works on a sysv_va_list. To be precise, it's
__builtin_va_arg in the context of -flto that's broken, not the specialized
builtins. __builtin_va_arg has always been a polymorphic builtin that changes
its behavior based on the type of va_list it's given as an argument. Without
this polymorphic behavior, there's no way to iterate over an ms_va_list.