gcc/
authorienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Mar 2016 15:37:12 +0000 (15:37 +0000)
committerienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Mar 2016 15:37:12 +0000 (15:37 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234637 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c58b659..28ff732 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 7a75a31..e5dfb95 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 f977fc8..ec0b95a 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;
+}