This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50818] va_list is filled incorrectly in functions with ms_abi attribute on amd64
- From: "dwmw2 at infradead dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Jul 2015 09:43:25 +0000
- Subject: [Bug target/50818] va_list is filled incorrectly in functions with ms_abi attribute on amd64
- Auto-submitted: auto-generated
- References: <bug-50818-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50818
David Woodhouse <dwmw2 at infradead dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dwmw2 at infradead dot org
--- Comment #2 from David Woodhouse <dwmw2 at infradead dot org> ---
Still broken in 5.1.1.
Note that if you contrive to build it with -mabi=ms on the command line (by
splitting the two functions into separate files and building them separately),
it works fine.
It also works fine if you explicitly use __builtin_ms_va_{list,start,end}.
The problem seems to be that GCC is using the *global* ABI setting to decide
what to do when it sees a plain __builtin_va_list, rather the ABI for the
*current* function.
This is hurting us for UEFI builds too, where only public functions are marked
with __attribute__((ms_abi)) but we need *some* way to make va_list do the
right thing in the general case.