RFR(S): 8239569: PublicMethodsTest.java failed due to NPE in java.base/java.nio.file.FileSystems.getFileSystem(FileSystems.java:230)

Tobias Hartmann tobias.hartmann at oracle.com
Fri Apr 24 08:24:08 UTC 2020


Hi Roland,

Ouh, good catch! Looks good.

Best regards,
Tobias

On 24.04.20 10:14, Roland Westrelin wrote:
> 
> https://bugs.openjdk.java.net/browse/JDK-8239569
> http://cr.openjdk.java.net/~roland/8239569/webrev.00/
> 
> The bug occurs when reading from a constant array after a loop is fully
> unrolled. Reading an element in the loop has the shape:
> (LoadB (AddP base (AddP base base index) ..) ..)
> A load from the same element is also out of the loop:
> (LoadUB (AddP base (AddP base base index) ..) ..)
> The AddPs are shared between the LoadB in the loop and the LoadUB out of
> the loop.
> 
> After full unrolling the load out of the loop becomes:
> (LoadUB (Phi (AddP base (AddP base base index1) ..) (AddP base (AddP base base index2) ..) ..) ..)
> 
> The AddPs are then pushed through the Phi and that's where the bug
> is.
> 
> - index1 is 0 and so the type of (AddP base base index1) is a constant
>   array pointer with no offset.
> 
> - that type is met with the type of the base of the second AddP instead
>   of the type of the address of the second AddP. The result is a
>   constant array pointer.
> 
> The resulting Phi for the address input is created as a Phi of type
> constant array with no offset instead of constant array with offset. As
> a result, the Phi constant folds and the offset is lost.
> 
> Roland.
> 


More information about the hotspot-compiler-dev mailing list