Skip to content

Commit 7922fd8

Browse files
committed
Fix compiler error when MOP_FUSION is disabled
When using 'make ENABLE_MOP_FUSION=0', the following error is observed: src/emulate.c:714:13: error: ‘match_pattern’ defined but not used [-Werror=unused-function] 714 | static void match_pattern(riscv_t *rv, block_t *block) | ^~~~~~~~~~~~~ Fix this by guarding the match_pattern function definition with RV32_HAS(MOP_FUSION) macro. This ensures the function is only defined when the MOP_FUSION is enabled.
1 parent 808d379 commit 7922fd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/emulate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ static inline void remove_next_nth_ir(const riscv_t *rv,
705705
block->n_insn -= n;
706706
}
707707

708+
#if RV32_HAS(MOP_FUSION)
708709
/* Check if instructions in a block match a specific pattern. If they do,
709710
* rewrite them as fused instructions.
710711
*
@@ -802,6 +803,7 @@ static void match_pattern(riscv_t *rv, block_t *block)
802803
}
803804
}
804805
}
806+
#endif
805807

806808
typedef struct {
807809
bool is_constant[N_RV_REGS];

0 commit comments

Comments
 (0)