JDK-8289049 : x86_32 build fails with GCC 11 due to newString646_US warning
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: x86
  • Submitted: 2022-06-23
  • Updated: 2024-04-16
  • Resolved: 2022-08-17
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 20
20 b11Fixed
Related Reports
Blocks :  
Description
While building x86 with GCC 10.3 works, we get some compilation errors with GCC 11 (tested with GCC 11.2.0):

/home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c: In function 'newString646_US':
/home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c:487:15: error: 'str1' may be used uninitialized [-Werror=maybe-uninitialized]
  487 |     result = (*env)->NewString(env, str1, len);
      |              ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c:487:15: note: by argument 2 of type 'const jchar *' {aka 'const short unsigned int *'} to 'struct _jobject *(const struct JNINativeInterface_ **, const jchar *, jsize)' {aka 'struct _jobject *(const struct JNINativeInterface_ **, const short unsigned int *, int)'}

Some of the build failures seem to be related to JDK-8289046 ('this' pointer is null). Fixing JDK-8289046 should also fix these specific failures.
Comments
Changeset: 0c67fba1 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-08-17 12:52:17 +0000 URL: https://git.openjdk.org/jdk/commit/0c67fba11f444cc3739f66c8a2d57564b5dcca72
17-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9702 Date: 2022-08-01 11:46:52 +0000
01-08-2022

ILW = x86 build failure, only with GCC 11 which treats some warnings as errors, disable warnings = HLM = P3
23-06-2022