https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128305
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
Status|UNCONFIRMED |NEW
CC| |rguenth at gcc dot gnu.org,
| |tnfchris at gcc dot gnu.org
Last reconfirmed| |2026-10-30
Ever confirmed|0 |1
Keywords| |missed-optimization
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. This is the vectorizer increasing alignment of locals beyond
STACK_BOUNDARY, even with just BB vectorization. Instead we are capping
against MAX_SIACK_ALIGNMENT here.
x86 can perform unaligned accesses and is IIRC the only target with
SUPPORTS_STACK_ALIGNMENT besides nvptx. I'd say we possibly want
the following unless there's need to give the target control over
this (we can ask the misalign access supported hook for example).
diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index e65059081e7..b6d4e3b97be 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -6675,7 +6675,7 @@ vect_can_force_dr_alignment_p (const_tree decl,
poly_uint64 alignment)
return (known_le (alignment,
(unsigned HOST_WIDE_INT) MAX_OFILE_ALIGNMENT));
else
- return (known_le (alignment, (unsigned HOST_WIDE_INT)
MAX_STACK_ALIGNMENT));
+ return (known_le (alignment, (unsigned HOST_WIDE_INT) STACK_BOUNDARY));
}
/* Return whether the data reference DR_INFO is supported with respect to its