RFR: 8354941: Build failure with glibc 2.42 due to uabs() name collision
Andrew Haley
aph at openjdk.org
Tue Apr 22 09:48:49 UTC 2025
On Tue, 22 Apr 2025 09:00:44 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> Of the other uses of HotSpot uabs, many look suspect to me, and also don't fall into the category of needing to implement Java integer arithmetic semantcs, e.g. they shouldn't be using a java_xxx function. I haven't looked at them carefully, but on an initial look at least some appear to fall into the category of "bug that isn't fixed by wrap semantics".
I think I introduced `uabs()`, and it was specifically intended to handle the calculation of out-of-range relative branches. It is ideally suited to this purpose, and it does what it says: take a signed integer and return its absolute magnitude without undefined behaviour. Originally it was only used in the AArch64 branch, but it was found to be more generally useful and moved to globalDefinitions.hpp by the fix for 8213419: C2 may hang in MulLNode::Ideal()/MulINode::Ideal().
It is quite possible that `uabs()` is being used inappropriately, but it is well suited for to job it was originally intended to do, which has no connection to Java integer semantics. It is clear that the back ends need a function that does this job, and it is used appropriately in several places.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24723#issuecomment-2820777044
More information about the hotspot-dev
mailing list