From: Uros Bizjak Date: Mon, 2 Mar 2020 20:13:36 +0000 (+0100) Subject: i386: Allow only registers with VALID_INT_MODE_P modes in movstrict [PR93997] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b80cbe2d8d46c8518dca2d781c8ee4d02c5ba1ed;p=gcc.git i386: Allow only registers with VALID_INT_MODE_P modes in movstrict [PR93997] *movstrict_1 insn pattern allows only general registers, so we have to reject modes not suitable for general regs in corresponding movstrict expander. PR target/93997 * config/i386/i386.md (movstrict): Allow only registers with VALID_INT_MODE_P modes. testsuite/ChangeLog: PR target/93997 * gcc.target/i386/pr93997.c: New test. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d65434de4d..d27b74a1a0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-03-02 Uroš Bizjak + + PR target/93997 + * config/i386/i386.md (movstrict): Allow only + registers with VALID_INT_MODE_P modes. + 2020-03-02 Andrew Stubbs * config/gcn/gcn-valu.md (dpp_move): New. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6c57500ae8e..8e29dffafa6 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2778,7 +2778,7 @@ { gcc_assert (SUBREG_P (operands[0])); if ((TARGET_PARTIAL_REG_STALL && optimize_function_for_speed_p (cfun)) - || GET_MODE_CLASS (GET_MODE (SUBREG_REG (operands[0]))) != MODE_INT) + || !VALID_INT_MODE_P (GET_MODE (SUBREG_REG (operands[0])))) FAIL; }) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e18c6a9f7a6..e43c5540e35 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-03-02 Uroš Bizjak + + PR target/93997 + * gcc.target/i386/pr93997.c: New test. + 2020-03-02 Martin Sebor PR tree-optimization/92982 diff --git a/gcc/testsuite/gcc.target/i386/pr93997.c b/gcc/testsuite/gcc.target/i386/pr93997.c new file mode 100644 index 00000000000..350d1ea5115 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr93997.c @@ -0,0 +1,4 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-march=athlon-4" } */ + +#include "../../c-c++-common/vector-scalar.c"