https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127650
Uroš Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Assignee|unassigned at gcc dot gnu.org |ubizjak at gmail dot com
Last reconfirmed| |2026-09-29
Ever confirmed|0 |1
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 65721
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65721&action=edit
Patch in testing
ix86_function_arg_boundary computes the stack slot alignment from
TYPE_MAIN_VARIANT, so for a typedef with attribute aligned the slot
is only guaranteed to be 8-byte aligned and ix86_gimplify_va_arg emits
no rounding of the overflow area pointer. However, the final
dereference is built with build_aligned_type (type, TYPE_ALIGN (type)),
claiming the alignment of the typedef. With optimization this results
in aligned vector moves from a misaligned address.
Clamp the alignment claimed for the access to the boundary the
argument slot is actually placed at. This also covers types whose
alignment exceeds MAX_SUPPORTED_STACK_ALIGNMENT.
Assisted-by: Claude Sonnet 5.5