Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6795362

32bit server compiler leads to wrong results on solaris-x86

XMLWordPrintable

    • b02
    • x86
    • solaris
    • Verified

        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.

              twisti Christian Thalinger (Inactive)
              epavlova Ekaterina Pavlova
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: