Fix CopyRegInfo to keep live/dirty flags of new registers.

CopyRegInfo should not change live/dirty flags of new registgers.
Otherwise, it will lead to incorrectly clobbering these live registers
that are not live actually, and then allocating them to another usage.

Change-Id: Ia9f055b33a11a6d70c0aca1a9fe8639ecfb09464
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java
index 2745c27..007b762 100644
--- a/test/083-compiler-regressions/src/Main.java
+++ b/test/083-compiler-regressions/src/Main.java
@@ -49,6 +49,7 @@
         MirOpSelectTests.testIfCcz();
         ManyFloatArgs();
         atomicLong();
+        LiveFlags.test();
     }
 
     public static void atomicLong() {
@@ -8928,3 +8929,34 @@
         }
     }
 }
+
+class LiveFlags {
+  private static void show_results(double a[], double b[], int trip) {
+    if ((a[0]+a[1]+b[0]+b[1]) == 0) {
+      System.out.println("LiveFlags passes trip " + trip);
+    } else {
+      System.out.println("LiveFlags fails trip " + trip);
+      System.out.println("a[0] = " + a[0] + " a[1] = " + a[1]);
+      System.out.println("b[0] = " + b[0] + " b[1] = " + b[1]);
+    }
+  }
+  static void test()
+  {
+    final double A[] = new double[2];
+    final double B[] = new double[2];
+    final double C[] = new double[2];
+    B[0] = B[1] = 0.0;
+    A[0] = A[1] = 0.0;
+    C[0] = C[1] = 0.0;
+    for (int i = 3; i >= 1; i--) {
+      if ( (i & 1) == 0) {
+        continue;
+      }
+      if ( (i & 2) != 0 ) {
+        B[1] = -B[1];
+      }
+      show_results(A, B, i);
+      A[0] = C[0]; A[1] = C[1];
+    }
+  }
+}