diff options
author | Alexei Zavjalov <alexei.zavjalov@intel.com> | 2014-07-30 19:31:04 +0700 |
---|---|---|
committer | Alexei Zavjalov <alexei.zavjalov@intel.com> | 2014-07-31 02:35:49 +0700 |
commit | 54659e3a2c83d3949957a10436e55e525a430a15 (patch) | |
tree | c49f155975190dedff9794c89fc738edaed3f999 /test | |
parent | f90283f61d6ca37abf3a9fb8447d05e79caf0160 (diff) | |
download | art-54659e3a2c83d3949957a10436e55e525a430a15.tar.gz art-54659e3a2c83d3949957a10436e55e525a430a15.tar.bz2 art-54659e3a2c83d3949957a10436e55e525a430a15.zip |
ART: LoadConstWide should clobber temp reg
If we have 2+ LoadConstWide(FP) calls in one method it is possible
that LoadConstWide will load the method poiner only once. In some
cases, for example, if we have branches, initialization might not be
done and it may lead to a segmentation fault.
Change-Id: If45fc2d1109d7ce9bd272f5c56446b2a6884daac
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/083-compiler-regressions/expected.txt | 1 | ||||
-rw-r--r-- | test/083-compiler-regressions/src/Main.java | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/083-compiler-regressions/expected.txt b/test/083-compiler-regressions/expected.txt index 9f57dbd75e..f8d92cc221 100644 --- a/test/083-compiler-regressions/expected.txt +++ b/test/083-compiler-regressions/expected.txt @@ -37,3 +37,4 @@ ManyFloatArgs passes atomicLong passes LiveFlags passes trip 3 LiveFlags passes trip 1 +minDoubleWith3ConstsTest passes diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java index 748b0dee5c..c089c527ab 100644 --- a/test/083-compiler-regressions/src/Main.java +++ b/test/083-compiler-regressions/src/Main.java @@ -58,6 +58,21 @@ public class Main { ManyFloatArgs(); atomicLong(); LiveFlags.test(); + minDoubleWith3ConstsTest(); + } + + public static double minDouble(double a, double b, double c) { + return Math.min(Math.min(a, b), c); + } + + public static void minDoubleWith3ConstsTest() { + double result = minDouble(1.2, 2.5, Double.NaN); + if (Double.isNaN(result)) { + System.out.println("minDoubleWith3ConstsTest passes"); + } else { + System.out.println("minDoubleWith3ConstsTest fails: " + result + + " (expecting NaN)"); + } } public static void atomicLong() { |