RFR: 8299546: C2: MulLNode::mul_ring() wrongly returns bottom type due to casting errors with large numbers [v2]

Christian Hagedorn chagedorn at openjdk.org
Tue Jan 10 14:27:43 UTC 2023


On Mon, 9 Jan 2023 20:19:49 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/opto/mulnode.cpp line 309:
> 
>> 307:   // result compared to a * b. Special case MIN_VALUE * -1 whose result is MIN_VALUE.
>> 308:   bool does_overflow(const NativeType a, const NativeType b) const {
>> 309:     NativeType x = java_multiply(a, b);
> 
> Should we check for 0 values to `return false;` immediately before all calculations?
> Also may be path results of `java_multiply()` to does_overflow(). Otherwise you execute it twice.

I've updated my patch with your suggestion.

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

PR: https://git.openjdk.org/jdk/pull/11907


More information about the hotspot-compiler-dev mailing list