RFR: 8352020: [CompileFramework] enable compilation for VectorAPI

Emanuel Peter epeter at openjdk.org
Tue Mar 18 06:54:15 UTC 2025


On Mon, 17 Mar 2025 20:16:59 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> During work on [JDK-8344942](https://bugs.openjdk.org/browse/JDK-8344942) I discovered that it is currently not possible to compile VectorAPI code because it is still in incubator mode and needs flag "--add-modules=jdk.incubator.vector" for "javac".
>> 
>> Also: "javac" can produce warnings, and that leads to issues like this: [JDK-8351998](https://bugs.openjdk.org/browse/JDK-8351998). We should allow such warnings, they are not compile failures.
>> 
>> Example:
>> 
>> javac --add-modules=jdk.incubator.vector Test.java
>> warning: [incubating] using incubating module(s): jdk.incubator.vector
>> 1 warning
>> 
>> 
>> I added an example test as well.
>
> test/hotspot/jtreg/compiler/lib/compile_framework/Compile.java line 200:
> 
>> 198: 
>> 199:         // Note: the output can be non-empty even if the compilation succeeds, e.g. for warnings.
>> 200:         if (exitCode != 0) {
> 
> Would `-XX:-PrintWarnings` also work?

Maybe... but I don't want to risk it. There have recently been a few sightings where `javac` printed some messages, see [JDK-8351998](https://bugs.openjdk.org/browse/JDK-8351998). I think it's just not worth it to fail if it prints anything. Exit code should be sufficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24082#discussion_r2000326887


More information about the hotspot-compiler-dev mailing list