RFR: 8267399: C2: java/text/Normalizer/ConformanceTest.java test failed with assertion [v2]

Roland Westrelin roland at openjdk.java.net
Tue Jun 15 09:30:07 UTC 2021


> This was found with Shenandoah but has nothing specific to Shenandoah.
> 
> For the inner loop of the test case:
> 
> - the loop limit, len, is known to be either 1 or 2. As a consequence
>   the type of the iv phi is set to [0..2].
> 
> - range check elimination is applied which causes the pre/main/post
>   loops to be added and the limit of the main loop to be adjusted. C2
>   computes the limit of the main loop as TypeINT:INT.
> 
> - the main loop is peeled. So now the type of the iv phi is 2 and it
>   constant folds. Because the main loop limit has type TypeInt::INT,
>   the exit condition of the loop doesn't constant fold. But the loop
>   no longer has the shape of a counted loop because the iv phi doesn't
>   exist anymore.
> 
> The crash then occurs when some other loop opts is attempted and loop
> strip mining verification code checks that the shape of the main loop
> is that of a counted loop.
> 
> The fix I propose is to add a CastII at range elimination time that
> captures the bounds of the limit before RC is applied. This way the
> type of the limit is not lost and the main loop backbranch can be
> properly eliminated in the chain of events above.

Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:

  comment

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4388/files
  - new: https://git.openjdk.java.net/jdk/pull/4388/files/26673db3..034ad802

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4388&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4388&range=00-01

  Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4388.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4388/head:pull/4388

PR: https://git.openjdk.java.net/jdk/pull/4388


More information about the hotspot-compiler-dev mailing list