RFR(S): 8179678: ArrayCopy with same src and dst can cause incorrect execution or compiler crash
vladimir.kozlov at oracle.com
Tue May 16 18:52:03 UTC 2017
Roland, can you move detect_ptr_independence() after instance_id() check? detect_ptr_independence() calls all_controls_dominate() which is expensive.
On 5/16/17 8:49 AM, Tobias Hartmann wrote:
> Hi Roland,
> On 16.05.2017 14:22, Roland Westrelin wrote:
>>> But in ArrayCopyNode::can_replace_dest_load_with_src_load() you return
>>> false, if src == dst. Why is that?
>> See test2(): src is the destination of the copy, it is replaced by a
>> read of the source: src which is the destination of the copy... and
>> the compiler is sent into an infinite loop.
> Yes but my point was that even if src == dst, it's not necessary the case that the arraycopy affects the offset we are reading from src.
> Is the arraycopy still removed in the test2 case?
>> This said, this test is too conservative. I've reworked it.
> Okay, looks good now.
>>> And in line 733, shouldn't we pass must_modify = false to detect the
>>> case we the array copy _may_ modify the source we would load?
>> Yes, you're right. Thanks for spotting that.
>> New webrev:
> Looks good to me!
> Best regards,
More information about the hotspot-compiler-dev