On Tue, 16 Jun 2026 23:20:46 GMT, Ashay Rane <[email protected]> wrote:
> 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). This pull request has now been integrated. Changeset: c4497633 Author: Ashay Rane <[email protected]> Committer: Mat Carter <[email protected]> URL: https://git.openjdk.org/jdk/commit/c4497633bd78f3031f81bf397c63e8551d1d0489 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8386805: Drop ICF optimization from MSVC compilation flags Reviewed-by: erikj, jwaters, aph ------------- PR: https://git.openjdk.org/jdk/pull/31544
