[9] RFR(S): 8158228: C1 incorrectly folds mismatched loads from stable arrays

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jun 2 14:54:11 UTC 2016

Hi Vladimir,

On 02.06.2016 15:49, Vladimir Ivanov wrote:
>>> Mismatch detection is more complex than just comparing basic types (see Type::make_constant_from_array_element() & check_mismatched_access(), though some checks are C2-specific).
>> Right, I agree. I would like to go with marking LoadIndexed/StoreIndexed as mismatched when emitting the intrinsic:
>> http://cr.openjdk.java.net/~thartmann/8158228/webrev.01/
>> Like this we still have optimal code. What do you think?
> I suggest to completely disable constant folding in Canonicalizer::do_LoadIndexed if LoadIndexed node is marked as mismatched.
> Please, leave ciArray::element_value_impl as is.

Okay, I noticed that C2 also does not fold mismatched accesses. Could you please explain why that is?

Here's the new webrev:


> Otherwise, looks good.
> Best regards,
> Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list