Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8290496: riscv: Fix build warnings-as-errors with GCC 11 #9550

Closed
wants to merge 1 commit into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 28 additions & 36 deletions src/hotspot/cpu/riscv/nativeInst_riscv.hpp
Expand Up @@ -312,18 +312,14 @@ class NativeCall: public NativeInstruction {
inline NativeCall* nativeCall_at(address addr) {
assert_cond(addr != NULL);
NativeCall* call = (NativeCall*)(addr - NativeCall::instruction_offset);
#ifdef ASSERT
call->verify();
#endif
DEBUG_ONLY(call->verify());
return call;
}

inline NativeCall* nativeCall_before(address return_address) {
assert_cond(return_address != NULL);
NativeCall* call = (NativeCall*)(return_address - NativeCall::return_address_offset);
#ifdef ASSERT
call->verify();
#endif
DEBUG_ONLY(call->verify());
return call;
}

Expand Down Expand Up @@ -363,16 +359,16 @@ class NativeMovConstReg: public NativeInstruction {
}

intptr_t data() const;
void set_data(intptr_t x);
void set_data(intptr_t x);

void flush() {
if (!maybe_cpool_ref(instruction_address())) {
ICache::invalidate_range(instruction_address(), movptr_instruction_size);
}
}

void verify();
void print();
void verify();
void print();

// Creation
inline friend NativeMovConstReg* nativeMovConstReg_at(address addr);
Expand All @@ -382,55 +378,53 @@ class NativeMovConstReg: public NativeInstruction {
inline NativeMovConstReg* nativeMovConstReg_at(address addr) {
assert_cond(addr != NULL);
NativeMovConstReg* test = (NativeMovConstReg*)(addr - NativeMovConstReg::instruction_offset);
#ifdef ASSERT
test->verify();
#endif
DEBUG_ONLY(test->verify());
return test;
}

inline NativeMovConstReg* nativeMovConstReg_before(address addr) {
assert_cond(addr != NULL);
NativeMovConstReg* test = (NativeMovConstReg*)(addr - NativeMovConstReg::instruction_size - NativeMovConstReg::instruction_offset);
#ifdef ASSERT
test->verify();
#endif
DEBUG_ONLY(test->verify());
return test;
}

// RISCV should not use C1 runtime patching, so just leave NativeMovRegMem Unimplemented.
// RISCV should not use C1 runtime patching, but still implement
// NativeMovRegMem to keep some compilers happy.
class NativeMovRegMem: public NativeInstruction {
public:
int instruction_start() const {
Unimplemented();
return 0;
}
enum RISCV_specific_constants {
instruction_size = NativeInstruction::instruction_size,
instruction_offset = 0,
data_offset = 0,
next_instruction_offset = NativeInstruction::instruction_size
};

address instruction_address() const {
Unimplemented();
return NULL;
}
int instruction_start() const { return instruction_offset; }

int num_bytes_to_end_of_patch() const {
Unimplemented();
return 0;
}
address instruction_address() const { return addr_at(instruction_offset); }

int num_bytes_to_end_of_patch() const { return instruction_offset + instruction_size; }

int offset() const;

void set_offset(int x);

void add_offset_in_bytes(int add_offset) { Unimplemented(); }
void add_offset_in_bytes(int add_offset) {
set_offset(offset() + add_offset);
}

void verify();
void print();

private:
inline friend NativeMovRegMem* nativeMovRegMem_at (address addr);
inline friend NativeMovRegMem* nativeMovRegMem_at(address addr);
};

inline NativeMovRegMem* nativeMovRegMem_at (address addr) {
Unimplemented();
return NULL;
inline NativeMovRegMem* nativeMovRegMem_at(address addr) {
NativeMovRegMem* test = (NativeMovRegMem*)(addr - NativeMovRegMem::instruction_offset);
DEBUG_ONLY(test->verify());
return test;
}

class NativeJump: public NativeInstruction {
Expand Down Expand Up @@ -461,9 +455,7 @@ class NativeJump: public NativeInstruction {

inline NativeJump* nativeJump_at(address addr) {
NativeJump* jump = (NativeJump*)(addr - NativeJump::instruction_offset);
#ifdef ASSERT
jump->verify();
#endif
DEBUG_ONLY(jump->verify());
return jump;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/vtableStubs_riscv.cpp
Expand Up @@ -171,7 +171,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");

// Entry arguments:
// t2: CompiledICHolder
// t1: CompiledICHolder
// j_rarg0: Receiver

// This stub is called from compiled code which has no callee-saved registers,
Expand Down