From: H.J. Lu Date: Tue, 7 Apr 2026 10:12:27 +0000 (+0800) Subject: Update x86: Call ix86_access_stack_p only for larger alignment X-Git-Tag: basepoints/gcc-17~289 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8a84242e4b;p=thirdparty%2Fgcc.git Update x86: Call ix86_access_stack_p only for larger alignment commit f511bf93f947199a9f9099fee87b7052e5515fb9 Author: H.J. Lu 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 --- diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 39136ce5042..f4d0f623943 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;