re PR target/89848 (ICE: in convert_op, at config/i386/i386.c:2099 with -O2 -msse2...
authorUros Bizjak <ubizjak@gmail.com>
Thu, 28 Mar 2019 19:15:58 +0000 (20:15 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 28 Mar 2019 19:15:58 +0000 (20:15 +0100)
PR target/89848
* config/i386/i386.c (dimode_scalar_chain::make_vector_copies):
Also process XEXP (src, 0) of a shift insn.

testsuite/ChangeLog:

PR target/89848
* gcc.target/i386/pr89848.c: New test.

From-SVN: r270003

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr89848.c [new file with mode: 0644]

index 741639daa126795bc709416eee47bc6bbc702e70..2ce421515af534dc6677c6ef931aa4a7a85af082 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-28  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/89848
+       * config/i386/i386.c (dimode_scalar_chain::make_vector_copies):
+       Also process XEXP (src, 0) of a shift insn.
+
 2019-03-28  David Malcolm  <dmalcolm@redhat.com>
 
        PR middle-end/89725
index c695fcdc32ff96139b2f0fbcca266e4e95413937..6926085fdd2fb886af31a06561fb48fee6c67167 100644 (file)
@@ -1901,7 +1901,10 @@ dimode_scalar_chain::make_vector_copies (unsigned regno)
                 || GET_CODE (src) == LSHIFTRT)
                && !CONST_INT_P (XEXP (src, 1))
                && reg_or_subregno (XEXP (src, 1)) == regno)
-             XEXP (src, 1) = vreg;
+             {
+               XEXP (src, 0) = replace_with_subreg (XEXP (src, 0), reg, reg);
+               XEXP (src, 1) = vreg;
+             }
          }
        else
          replace_with_subreg_in_insn (insn, reg, vreg);
index 0210cd72935049a295b79367c3489d12d4a2a444..cf9ed5cda8f46d840acfaf52b2a1a59dc7d26455 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-28  Uroš Bizjak  <ubizjak@gmail.com>
+
+       PR target/89848
+       * gcc.target/i386/pr89848.c: New test.
+
 2019-03-28  Marek Polacek  <polacek@redhat.com>
 
        PR c++/89836 - bool constant expression and explicit conversions.
diff --git a/gcc/testsuite/gcc.target/i386/pr89848.c b/gcc/testsuite/gcc.target/i386/pr89848.c
new file mode 100644 (file)
index 0000000..eb67d0d
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR target/89848 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -msse2 -mtune=pentium3m" } */
+
+long long
+foo (long long x)
+{
+  x >>= 3;
+  x <<= x;
+  return x;
+}