From b80cbe2d8d46c8518dca2d781c8ee4d02c5ba1ed Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 2 Mar 2020 21:13:36 +0100 Subject: [PATCH] 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. --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.md | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr93997.c | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr93997.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0d65434..d27b74a 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 6c57500..8e29dff 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 e18c6a9..e43c554 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 0000000..350d1ea --- /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" -- 2.7.4