]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't force_reg operands[3] when it's not const0_rtx.
authorliuhongt <hongtao.liu@intel.com>
Fri, 6 Sep 2024 07:03:16 +0000 (15:03 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 10 Sep 2024 04:50:13 +0000 (12:50 +0800)
It fix the regression by

a51f2fc0d80869ab079a93cc3858f24a1fd28237 is the first bad commit
commit a51f2fc0d80869ab079a93cc3858f24a1fd28237
Author: liuhongt <hongtao.liu@intel.com>
Date:   Wed Sep 4 15:39:17 2024 +0800

    Handle const0_operand for *avx2_pcmp<mode>3_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_pcmp<mode>3_1): Don't force_reg
operands[3] when it's not const0_rtx.

gcc/config/i386/sse.md

index 1946d3513be1e2ca8d82ac1a6f30ee5762fa05e1..1ae61182d0ccc750f7e9a964b296b1d7da428904 100644 (file)
   if (INTVAL (operands[5]) == 1)
     std::swap (operands[3], operands[4]);
 
-  operands[3] = force_reg (<MODE>mode, operands[3]);
+  if (operands[3] == CONST0_RTX (<MODE>mode))
+    operands[3] = force_reg (<MODE>mode, operands[3]);
   if (operands[4] == CONST0_RTX (<MODE>mode))
     operands[4] = force_reg (<MODE>mode, operands[4]);