RFR: 8238812: assert(false) failed: bad AD file [v2]

Rahul Raghavan rraghavan at openjdk.java.net
Tue Mar 9 09:44:07 UTC 2021


On Tue, 9 Mar 2021 06:34:26 GMT, Rahul Raghavan <rraghavan at openjdk.org> wrote:

>> This fixes the bug when the tests that need to be optimized out are next to one an another and the logic for folding comparisons can be used. It's hard to be certain that it's not possible for the 2 tests be separated by some other control flow. In that case the fix would fail.
>> 
>> A conservative fix would be to not use a narrow type in the CastII that tableswitch/lookupswitch switch introduces. It would be a simpler fix and a more robust one.
>
> Thank you @rwestrel for the comments. 
> Understood your point.
> Based on the review comments now planning to -
> 
> i. Do proposal by Roland and remove the narrow type from the CastII as fix for this bug task.
> As of now found no issues with reported java_fuzzer cases / unit tests, mach5 tier 1-7 & pre-integration tests
> for the following changes to avoid use any narrow type in the `CastII` introduced by `lookupswitch`.
> 
> [src/hotspot/share/opto/parse2.cpp]
>    // Clean the 32-bit int into a real 64-bit offset.
>    // Otherwise, the jint value 0 might turn into an offset of 0x0800000000.
> -  const TypeInt* ikeytype = TypeInt::make(0, num_cases, Type::WidenMin);
>    // Make I2L conversion control dependent to prevent it from
>    // floating above the range check during loop optimizations.
> -  key_val = C->conv_I2X_index(&_gvn, key_val, ikeytype, control());
> +  // Do not use a narrow int type here to prevent the data path from dying
> +  // while the control path is not removed. This can happen if the type of key_val
> +  // is later known to be out of bounds of [0, num_cases] and therefore a narrow cast
> +  // would be replaced by TOP while C2 is not able to fold the corresponding range checks.
> +#ifdef _LP64
> +  key_val = C->constrained_convI2L(&_gvn, key_val, TypeInt::INT, control());
> +#endif
> 
> 
> ii. Integrate the other proposed fix to improve `fold_compares` optimizations as a separate enhancement.
> (after addressing the comments in `filtered_int_type()`)

Please note as per the above comments now updated the fix. Request help with review. Thanks.

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

PR: https://git.openjdk.java.net/jdk/pull/2758


More information about the hotspot-compiler-dev mailing list