diff options
author | Chao-ying Fu <chao-ying.fu@intel.com> | 2014-03-27 14:17:28 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2014-03-27 15:55:11 -0700 |
commit | 3d325c6700509c37d85f21a94575d7605812e806 (patch) | |
tree | 633e04019c357b281043edfd594b2642618541ac /test | |
parent | 0fd52d5d0cf01e5a109851098a43a79f5615dc0f (diff) | |
download | android_art-3d325c6700509c37d85f21a94575d7605812e806.tar.gz android_art-3d325c6700509c37d85f21a94575d7605812e806.tar.bz2 android_art-3d325c6700509c37d85f21a94575d7605812e806.zip |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/083-compiler-regressions/expected.txt | 2 | ||||
-rw-r--r-- | test/083-compiler-regressions/src/Main.java | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/083-compiler-regressions/expected.txt b/test/083-compiler-regressions/expected.txt index f6de0e77dd..05b1eebc4b 100644 --- a/test/083-compiler-regressions/expected.txt +++ b/test/083-compiler-regressions/expected.txt @@ -17,3 +17,5 @@ longModTest passes testIfCcz passes ManyFloatArgs passes atomicLong passes +LiveFlags passes trip 3 +LiveFlags passes trip 1 diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java index 2745c27b80..007b762e06 100644 --- a/test/083-compiler-regressions/src/Main.java +++ b/test/083-compiler-regressions/src/Main.java @@ -49,6 +49,7 @@ public class Main { MirOpSelectTests.testIfCcz(); ManyFloatArgs(); atomicLong(); + LiveFlags.test(); } public static void atomicLong() { @@ -8928,3 +8929,34 @@ class MirOpSelectTests { } } } + +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]; + } + } +} |