diff mbox series

[committed] : i386: Allow only registers with VALID_INT_MODE_P modes in movstrict<mode> [PR93997]

Message ID CAFULd4bEK0VhZwjZmZVE2K9-uKJoyTkmLuhPq431bf_pk2Ww0A@mail.gmail.com
State New
Headers show
Series [committed] : i386: Allow only registers with VALID_INT_MODE_P modes in movstrict<mode> [PR93997] | expand

Commit Message

Uros Bizjak March 2, 2020, 8:16 p.m. UTC
*movstrict<mode>_1 insn pattern allows only general registers,
so we have to reject modes not suitable for general regs in
corresponding movstrict<mode> expander.

2020-03-02  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/93997
    * config/i386/i386.md (movstrict<mode>): Allow only
    registers with VALID_INT_MODE_P modes.

testsuite/ChangeLog:

2020-03-02  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/93997
    * gcc.target/i386/pr93997.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Uros.
diff mbox series

Patch

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 6c57500ae8ec..8e29dffafa6e 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;
 })