> This warning seems to be a false positive, because 1) array "fq" with > elements from index 0 to "jz" has already been initialized as "fw" at line > 290 [1], and 2) variable "jz" should be non-negative from the comment at line > 99 [2]. > > Note-1: GCC warning option -Wmaybe-uninitialized is not a new one. Note-2: > x86-64 build with GCC 12 on Ubuntu 22.04 passed in my local test. > > This warning is raised only on GCC 12 + AArch64. I suspect it might be some > GCC 12 bug, so I reported it to GCC community [3]. > > Since it involves third party code, I think it's better to suppress the > warning by simply disabling this warning option in the makefile. > > Testing: Release builds with GCC 9, GCC 11 and GCC 12 passed on Ubuntu > 22.04/AArch64 system. > > [1] > https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libfdlibm/k_rem_pio2.c#L290 > > [2] > https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libfdlibm/k_rem_pio2.c#L99 > > [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106992
Hao Sun has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Disable the warning option per file After JDK-8294281, we can disable the warning options per file. Testing: Release builds with GCC 9, GCC 11 and GCC 12 passed on Ubuntu 22.04/AArch64 system. - Merge branch 'master' into 8293887-gcc12-fdlibm - 8293887: AArch64 build failure with GCC 12 due to maybe-uninitialized warning in libfdlibm k_rem_pio2.c This warning seems to be a false positive, because 1) array "fq" with elements from index 0 to "jz" has already been initialized as "fw" at line 290 [1], and 2) variable "jz" should be non-negative from the comment at line 99 [2]. Note-1: GCC warning option -Wmaybe-uninitialized is not a new one. Note-2: x86-64 build with GCC 12 on Ubuntu 22.04 passed in my local test. This warning is raised only on GCC 12 + AArch64. I suspect it might be some GCC 12 bug, so I reported it to GCC community [3]. Since it involves third party code, I think it's better to suppress the warning by simply disabling this warning option in the makefile. Testing: Release builds with GCC 9, GCC 11 and GCC 12 passed on Ubuntu 22.04/AArch64 system. [1] https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libfdlibm/k_rem_pio2.c#L290 [2] https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libfdlibm/k_rem_pio2.c#L99 [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106992 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10386/files - new: https://git.openjdk.org/jdk/pull/10386/files/f745d060..22355e68 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10386&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10386&range=00-01 Stats: 5636 lines in 151 files changed: 3213 ins; 1665 del; 758 mod Patch: https://git.openjdk.org/jdk/pull/10386.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10386/head:pull/10386 PR: https://git.openjdk.org/jdk/pull/10386