RFR: 8320308: C2 compilation crashes in LibraryCallKit::inline_unsafe_access
Tobias Holenstein
tholenstein at openjdk.org
Wed Jul 10 20:08:19 UTC 2024
On Tue, 9 Jul 2024 18:35:40 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> To understand what happens here. Did null check `If` control flow in `make_unsafe_address()` collapse and have only path to uncommon trap? This is what `stopped()` checks.
Yes, exactly
> In such case why it collapsed if NULL is hidden by CheckCastPP?
While casting the base to not null (`null_check_oop(..)`) we insert `150 CmpP`. The following stack-trace of `_gvn.transform(chk)` to `Node::eqv_uncast`determines that after stripping casting the two nodes are equivalent
<img width="283" alt="must_be_not_null" src="https://github.com/openjdk/jdk/assets/71546117/c630cea7-eca6-4ec6-9835-8d4dcbb52c47">
`Node::eqv_uncast(n, keep_deps=false)` at [node.hpp:500](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/node.hpp#L500)
`SubNode::Value_common(phase)` at [subnode.cpp:91](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/subnode.cpp#L91)
`SubNode::Value(phase)` at [subnode.cpp:101](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/subnode.cpp#L101)
`PhaseGVN::transform(n)` at [phaseX.cpp:703](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/phaseX.cpp#L703)
`GraphKit::null_check_common(value, type, assert_null, null_control, speculative)` at [graphKit.cpp:1316](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/graphKit.cpp#L1316)
`GraphKit::null_check_oop(value, null_control, never_see_null, safe_for_replace, speculative)` at [graphKit.cpp:2455](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/graphKit.cpp#L2455)
`LibraryCallKit::make_unsafe_address(base, offset, type, can_cast)` at [library_call.cpp:2090](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/library_call.cpp#L2090)
`LibraryCallKit::inline_unsafe_access(is_store, type, kind, unaligned)` at [library_call.cpp:2361](https://github.com/openjdk/jdk/blob/3d5d51e228c19aa216451f647023101ae8bdbc79/src/hotspot/share/opto/library_call.cpp#L2361)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20033#issuecomment-2220404518
More information about the hotspot-compiler-dev
mailing list