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

RISC-V: GCC 11 warning in c1_CodeStubs.hpp

    XMLWordPrintable

Details

    Description

      Current GCC 11 RISC-V builds fail with:

      ```
      * For target hotspot_variant-server_libjvm_objs_c1_LIRAssembler.o:
      In file included from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_LIRAssembler.hpp:28,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_LIRAssembler.cpp:30:
      In member function 'void PatchingStub::install(MacroAssembler*, LIR_PatchCode, Register, CodeEmitInfo*)',
          inlined from 'void PatchingStub::install(MacroAssembler*, LIR_PatchCode, Register, CodeEmitInfo*)' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_CodeStubs.hpp:423:8,
          inlined from 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)' at /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_LIRAssembler.cpp:46:17:
      /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_CodeStubs.hpp:440:25: error: 'this' pointer is null [-Werror=nonnull]
        440 | n_move->set_offset(field_offset);
            | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      In file included from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/code/nativeInst.hpp:30,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_CodeStubs.hpp:33,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_LIRAssembler.hpp:28,
                       from /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/share/c1/c1_LIRAssembler.cpp:30:
      /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/cpu/riscv/nativeInst_riscv.hpp: In member function 'void LIR_Assembler::patching_epilog(PatchingStub*, LIR_PatchCode, Register, CodeEmitInfo*)':
      /home/buildbot/worker/build-jdkX-debian12/build/src/hotspot/cpu/riscv/nativeInst_riscv.hpp:420:8: note: in a call to non-static member function 'void NativeMovRegMem::set_offset(int)'
        420 | void set_offset(int x);
         ... (rest of output omitted)
      ```

      I think the compiler is smart/dumb enough to see through `Unimplemented()` here and then complain about the nullity:

      ```
      inline NativeMovRegMem* nativeMovRegMem_at (address addr) {
        Unimplemented();
        return NULL;
      }
      ```

      Attachments

        Issue Links

          Activity

            People

              aph Andrew Haley
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: