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).

Looks good, but I recall that ICF was enabled for gold (Or ld, can't remember 
which) some time ago. Will that also cause issues for that toolchain or is this 
only an issue for VC?

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

Marked as reviewed by jwaters (Committer).

PR Review: https://git.openjdk.org/jdk/pull/31544#pullrequestreview-4513222724

Reply via email to