The assertion in src/hotspot/share/code/aotCodeCache.cpp requires that all functions are mapped to distinct addresses, but this assumption breaks when we enable the Identical COMDAT Folding optimization in MSVC. Indeed, the MSVC documentation points to this exact issue being a potential problem:
> Because /OPT:ICF can cause the same address to be assigned to > different functions or read-only data members (that is, const > variables when compiled by using /Gy), it can break a program that > depends on unique addresses for functions or read-only data members. To avoid future problems with AOT failing because of ICF, this patch disables ICF when compiling the JVM. --------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - Disable ICF when compiling the JVM since it breaks AOT's assumptions Changes: https://git.openjdk.org/jdk/pull/31544/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31544&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8386805 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/31544.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31544/head:pull/31544 PR: https://git.openjdk.org/jdk/pull/31544
