From: H.J. Lu Date: Mon, 8 Dec 2025 05:29:59 +0000 (+0800) Subject: x86: Don't allow 2 volatile memory references X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f80829a9f98c99e751bc2b80cffbe599a117f430;p=thirdparty%2Fgcc.git x86: Don't allow 2 volatile memory references Don't allow 2 volatile memory references in *_cmp3_dup_op so that gcc.target/i386/avx2-vpcmpeqq-1.c will generate 2 loads when -march=cascadelake is used. PR target/122343 * config/i386/sse.md (*_cmp3_dup_op): Don't allow 2 volatile memory references. Signed-off-by: H.J. Lu --- diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 0be898c789e..fb79b2e67df 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -4900,7 +4900,8 @@ (match_operand:SI 3 "")] UNSPEC_PCMP_ITER))] "TARGET_AVX512F && ix86_pre_reload_split () - && rtx_equal_p (operands[1], operands[2])" + && rtx_equal_p (operands[1], operands[2]) + && (!MEM_P (operands[1]) || !MEM_VOLATILE_P (operands[1]))" "#" "&& 1" [(set (match_dup 0) (match_dup 4))]