https://gcc.gnu.org/g:c8a84242e4bf53db8ab5c10a508a13e637953556
commit r16-8515-gc8a84242e4bf53db8ab5c10a508a13e637953556 Author: H.J. Lu <[email protected]> Date: Tue Apr 7 18:12:27 2026 +0800 Update x86: Call ix86_access_stack_p only for larger alignment commit f511bf93f947199a9f9099fee87b7052e5515fb9 Author: H.J. Lu <[email protected]> Date: Sun Mar 29 14:30:28 2026 -0700 x86: Call ix86_access_stack_p only for larger alignment incorrectly uses GET_MODE_ALIGNMENT as memory alignment since memory alignment can be different from mode alignment as in (set (reg:OI 20 xmm0 [orig:112 s ] [112]) (mem/c:OI (plus:DI (reg/f:DI 7 sp) (const_int -32 [0xffffffffffffffe0])) [3 s+0 S32 A128])) MEM_ALIGN should be used instead. * config/i386/i386.cc (ix86_need_alignment_p_1): Replace GET_MODE_ALIGNMENT with MEM_ALIGN. Signed-off-by: H.J. Lu <[email protected]> Diff: --- gcc/config/i386/i386.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 39136ce5042d..f4d0f6239433 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -8789,7 +8789,7 @@ ix86_need_alignment_p_1 (rtx set, unsigned int alignment) rtx dest = SET_DEST (set); if (MEM_P (dest)) - return GET_MODE_ALIGNMENT (GET_MODE (dest)) > alignment; + return MEM_ALIGN (dest) > alignment; const_rtx src = SET_SRC (set); @@ -8799,7 +8799,7 @@ ix86_need_alignment_p_1 (rtx set, unsigned int alignment) auto op = *iter; if (MEM_P (op)) - return GET_MODE_ALIGNMENT (GET_MODE (op)) > alignment; + return MEM_ALIGN (op) > alignment; } return false;
