RFR: 8375618: Incorrect assert in CastLLNode::Ideal [v2]

Christian Hagedorn chagedorn at openjdk.org
Wed Jan 21 13:39:16 UTC 2026


On Tue, 20 Jan 2026 02:53:31 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> This PR fixes the incorrect assert in `CastLLNode::Ideal`. The assert intends to verify that the output is either a proper subset of or the same as the input. It does so by checking the signed lower bound and signed upper bound of the `TypeLong` instances. This method is not correct now.
>> 
>> Please kindly review, thanks a lot.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make properly_contains debug only

The fix looks good to me, thanks!

src/hotspot/share/opto/type.cpp line 1820:

> 1818: 
> 1819: #ifdef ASSERT
> 1820: bool TypeInt::properly_contains(const TypeInt* t) const {

Is `strictly_contains` easier to understand? But from a set theory perspective, "proper" and "strict" are both correct.

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29304#pullrequestreview-3687284998
PR Review Comment: https://git.openjdk.org/jdk/pull/29304#discussion_r2712605987


More information about the hotspot-compiler-dev mailing list