Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8293887

AArch64 build failure with GCC 12 due to maybe-uninitialized warning in libfdlibm k_rem_pio2.c

    XMLWordPrintable

Details

    • b17
    • aarch64
    • linux_ubuntu

    Backports

      Description

        I saw -Werror=maybe-uninitialized compiler warnings when I tried to build OpenJDK with GCC 12 on Ubuntu 22.04 in AArch64 system.

        This gcc warning seems to be a false alarm. As I checked the source code of "k_rem_pio2.c" file, array "fq" with elements from index 0 to "jz", has already been initialized as "fw" at line 290.

        Note that: in my local test, x86-64 build with GCC12 on Ubuntu 22.04 passed.


        Here is the configuration:
        ====================================================
        A new configuration has been successfully created in
        /tmp/jdk-test/build-release
        using configure arguments '--with-boot-jdk=/tmp/test/openjdk/packages/boot-jdk/aarch64/jdk18 --with-debug-level=release --with-version-opt=git-d191e4751 --with-toolchain-type=gcc est=/tmp/test/openjdk/tools/googletest'.

        Configuration summary:
        * Name: /tmp/jdk-test/build-release
        * Debug level: release
        * HS debug level: product
        * JVM variants: server
        * JVM features: server: 'cds compiler1 compiler2 dtrace epsilongc g1gc jfr jni-check jvmci jvmti management parallelgc serialgc services shenandoahgc vm-structs zgc'
        * OpenJDK target: OS: linux, CPU architecture: aarch64, address length: 64
        * Version string: 20-internal-git-d191e4751 (20-internal)
        * Source date: 1663194132 (2022-09-14T22:22:12Z)

        Tools summary:
        * Boot JDK: openjdk version "18-internal" 2022-03-22 OpenJDK Runtime Environment (build 18-internal+0-git-0f2113cee) OpenJDK 64-Bit Server VM (build 18-internal+0-git-0f2113cee, mixed ring) (at /tmp/test/openjdk/packages/boot-jdk/aarch64/jdk18)
        * Toolchain: gcc (GNU Compiler Collection)
        * C Compiler: Version 12.0.1 (at /usr/bin/gcc-12)
        * C++ Compiler: Version 12.0.1 (at /usr/bin/g++-12)

        Build performance summary:
        * Build jobs: 224
        * Memory limit: 257299 MB

        Here is the error log
        === Output from failing command(s) repeated here ===
        * For target support_native_java.base_libfdlibm_k_rem_pio2.o:
        /tmp/jdk-test/jdk_src/src/java.base/share/native/libfdlibm/k_rem_pio2.c: In function '__j__kernel_rem_pio2':
        /tmp/jdk-test/jdk_src/src/java.base/share/native/libfdlibm/k_rem_pio2.c:305:24: error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]
          305 | fw = fq[0]-fw;
              | ~~^~~
        /tmp/jdk-test/jdk_src/src/java.base/share/native/libfdlibm/k_rem_pio2.c:183:27: note: 'fq' declared here
          183 | double z,fw,f[20],fq[20],q[20];
              | ^~
        /tmp/jdk-test/jdk_src/src/java.base/share/native/libfdlibm/k_rem_pio2.c:305:24: error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]
          305 | fw = fq[0]-fw;
              | ~~^~~
        /tmp/jdk-test/jdk_src/src/java.base/share/native/libfdlibm/k_rem_pio2.c:183:27: note: 'fq' declared here
          183 | double z,fw,f[20],fq[20],q[20];
              | ^~
        cc1: all warnings being treated as errors

        * All command lines available in /tmp/jdk-test/build-release/make-support/failure-logs.
        === End of repeated output ===

        Attachments

          Issue Links

            Activity

              People

                haosun Hao Sun
                haosun Hao Sun
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: