[riscv-port-jdk11u:riscv-port] RFR: 8290496: riscv: Fix build warnings-as-errors with GCC 11

Gui Cao gcao at openjdk.org
Sun Mar 3 06:45:09 UTC 2024


Hi, Please review this backport to riscv-port-jdk17u.
Backport of [JDK-8290496](https://bugs.openjdk.java.net/browse/JDK-8290496). Applies cleanly.
build config:

bash configure --with-debug-level=release --with-jvm-variants=minimal --with-zlib=system --with-native-debug-symbols=internal --with-boot-jdk=/home/zifeihan/jre/jre11 --with-extra-cxxflags=-Wno-maybe-uninitialized --with-extra-cflags=-Wno-maybe-uninitialized


Before this backport:


ERROR: Build failed for target 'default (exploded-image)' in configuration 'linux-riscv64-normal-minimal-release' (exit code 2)
Stopping sjavac server

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-minimal_libjvm_objs_c1_LIRAssembler.o:
In file included from /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/c1/c1_LIRAssembler.hpp:28,
                 from /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/c1/c1_LIRAssembler.cpp:30:
In member function 'void PatchingStub::install(MacroAssembler*, LIR_PatchCode, Register, CodeEmitInfo*)',
    inlined from 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)' at /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/c1/c1_LIRAssembler.cpp:45:17:
/home/zifeihan/riscv-port-jdk11u/src/hotspot/share/c1/c1_CodeStubs.hpp:423:25: error: 'this' pointer is null [-Werror=nonnull]
  423 |       n_move->set_offset(field_offset);
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/code/nativeInst.hpp:30,
                 from /home/zifeihan/riscv-port-jdk11u/src/hotspot/share/precompiled/precompiled.hpp:77:
/home/zifeihan/riscv-port-jdk11u/src/hotspot/cpu/riscv/nativeInst_riscv.hpp: In member function 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)':
/home/zifeihan/riscv-port-jdk11u/src/hotspot/cpu/riscv/nativeInst_riscv.hpp:419:8: note: in a call to non-static member function 'void NativeMovRegMem::set_offset(int)'
  419 |   void set_offset(int x);
      |        ^~~~~~~~~~
cc1plus: all warnings being treated as errors

* All command lines available in /home/zifeihan/riscv-port-jdk11u/build/linux-riscv64-normal-minimal-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

make[1]: *** [/home/zifeihan/riscv-port-jdk11u/make/Init.gmk:308: main] Error 2
make: *** [/home/zifeihan/riscv-port-jdk11u/make/Init.gmk:186: default] Error 2


After this backport,  We can build successful.

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

Commit messages:
 - Backport 8290496: riscv: Fix build warnings-as-errors with GCC 11

Changes: https://git.openjdk.org/riscv-port-jdk11u/pull/7/files
 Webrev: https://webrevs.openjdk.org/?repo=riscv-port-jdk11u&pr=7&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8290496
  Stats: 43 lines in 2 files changed: 6 ins; 14 del; 23 mod
  Patch: https://git.openjdk.org/riscv-port-jdk11u/pull/7.diff
  Fetch: git fetch https://git.openjdk.org/riscv-port-jdk11u.git pull/7/head:pull/7

PR: https://git.openjdk.org/riscv-port-jdk11u/pull/7


More information about the riscv-port-dev mailing list