Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2209810 | 7 | Vladimir Kozlov | P3 | Closed | Fixed | b142 |
JDK-2194508 | 6-pool | Yumin Qi | P3 | Closed | Won't Fix |
the tests below fail for server compiler, but pass for client compiler on the latest tiger build
/
* Test for the bug of transforming indx >= MININT to indx > MININT-1 */
/* Run with -Xcomp -XX:CompileOnly=ge1.test1 -XX:MaxInlineSize=1 */
public class ge1
{
public static int result=1;
public static int test1(int limit)
{
int indx;
int sum = 0;
for (indx = 500; indx >= limit; indx -= 2)
{
sum += 2000 / indx;
result = sum;
}
return sum;
}
public static void main(String[] args)
{
int r = 0;
try
{
r = test1(0x80000000);
System.out.println(result);
System.out.println("FAILED");
System.exit(1);
}
catch (ArithmeticException e1)
{
System.out.println("Expected exception caught");
if (result != 5986)
{
System.out.println(result);
System.out.println("FAILED");
System.exit(1);
}
}
System.out.println("WORKED");
}
}
====
/* Run with -Xcomp -XX:CompileOnly=wrap1.test1 -XX:MaxInlineSize=1 */
/* limit reset to ((limit-init+stride-1)/stride)*stride+init */
/* Calculation may overflow */
public class wrap1
{
public static volatile int c = 1;
public static int test1(int limit)
{
int indx;
int sum = 0;
for (indx = 0xffffffff; indx < limit; indx += 0x20000000)
{
sum += c;
}
return sum;
}
public static void main(String[] args)
{
int result;
result = test1(0x7fffffff);
if (result != 4)
{
System.out.println(result);
System.out.println("FAILED");
System.exit(1);
}
else
{
System.out.println("WORKED");
}
}
}
====
/* Test for range check elimination with bit flip issue for
scale*i+offset<limit where offset is not 0 */
/* Run with -Xcomp -XX:CompileOnly=rce5.test1
-XX:MaxInlineSize=1 */
public class rce5
{
static int[] box = {1,2,3,4,5,6,7,8,9};
public static int result=0;
public static int test1(int[] b, int limit)
{
int indx;
int sum = b[1];
result = sum;
for (indx = 0x80000000; indx < limit; ++indx)
{
if (indx > 0x80000000)
{
// this test is not issued in pre-loop but issued in main loop
// trick rce into thinking expression is false when indx >= 0
// in fact it is false when indx==0x80000001
if (indx - 9 < -9)
{
sum += indx;
result = sum;
sum ^= b[indx & 7];
result = sum;
}
else
break;
}
else
{
sum += b[indx & 3];
result = sum;
}
}
return sum;
}
public static void main(String[] args)
{
int r = test1(box,0x80000100);
if (result != 3)
{
System.out.println(result);
System.exit(2);
}
else
{
System.out.println("WORKED");
}
}
}
====
/* Test for range check elimination with bit flip issue for
scale*i<limit where scale > 1 */
/* Run with -Xcomp -XX:CompileOnly=rce6.test1
-XX:MaxInlineSize=1 */
public class rce6
{
static int[] box = {1,2,3,4,5,6,7,8,9};
public static int result=0;
public static int test1(int[] b, int limit)
{
int indx;
int sum = b[1];
result = sum;
for (indx = 0x80000000; indx < limit; ++indx)
{
if (indx > 0x80000000)
{
// harmless rce target
if (indx < 0)
{
sum += result;
result = sum;
}
else
break;
// this test is not issued in pre-loop but issued in main loop
// trick rce into thinking expression is false when indx >= 0
// in fact it is false when indx==0x80000001
// In compilers that transform mulI to shiftI may mask this issue.
if (indx * 28 + 1 < 0)
{
sum += indx;
result = sum;
sum ^= b[indx & 7];
result = sum;
}
else
break;
}
else
{
sum += b[indx & 3];
result = sum;
}
}
return sum;
}
public static void main(String[] args)
{
int r = test1(box,0x80000100);
if (result != 6)
{
System.out.println(result);
System.exit(2);
}
else
{
System.out.println("WORKED");
}
}
}
====
/* Test for range check elimination with i <= limit */
/* Run with -Xcomp -XX:CompileOnly=rce7.test1
-XX:MaxInlineSize=1 */
public class rce7
{
static int[] box = {1,2,3,4,5,6,7,8,9,0x7fffffff};
public static int result=0;
public static int test1(int[] b)
{
int indx;
int max = b[9];
int sum = b[7];
result = sum;
for (indx = 0; indx < b.length; ++indx)
{
if (indx <= max)
{
sum += (indx ^ 15) + ((result != 0) ? 0 : sum);
result = sum;
}
else
throw new RuntimeException();
}
for (indx = -7; indx < b.length; ++indx)
{
if (indx <= 9)
{
sum += (sum ^ 15) + ((result != 0) ? 0 : sum);
result = sum;
}
else
throw new RuntimeException();
}
return sum;
}
public static void main(String[] args)
{
int r = test1(box);
if (result != 14680079)
{
System.out.println(result);
System.exit(2);
}
else
{
System.out.println("WORKED");
}
}
}
====
/* Test for range check elimination with i >= limit */
/* Run with -Xcomp -XX:CompileOnly=rce8.test1
-XX:MaxInlineSize=1 */
public class rce8
{
static int[] box = {-1,0,1,2,3,4,5,6,7,8,0x80000000};
private static int result=0;
public static int test1(int[] b)
{
int indx;
int sum = b[5];
int min = b[10];
result = sum;
for (indx = b.length-1; indx >= 0; --indx)
{
if (indx >= min)
{
sum += (sum ^ 9) + ((result != 0) ? 0 :sum);
result = sum;
}
else
throw new RuntimeException();
}
return sum;
}
public static void main(String[] args)
{
int r = test1(box);
if (result != 16393)
{
System.out.println(result);
System.exit(2);
}
else
{
System.out.println("WORKED");
}
}
}
====
/* Test for the bug of transforming indx <= MAXINT to indx < MAXINT+1 */
/* Run with -Xcomp -XX:CompileOnly=le1.test1 -XX:MaxInlineSize=1 */
public class le1
{
public static int result = 0;
public static int test1(int limit)
{
int indx;
int sum = 0;
for (indx = -500; indx <= limit; indx += 2)
{
sum += 3000 / indx;
result = sum;
}
return sum;
}
public static void main(String[] args)
{
int r = 0;
try
{
r = test1(0x7fffffff);
System.out.println(result);
System.out.println("FAILED");
System.exit(1);
}
catch (ArithmeticException e1)
{
System.out.println("Expected exception caught");
if (result != -9039)
{
System.out.println(result);
System.out.println("FAILED");
System.exit(1);
}
}
System.out.println("WORKED");
}
}
(Incident Review ID: 300690)
======================================================================
- backported by
-
JDK-2194508 Sign flip issues in loop optimizer
- Closed
-
JDK-2209810 Sign flip issues in loop optimizer
- Closed
- duplicates
-
JDK-6959129 COMPARISON WITH INTEGER.MAX_INT DOES NOT WORK CORRECTLY IN THE CLIENT VM
- Closed
-
JDK-7020614 "-server" mode optimizer makes code hang
- Closed
-
JDK-7086553 JVM loop optimization functioning incorrectly
- Closed
-
JDK-5094936 Compiler generates wrong results (wrong loop optimization)
- Closed
-
JDK-6853717 jdk6u14+amd64: loop counter wrong in for loop
- Closed
-
JDK-6890943 JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode.
- Closed
-
JDK-6897150 Hotspot optimises away a valid loop
- Closed
-
JDK-6935022 Server VM incorrectly breaks out of while loop
- Closed
-
JDK-7005594 Array overflow not handled correctly with loop optimzations
- Closed
-
JDK-7116025 SIGSEGV occurs int array in jdk5ux/6ux
- Closed
-
JDK-6186134 Server virtual machine produces/exeutes incorrect code.
- Closed
-
JDK-6196102 Integer seems to be greater than Integer.MAX_VALUE
- Closed
-
JDK-6357214 Hotspot server compiler gets integer comparison wrong
- Closed
-
JDK-6559156 Server compiler generates bad code for "<= Integer.MAX_VALUE" expression
- Closed
-
JDK-6905845 Server VM improperly optimizing away loop
- Closed
-
JDK-6931567 JIT Error (on class file compiled with eclipse) on JVM x64 (but not on x32!)
- Closed
-
JDK-6985295 JVM fails to evaluate condition randomly
- Closed
-
JDK-6992759 Bad code generated for integer <= comparison, fails for Integer.MAX_VALUE
- Closed
-
JDK-7097311 Integer.MAX_VALUE breaks while loop
- Closed
-
JDK-7100905 For loop crash
- Closed
-
JDK-2190300 Server VM incorrectly breaks out of while loop
- Closed
- relates to
-
JDK-6519085 JVM crashes executing test suite of JavaDB (derby)
- Resolved
-
JDK-7052494 Eclipse test fails on JDK 7 b142
- Resolved
-
JDK-6700047 C2 failed in idom_no_update
- Closed
-
JDK-7044725 -XX:-UnrollLimitCheck -Xcomp : Exception: String index out of range: 29488
- Closed
-
JDK-7110586 C2 generates incorrect results
- Closed
-
JDK-7046135 specjvm2008 crypto.rsa perf regression after 7008866
- Closed
-
JDK-7054211 No loop unrolling done in jdk7b144 for a test update() while loop
- Closed
-
JDK-8072422 Cleanup: Remove some unused flags/code in loop optimizations
- Resolved
-
JDK-7045570 compiler/5091921/Test7005594.java failed because not enough space for object heap
- Closed
-
JDK-7045693 java/util/EnumSet/EnumSetBash.java still failing intermittently
- Closed
-
JDK-2148922 JVM crashes executing test suite of JavaDB (derby)
- Closed