This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/70955] [6/7 Regression] Wrong code generation for __builtin_ms_va_list with -flto
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Aug 2016 16:56:46 +0000
- Subject: [Bug lto/70955] [6/7 Regression] Wrong code generation for __builtin_ms_va_list with -flto
- Auto-submitted: auto-generated
- References: <bug-70955-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955
--- Comment #23 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #22)
> (In reply to vries from comment #18)
> > Created attachment 39484 [details]
> > Tentative patch using attributes ms_abi/sysv_abi
> >
> > not build or regression tested yet, but at least makes test-case pass.
>
> LGTM.
Just realized, there's a potential problem with the patch and
sysv_va_list_type_node. sysv_va_list_type_node is an array type (array with
length 1 and a struct as element type).
grokdeclarator (in c-decl.c, see comment 'A parameter declared as an array of T
is really a pointer to T') converts that type into a pointer to array element
type (as explained in more detail in build_va_arg) and drops the attributes.
Perhaps we should mark the underlying element type with the attribute (as
well/instead? I'm not sure yet).