JDK-8366127 : RISC-V: compiler/intrinsics/TestVerifyIntrinsicChecks.java fails when running without RVV
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: riscv
  • Submitted: 2025-08-26
  • Updated: 2025-08-28
  • Resolved: 2025-08-27
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 26
26 b13Fixed
Related Reports
Causes :  
Description
We noticed that compiler/intrinsics/TestVerifyIntrinsicChecks.java fails when running on sg2042.
The error is caused by the intrinsic EncodeISOArray corresponding to encodeAsciiArray0 requiring RVV on riscv. (See encode_iso_array_v in c2_MacroAssembler_riscv.cpp)

Error log:
```
----------System.err:(25/1658)----------
 stdout: [CompileCommand: inline java/lang/StringCoding.encodeAsciiArray0 bool inline = true
2025-08-24T16:07:39.188959968Z [main] Triggering the crash
2025-08-24T16:07:50.143289977Z [main] Warming up the intrinsic method
2025-08-24T16:07:50.432992495Z [main] Violating the intrinsic method contract (sa=null)
];
 stderr: [Exception in thread "main" java.lang.NullPointerException: Cannot load from char array because "sa" is null
	at java.base/java.lang.StringCoding.encodeAsciiArray0(StringCoding.java:190)
	at java.base/java.lang.Helper.StringCodingEncodeAsciiArray0(Helper.java:44)
	at compiler.intrinsics.TestVerifyIntrinsicChecks.violateIntrinsicMethodContract(TestVerifyIntrinsicChecks.java:92)
	at compiler.intrinsics.TestVerifyIntrinsicChecks.main(TestVerifyIntrinsicChecks.java:67)
]
 exitValue = 1

java.lang.RuntimeException: 'unexpected null in intrinsic' missing from stdout/stderr
	at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253)
	at compiler.intrinsics.TestVerifyIntrinsicChecks.main(TestVerifyIntrinsicChecks.java:61)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1474)

JavaTest Message: Test threw exception: java.lang.RuntimeException: 'unexpected null in intrinsic' missing from stdout/stderr
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: 'unexpected null in intrinsic' missing from stdout/stderr
```
Comments
Changeset: 0d543293 Branch: master Author: Dingli Zhang <dzhang@openjdk.org> Committer: Feilong Jiang <fjiang@openjdk.org> Date: 2025-08-27 02:15:02 +0000 URL: https://git.openjdk.org/jdk/commit/0d543293045d0037791774a1414ef279a1f6768b
27-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26935 Date: 2025-08-26 03:19:09 +0000
26-08-2025