[lworld] RFR: 8376791: [lworld] C2 compilation hits assert(!not_flat || !is_flat()) failed: inconsistency [v4]

Tobias Hartmann thartmann at openjdk.org
Wed Feb 4 13:47:08 UTC 2026


On Wed, 4 Feb 2026 13:39:34 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/hotspot/share/opto/parse1.cpp line 667:
>> 
>>> 665:       improved_type = improved_type->join_speculative(t)->is_ptr();
>>> 666:       if (improved_type != t) {
>>> 667:         Node* cast = _gvn.transform(new CheckCastPPNode(control(), parm, improved_type, ConstraintCastNode::DependencyType::NonFloatingNarrowing));
>> 
>> Can't we use default `FloatingNarrowing` here?
>
> Thanks for your speedy review. Theoretically, it makes more sense since this speculation comes with the method invocation, and a method invocation does not float. Practically, it does not make any difference because this speculation should only be practiced when we are the top-most method. In that case, there is no where else to hoist to so it makes no difference whether the cast is floating. I have added a comment explaining why this speculation only makes sense when we are the top-most method.

That makes sense, thanks for the details.

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/2030#discussion_r2764095594


More information about the valhalla-dev mailing list