[PATCH 2/2] i386: Fix va_arg of 256/512-bit vectors from a SysV va_list
Jonathan Yong
10walls@gmail.com
Thu Oct 1 12:11:11 GMT 2026
On 10/1/26 06:47, Uros Bizjak wrote:
> On Wed, Sep 30, 2026 at 7:48 PM Oleg Tolmatcev <oleg.tolmatcev@gmail.com> wrote:
>>
>> A SysV caller passes unnamed 256 and 512-bit vectors on the stack.
>> For a SysV va_list, ix86_gimplify_va_arg only reads them from the stack
>> if the function containing the va_arg uses the SysV ABI; in an MS ABI
>> function it reads them from the register save area instead. Always
>> read them from the stack.
>>
>> va-arg-abi-attribute-2.c passes on x86_64-w64-mingw32.
>>
>> gcc/ChangeLog:
>>
>> * config/i386/i386.cc (ix86_gimplify_va_arg): Always read unnamed
>> 256 and 512-bit vectors from the stack.
>>
>> gcc/testsuite/ChangeLog:
>>
>> * gcc.target/i386/va-arg-abi-attribute-2.c: New test.
>> * gcc.target/i386/va-arg-abi-attribute-3.c: New test.
>
> LGTM, but please also CC mingw maintainer on MS ABI stuff.
>
> Thanks,
> Uros.
>
>> Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
>> ---
>> gcc/config/i386/i386.cc | 8 +---
>> .../gcc.target/i386/va-arg-abi-attribute-2.c | 46 ++++++++++++++++++
>> .../gcc.target/i386/va-arg-abi-attribute-3.c | 47 +++++++++++++++++++
>> 3 files changed, 95 insertions(+), 6 deletions(-)
>> create mode 100644 gcc/testsuite/gcc.target/i386/va-arg-abi-attribute-2.c
>> create mode 100644 gcc/testsuite/gcc.target/i386/va-arg-abi-attribute-3.c
+ LH.
More information about the Gcc-patches
mailing list