[9] RFR(S): 8179678: ArrayCopy with same src and dst can cause incorrect execution or compiler crash

Roland Westrelin rwestrel at redhat.com
Tue May 16 12:22:47 UTC 2017

Thanks for looking a this, Tobias.

> But in ArrayCopyNode::can_replace_dest_load_with_src_load() you return
> false, if src == dst. Why is that?

See test2(): src[0] is the destination of the copy, it is replaced by a
read of the source: src[0] which is the destination of the copy... and
the compiler is sent into an infinite loop.

This said, this test is too conservative. I've reworked it.

> 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:



More information about the hotspot-compiler-dev mailing list