RFR: 8349563: Improve AbsNode::Value() for integer types [v2]

Quan Anh Mai qamai at openjdk.org
Thu Apr 3 10:59:56 UTC 2025


On Thu, 3 Apr 2025 09:37:26 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/subnode.cpp line 1938:
>> 
>>> 1936: 
>>> 1937:   NativeType lo_abs = uabs(t->_lo);
>>> 1938:   NativeType hi_abs = uabs(t->_hi);
>> 
>> Converting unsigned to signed is C++ Undefined Behavior, is it not?
>
> @dean-long  ?

No converting unsigned to signed is not UB, the behaviour is the same as in Java.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23685#discussion_r2026748511


More information about the hotspot-compiler-dev mailing list