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

[Backport] 8290496: riscv: Fix build warnings-as-errors with GCC 11 #819

Merged
merged 1 commit into from
May 28, 2024
Merged
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
64 changes: 28 additions & 36 deletions src/hotspot/cpu/riscv/nativeInst_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,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 @@ -364,16 +360,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 @@ -383,55 +379,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 @@ -462,9 +456,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
Original file line number Diff line number Diff line change
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
Loading