Skip to content

Commit d683848

Browse files
committed
Fix compiler error with JIT when EXT_M is disabled
When using 'make ENABLE_EXT_M=0 ENABLE_JIT=1', the following error is observed: src/jit.c:1693:13: error: ‘ra_load2_sext’ defined but not used [-Werror=unused-function] 1693 | static void ra_load2_sext(struct jit_state *state, | ^~~~~~~~~~~~~ Fix this by guarding the ra_load2_sext function definition with RV32_HAS(EXT_M) macro. This ensures the function is only defined when the M extension is enabled.
1 parent d0f0f9d commit d683848

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/jit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ static void ra_load2(struct jit_state *state, int vm_reg_idx1, int vm_reg_idx2)
16901690
offsetof(riscv_t, X) + 4 * vm_reg_idx2);
16911691
}
16921692

1693+
#if RV32_HAS(EXT_M)
16931694
static void ra_load2_sext(struct jit_state *state,
16941695
int vm_reg_idx1,
16951696
int vm_reg_idx2,
@@ -1733,6 +1734,7 @@ static void ra_load2_sext(struct jit_state *state,
17331734
offsetof(riscv_t, X) + 4 * vm_reg_idx2);
17341735
}
17351736
}
1737+
#endif
17361738

17371739
void parse_branch_history_table(struct jit_state *state, rv_insn_t *ir)
17381740
{

0 commit comments

Comments
 (0)