The following test case produces wrong results (var_bad) when running jvm with 32bit server compiler on solaris-x86. > JDK7b43/bin/java -server -Xcomp -XX:CompileOnly=TesterSmall_Class_0 TesterSmall var_bad = -602947331 var_ok = 0 ============ TesterSmall.java ============== class TesterSmall_Class_0 { static long var_bad = -1L; public TesterSmall_Class_0() { var_bad >>= 65; var_bad /= 65; } } public class TesterSmall { public static void main(String[] args) { TesterSmall_Class_0 t = new TesterSmall_Class_0(); long var_ok = -1L; var_ok >>= 65; var_ok /= 65; System.out.println("var_bad = " + TesterSmall_Class_0.var_bad); System.out.println("var_ok = " + var_ok); } } ======================================= The test works fine on other platforms with bot 32bit and 64bit jvms.
|