re PR target/70442 (gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in...
authorIlya Enkovich <enkovich.gnu@gmail.com>
Thu, 31 Mar 2016 15:37:12 +0000 (15:37 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Thu, 31 Mar 2016 15:37:12 +0000 (15:37 +0000)
gcc/

PR target/70442
* config/i386/i386.c (scalar_chain::convert_op): Fix
description.
(scalar_chain::convert_insn): Call convert_op for reg
moves to handle undefined registers.

gcc/testsuite/

PR target/70442
* gcc.dg/pr70442.c: New test.

From-SVN: r234637

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

index c58b659b190ba89059e9ab4234bbde59aed2da2f..28ff732950cb0f53d158a8650e6946e430fd7ccc 100644 (file)
@@ -1,3 +1,11 @@
+2016-03-31  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       PR target/70442
+       * config/i386/i386.c (scalar_chain::convert_op): Fix
+       description.
+       (scalar_chain::convert_insn): Call convert_op for reg
+       moves to handle undefined registers.
+
 2016-03-31  Nathan Sidwell  <nathan@acm.org>
 
        PR c++/70393
index 7a75a31741b03af588cc38b4d6e4e65ae20b9586..e5dfb95048a512f42e1c712a5310095606ff9434 100644 (file)
@@ -3384,9 +3384,10 @@ scalar_chain::convert_reg (unsigned regno)
   BITMAP_FREE (conv);
 }
 
-/* Convert operand OP in INSN.  All register uses
-   are converted during registers conversion.
-   Therefore we should just handle memory operands.  */
+/* Convert operand OP in INSN.  We should handle
+   memory operands and uninitialized registers.
+   All other register uses are converted during
+   registers conversion.  */
 
 void
 scalar_chain::convert_op (rtx *op, rtx_insn *insn)
@@ -3467,6 +3468,8 @@ scalar_chain::convert_insn (rtx_insn *insn)
       break;
 
     case REG:
+      if (!MEM_P (dst))
+       convert_op (&src, insn);
       break;
 
     case SUBREG:
index f977fc82992d6a855c5395a75cfd3b890f95963f..ec0b95a8c43023fb5f0b4604651e8f9588d2cc63 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-31  Ilya Enkovich  <enkovich.gnu@gmail.com>
+
+       PR target/70442
+       * gcc.dg/pr70442.c: New test.
+
 2016-03-31  Nathan Sidwell  <nathan@acm.org>
 
        PR c++/70393
diff --git a/gcc/testsuite/gcc.dg/pr70442.c b/gcc/testsuite/gcc.dg/pr70442.c
new file mode 100644 (file)
index 0000000..b9c11ea
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR target/70442 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-msse2" { target ia32 } } */
+
+char a, c;
+void
+fn1 ()
+{
+  long long b;
+  long m;
+  int d;
+  switch (d)
+    {
+    case 5:
+      b = a;
+    }
+  b ^= m;
+  c = b >> b;
+}