JDK-8240281 : Remove failing assertion code when selecting first memory state in SuperWord::co_locate_pack
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11.0.18-oracle,15,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-03-02
  • Updated: 2022-09-21
  • Resolved: 2021-02-11
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 17
11.0.18-oracleFixed 17 b10Fixed
Related Reports
Duplicate :  
Relates :  
Description
Original RFE description:

In the fix for JDK-8238438 it was not clear if the code to select the first memory state is dead or not. The assertion code was never hit in testing: 

if (!independent(current, ld)) {
  assert(false, "")
  return first_mem; // A later store depends on this load, pick memory state of first load
} 

We could also not think of an example where we should pick the first memory state instead of the last. Therefore, we left an assert(false) in that code path in the fix for JDK-8238438. If it later turns out that there is a valid use case where we need to select the first memory state, we can simply remove the assert again. Otherwise, we could clean this code up later for JDK 16 and always go with the last memory state. The code to check if the first memory state should be picked could be left as assertion code.


Edit for JDK 17:
We found a fuzzer test case (attached) in which we must take the first memory state of a load pack to guarantee a correct result. Picking the last memory state instead results in a wrong execution. Therefore, we can removed the assertion code added with JDK-8238438 as we are now sure that we need the first memory state for some cases. Turning this into a bug.
Comments
Fix request [11u] I backport this for parity with 11.0.17-oracle. No risk, touches debug only build code. Clean backport. SAP nightly testing passed.
21-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1362 Date: 2022-09-19 20:29:52 +0000
19-09-2022

Changeset: 0a89987a Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2021-02-11 13:00:10 +0000 URL: https://git.openjdk.java.net/jdk/commit/0a89987a
11-02-2021

ILW = Assert during compilation (does not affect the product build), reproducible with fuzzer generated test, disable superword optimization = MMM = P3
11-02-2021