RFR: 8359678: C2: assert(static_cast<T1>(result) == thing) caused by ReverseBytesNode::Value() [v2]

Hannes Greule hgreule at openjdk.org
Tue Jul 8 07:40:02 UTC 2025


On Fri, 4 Jul 2025 09:34:18 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> Hannes Greule has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove classfile version
>
> src/hotspot/share/opto/subnode.cpp line 2031:
> 
>> 2029:     case Op_ReverseBytesUS: return TypeInt::make(byteswap(static_cast<jchar>(con->is_int()->get_con())));
>> 2030:     case Op_ReverseBytesI:  return TypeInt::make(byteswap(con->is_int()->get_con()));
>> 2031:     case Op_ReverseBytesL:  return TypeLong::make(byteswap(con->is_long()->get_con()));
> 
> Why are you dropping the `checked_cast` here? Were they just an abundance of caution before?

This was basically from copy-pasting, but the cast was from jint to jint and jlong to jlong respectively. With the other checked_casts removed, it looks confusing to keep it there I think.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25988#discussion_r2191721589


More information about the hotspot-compiler-dev mailing list