GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386

i386: Fix va_arg of -bit vectors from a SysV va_list

Corrects how `va_arg` handles large vector types passed on the stack with the SysV ABI on x86.

This commit fixes an issue on the i386 architecture where va_arg incorrectly handled 256-bit and 512-bit vector types passed on the stack using the SysV ABI. Previously, ix86_gimplify_va_arg would only read these from the stack if the function used the SysV ABI, otherwise attempting to read from the register save area. This change ensures that these large vector types are always read from the stack, regardless of the function’s ABI, resolving potential data corruption.

In Details

On i386, the ix86_gimplify_va_arg function determines how arguments are retrieved from a va_list. For unnamed 256/512-bit vectors passed on the stack by a SysV caller, the logic incorrectly branched based on the function's ABI. If the function used the MS ABI, it would attempt to read from the register save area instead of the stack. This commit modifies ix86_gimplify_va_arg to unconditionally read these vector types from the stack when using a SysV va_list, ensuring correct behavior across different ABIs.

For Context
va_arg
A macro in C used to retrieve arguments from a variable argument list (va_list).
va_list
A type in C used to hold information about a variable argument list.
SysV ABI
System V Application Binary Interface, a standard convention for how functions are called and how data is passed between them on Unix-like systems.
i386
The Intel 80386 microprocessor architecture, commonly referred to as x86.
vector types
Data types that hold multiple values of the same fundamental type, often used for SIMD (Single Instruction, Multiple Data) operations.
Filed Under: i386ABIva_argbugfix