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

HotSpot C1 issue with comparing long numbers on x86 32-bit

XMLWordPrintable

    • b14
    • 11
    • b13
    • x86
    • generic
    • Not verified

        Test case for this issue:

        public class app {
            public static void main(String[] args) {
                Integer cnt = 100;
                if (args.length > 0) {
                    cnt = Integer.parseInt(args[0]);
                }

                for (int i = 0; i < cnt; i++) {
                    test(4558828911L,
                         4294967296L);
                }
            }

            private static void test(long one, long two) {
                while (true) {
                    if (one >= two) {
                        break;
                    }
                }
            }
        }

        OPTS="-XX:+PrintCompilation -XX:CompileOnly=app.test -XX:CompileCommand=quiet"
        $JAVA_HOME/bin/java $OPTS app 10000

        The issue is specific to 32-bit where C1 generated code enters infinite loop.

              dcherepanov Dmitry Cherepanov
              dcherepanov Dmitry Cherepanov
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: