This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR70955] Tag {ms,sysv}_va_list_type_node with {ms,sysv}_abi attribute
- From: Richard Biener <rguenther at suse dot de>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Aug 2016 13:48:09 +0200 (CEST)
- Subject: Re: [PATCH, PR70955] Tag {ms,sysv}_va_list_type_node with {ms,sysv}_abi attribute
- Authentication-results: sourceware.org; auth=none
- References: <0b95bce7-65c8-b122-9125-9e7a19041df3@mentor.com>
On Wed, 24 Aug 2016, Tom de Vries wrote:
> Hi,
>
> in PR70955, ix86_canonical_va_list_type fails to recognize a
> __builtin_ms_va_list that was declared in a TU, because its type doesn't have
> the same main variant as the ms_va_list_type_node initialized in lto1.
>
> This patch fixes the PR by tagging ms_va_list_type_node and
> sysv_va_list_type_node with ms_abi/sysv_abi attributes.
>
> sysv_va_list_type_node is of type array of length one with elemtype record,
> and I ran into trouble with both adding the attribute to the array type and
> the record type, so I ended up adding it to the first field type.
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for trunk, 6 branch?
I miss some comments in the code laying out the scheme to identify
the types.
How did you build the sysv_abi tagged struct / array that ended up
not working? I suspect that in parameter passing the array somehow
decays to a pointer-to-element type so it is important that the
TYPE_MAIN_VARIANT of the record type already contains the attribute.
We've had a first/second testcase in the PR but you only added one - does
it cover both cases?
Thanks,
Richard.