RFR: 8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges
Vladimir Kozlov
kvn at openjdk.org
Mon Jan 27 16:55:00 UTC 2025
On Mon, 27 Jan 2025 03:36:24 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:
> Please, review this patch to fix an issue in reducing allocation merges used by Cmp nodes. The attached test case, adapted from the one attached to the JBS issue, can be used to reproduce the issue. The root of the problem was not properly checking the return value of `optimize_ptr_compare` against different Cmp mask predicates.
>
> I tested this on OSX(ARM64) & Linux(Intel) tier1-4.
src/hotspot/share/opto/escape.cpp line 1014:
> 1012:
> 1013: // This CMP always compares whether the output of "res_phi" is TRUE as far as the "mask".
> 1014: Node* new_cmp = _igvn->transform(new CmpINode(res_phi, (mask == BoolTest::mask::eq) ? one : zero));
Why we do `res_phi` transform (line 988) when we create it instead of after we assign inputs (after loop at line 1012)?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23312#discussion_r1930854009
More information about the hotspot-compiler-dev
mailing list