From: liuhongt Date: Fri, 6 Sep 2024 07:03:16 +0000 (+0800) Subject: Don't force_reg operands[3] when it's not const0_rtx. X-Git-Tag: basepoints/gcc-16~5995 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c726a6643125a59e2ba6f992924a2d0098104578;p=thirdparty%2Fgcc.git Don't force_reg operands[3] when it's not const0_rtx. It fix the regression by a51f2fc0d80869ab079a93cc3858f24a1fd28237 is the first bad commit commit a51f2fc0d80869ab079a93cc3858f24a1fd28237 Author: liuhongt Date: Wed Sep 4 15:39:17 2024 +0800 Handle const0_operand for *avx2_pcmp3_1. caused FAIL: gcc.target/i386/pr59539-1.c scan-assembler-times vmovdqu|vmovups 1 To reproduce: $ cd {build_dir}/gcc && make check RUNTESTFLAGS="i386.exp=gcc.target/i386/pr59539-1.c --target_board='unix{-m32\ -march=cascadelake}'" $ cd {build_dir}/gcc && make check RUNTESTFLAGS="i386.exp=gcc.target/i386/pr59539-1.c --target_board='unix{-m64\ -march=cascadelake}'" gcc/ChangeLog: * config/i386/sse.md (*avx2_pcmp3_1): Don't force_reg operands[3] when it's not const0_rtx. --- diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 1946d3513be..1ae61182d0c 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -17929,7 +17929,8 @@ if (INTVAL (operands[5]) == 1) std::swap (operands[3], operands[4]); - operands[3] = force_reg (mode, operands[3]); + if (operands[3] == CONST0_RTX (mode)) + operands[3] = force_reg (mode, operands[3]); if (operands[4] == CONST0_RTX (mode)) operands[4] = force_reg (mode, operands[4]);