RFR(S): 8179678: ArrayCopy with same src and dst can cause incorrect execution or compiler crash
tobias.hartmann at oracle.com
Tue May 16 15:49:53 UTC 2017
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!
More information about the hotspot-compiler-dev