Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion make/hotspot/lib/JvmOverrideFiles.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,6 +36,7 @@ ifeq ($(TOOLCHAIN_TYPE), gcc)
BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
BUILD_LIBJVM_cardTableBarrierSetAssembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
BUILD_LIBJVM_interp_masm_x86.cpp_CXXFLAGS := -Wno-uninitialized
BUILD_LIBJVM_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp_CXXFLAGS := -Wno-nonnull
ifeq ($(DEBUG_LEVEL), release)
# Need extra inlining to collapse shared marking code into the hot marking loop
BUILD_LIBJVM_shenandoahMark.cpp_CXXFLAGS := --param inline-unit-growth=1000
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/assembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7546,6 +7546,10 @@ void Assembler::evprolq(XMMRegister dst, XMMRegister src, int shift, int vector_
emit_int24(0x72, (0xC0 | encode), shift & 0xFF);
}

// Register is a class, but it would be assigned numerical value.
// "0" is assigned for xmm0. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
void Assembler::evprord(XMMRegister dst, XMMRegister src, int shift, int vector_len) {
assert(VM_Version::supports_evex(), "requires EVEX support");
assert(vector_len == Assembler::AVX_512bit || VM_Version::supports_avx512vl(), "requires VL support");
Expand All @@ -7563,6 +7567,7 @@ void Assembler::evprorq(XMMRegister dst, XMMRegister src, int shift, int vector_
int encode = vex_prefix_and_encode(xmm0->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes);
emit_int24(0x72, (0xC0 | encode), shift & 0xFF);
}
PRAGMA_DIAG_POP

void Assembler::evprolvd(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) {
assert(VM_Version::supports_evex(), "requires EVEX support");
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/cpu/x86/c1_Runtime1_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ enum reg_save_layout {
// expensive. The deopt blob is the only thing which needs to
// describe FPU registers. In all other cases it should be sufficient
// to simply save their current value.

//
// Register is a class, but it would be assigned numerical value.
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
bool save_fpu_registers = true) {

Expand Down Expand Up @@ -418,6 +422,7 @@ static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,

return map;
}
PRAGMA_DIAG_POP

#define __ this->

Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/frame_x86.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {

// Compiled frames

// Register is a class, but it would be assigned numerical value.
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
inline oop frame::saved_oop_result(RegisterMap* map) const {
oop* result_adr = (oop *)map->location(rax->as_VMReg());
guarantee(result_adr != NULL, "bad register save location");
Expand All @@ -243,5 +247,6 @@ inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {

*result_adr = obj;
}
PRAGMA_DIAG_POP

#endif // CPU_X86_FRAME_X86_INLINE_HPP
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ class ZSaveLiveRegisters {
_spill_offset += 8;
}

// Register is a class, but it would be assigned numerical value.
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
void initialize(ZLoadBarrierStubC2* stub) {
// Create mask of caller saved registers that need to
// be saved/restored if live
Expand Down Expand Up @@ -540,6 +544,7 @@ class ZSaveLiveRegisters {
// Stack pointer must be 16 bytes aligned for the call
_spill_offset = _spill_size = align_up(xmm_spill_size + gp_spill_size + opmask_spill_size + arg_spill_size, 16);
}
PRAGMA_DIAG_POP

public:
ZSaveLiveRegisters(MacroAssembler* masm, ZLoadBarrierStubC2* stub) :
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class RegisterSaver {
static void restore_result_registers(MacroAssembler* masm);
};

// Register is a class, but it would be assigned numerical value.
// "0" is assigned for rax. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_wide_vectors) {
int off = 0;
int num_xmm_regs = XMMRegisterImpl::number_of_registers;
Expand Down Expand Up @@ -361,6 +365,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_

return map;
}
PRAGMA_DIAG_POP

void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_wide_vectors) {
int num_xmm_regs = XMMRegisterImpl::number_of_registers;
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ static void shuffle_arguments(MacroAssembler* _masm, const GrowableArray<ArgMove
}
}

// Register is a class, but it would be assigned numerical value.
// "0" is assigned for rax and for xmm0. Thus we need to ignore -Wnonnull.
PRAGMA_DIAG_PUSH
PRAGMA_NONNULL_IGNORED
address ProgrammableUpcallHandler::generate_optimized_upcall_stub(jobject receiver, Method* entry, jobject jabi, jobject jconv) {
ResourceMark rm;
const ABIDescriptor abi = ForeignGlobals::parse_abi_descriptor(jabi);
Expand Down Expand Up @@ -779,6 +783,7 @@ address ProgrammableUpcallHandler::generate_optimized_upcall_stub(jobject receiv

return blob->code_begin();
}
PRAGMA_DIAG_POP

bool ProgrammableUpcallHandler::supports_optimized_upcalls() {
return true;
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/utilities/compilerWarnings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@
#define PRAGMA_INFINITE_RECURSION_IGNORED
#endif

#ifndef PRAGMA_NONNULL_IGNORED
#define PRAGMA_NONNULL_IGNORED
#endif

#endif // SHARE_UTILITIES_COMPILERWARNINGS_HPP
3 changes: 3 additions & 0 deletions src/hotspot/share/utilities/compilerWarnings_gcc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
#define PRAGMA_STRINGOP_TRUNCATION_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wstringop-truncation")
#endif

#define PRAGMA_NONNULL_IGNORED \
PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")

#if defined(__clang_major__) && \
(__clang_major__ >= 4 || \
(__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
Expand Down