Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect loop iteration count calculation in JIT #20153

Open
Spencer-Comin opened this issue Sep 11, 2024 · 0 comments
Open

Incorrect loop iteration count calculation in JIT #20153

Spencer-Comin opened this issue Sep 11, 2024 · 0 comments
Labels

Comments

@Spencer-Comin
Copy link
Contributor

public class TestLoopLimitOpenJ9 {
    static int test() {
        int r = 0;
        for (int i = -0x40000000; i < 0x70000000; i += 0x30000000) {
            r++;
        }
        return r;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 40_000; i++) {
            int r = test();
            if (r != 9) {
                System.out.println("Failed: " + r + " != 9");
                return;
            }
        }
        System.out.println("Passed");
    }
}
$ java -Xint TestLoopLimitOpenJ9
Passed
$ java -Xjit:'{*test*}(optLevel=scorching)' TestLoopLimitOpenJ9
Failed: 4 != 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants