GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Add indirect alignment tests for Win64 AVX

New tests confirm correct stack alignment when passing AVX/AVX512 values indirectly on Windows.

This commit adds new tests for x86-64 Windows to verify proper alignment of AVX and AVX512 values when passed or returned indirectly. The tests cover by-value AVX cases, hidden sret allocation, callee by-reference parameter materialization, and a dedicated aligned(64) AVX512 case. These tests expose a prior bug where GCC materialized under-aligned stack storage in these scenarios.

In Details

This commit addresses PR target/54412, which arises when AVX/AVX512 values are passed or returned indirectly on x86-64 Windows. GCC was found to materialize under-aligned stack storage for these values due to ABI differences in stack alignment requirements between Linux and Windows. The new tests cover various scenarios, including by-value passing, hidden sret allocation, and by-reference parameter materialization.

For Context

AVX and AVX512 are instruction set extensions for x86 processors that enable faster processing of vector data. Correct data alignment in memory is critical for AVX/AVX512 instructions to operate efficiently, and the ABI specifies alignment rules for data passed between functions. This commit adds test cases to verify that GCC correctly aligns AVX/AVX512 data on the stack when passing data between functions on Windows.

Filed Under: testsuitex86-64avxavx512windows