https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128640
Uroš Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.5
CC| |liuhongt at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-11-11
Ever confirmed|0 |1
Keywords| |ABI
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed as ABI issue.
The caller (function_arg_64, function_arg_advance_64) and the callee
(ix86_gimplify_va_arg) each have a switch on the natural mode for the rule
“unnamed 256/512-bit vector → stack”. A union with a single vector member
doesn’t have a vector TYPE_MODE. compute_record_mode only copies the member’s
mode for RECORD_TYPE, or for a UNION_TYPE with a MODE_INT member, so the union
gets OImode (XImode for 64 bytes). That’s why the struct and the plain vector
work and the union doesn’t.
The union therefore misses all three checks. classify_argument still gives it
SSE+SSEUP+SSEUP+SSEUP and the caller puts it in %ymm. va_arg builds a
register-save-area container and reads 16 bytes per slot, which explains lane 7
coming from a neighbouring xmm slot.