JDK-8252696 : Loop unswitching may cause out of bound array load to be executed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-09-02
  • Updated: 2024-11-22
  • Resolved: 2020-09-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 16
11.0.10-oracleFixed 16 b17Fixed
Related Reports
Relates :  
Description
This came up with testing of JDK-8223051:

https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2020-August/039801.html

A loop is unswitched then a pre/post loop is created and finally the main loop is fully unrolled. A load in the main loop floats above the unswitching test and is executed even though it's out of bound (the main loop wouldn't have been executed). This doesn't seem specific to JDK-8223051 even though I couldn't write a test case that reproduces it with current jdk code.
Comments
Fix request (11u) -- will label after testing completed. I would like to downport this for parity with 11.0.10-oracle. Applies clean.
05-10-2020

Changeset: 3fe5886b Author: Roland Westrelin <roland@openjdk.org> Date: 2020-09-23 07:34:56 +0000 URL: https://git.openjdk.java.net/jdk/commit/3fe5886b
23-09-2020