Skip to content

Clear _curDefinedOnAllPaths after processing an outermost loop in GVP - #7991

Merged
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
jdmpapin:vp-stale-defined-on-all-paths
Oct 25, 2025
Merged

Clear _curDefinedOnAllPaths after processing an outermost loop in GVP#7991
vijaysun-omr merged 1 commit into
eclipse-omr:masterfrom
jdmpapin:vp-stale-defined-on-all-paths

Conversation

@jdmpapin

Copy link
Copy Markdown
Contributor

Here is an example in Java where a stale _curDefinedOnAllPaths would have prevented a transformation outside of a loop. The last use of answer (after the loop) can be folded to 42, but previously GVP would fail to do so.

    if (x == null) {
        throw new NullPointerException();
    }

    int answer = 42;
    int i;
    for (i = 0; i < x.length; i++) {
        x[i] = 0;
        if (x == null) {
            answer++; // dead path
        }
    }

    ... answer ...

Here is an example in Java where a stale _curDefinedOnAllPaths would
have prevented a transformation outside of a loop. The last use of
answer (after the loop) can be folded to 42, but previously GVP would
fail to do so.

        if (x == null) {
            throw new NullPointerException();
        }

        int answer = 42;
        int i;
        for (i = 0; i < x.length; i++) {
            x[i] = 0;
            if (x == null) {
                answer++; // dead path
            }
        }

        ... answer ...
@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build all

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build riscv

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build riscv,xlinux

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Jenkins build aix

@vijaysun-omr

Copy link
Copy Markdown
Contributor

Merging this since neither failure looks related to me

@vijaysun-omr
vijaysun-omr merged commit 5331c07 into eclipse-omr:master Oct 25, 2025
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants