Hoisting an independent load above an arraycopy fails because L712 in
MemNode::find_previous_store() cannot be reached:
https://github.com/openjdk/jdk/blob/72b82fd7be3c8bec97c23d8828fd6bbde03223ce/src/hotspot/share/opto/memnode.cpp#L712
This is because the call in L709 changes mem but returns NULL in this case when
it should return != NULL.
Vladimir K. pointed out that find_previous_arraycopy() originally returned != NULL in this case:
> Original 8076188 changes returned `ac`:
> https://github.com/openjdk/jdk/commit/a9cdbd04076149927fc7c13704eb01ea32e2ca6f#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feR562
> but then 8130847 changes accidently removed it when code was refactored:
> https://github.com/openjdk/jdk/commit/0baf2f7e8ab034548c927857c3182cc949bb225b#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feL567
See also http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2021-March/045102.html
MemNode::find_previous_store() cannot be reached:
https://github.com/openjdk/jdk/blob/72b82fd7be3c8bec97c23d8828fd6bbde03223ce/src/hotspot/share/opto/memnode.cpp#L712
This is because the call in L709 changes mem but returns NULL in this case when
it should return != NULL.
Vladimir K. pointed out that find_previous_arraycopy() originally returned != NULL in this case:
> Original 8076188 changes returned `ac`:
> https://github.com/openjdk/jdk/commit/a9cdbd04076149927fc7c13704eb01ea32e2ca6f#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feR562
> but then 8130847 changes accidently removed it when code was refactored:
> https://github.com/openjdk/jdk/commit/0baf2f7e8ab034548c927857c3182cc949bb225b#diff-819eefad0e0c83dec6968dc3f74924e3cd1763f3a43edf305f37ff591ad9a2feL567
See also http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2021-March/045102.html
- relates to
-
JDK-8130847 Cloned object's fields observed as null after C2 escape analysis
- Closed