From a1d1ddc57409dd6e5dd73233d76ecc2ab019a0c1 Mon Sep 17 00:00:00 2001 From: Kuan-Wei Chiu Date: Tue, 7 May 2024 13:06:54 +0800 Subject: [PATCH 1/2] Fix compilation errors when ARCH=riscv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ARCH=riscv, the following compilation errors occur: In file included from src/main.c:41: src/codegen.c: In function ‘cfg_flatten’: src/codegen.c:111:9: error: ‘flatten_ir’ undeclared (first use in this function); did you mean ‘fflatten_ir’? 111 | flatten_ir->src0 = fn->func->stack_size; | ^~~~~~~~~~ | fflatten_ir src/codegen.c:111:9: note: each undeclared identifier is reported only once for each function it appears in src/codegen.c:110:19: warning: unused variable ‘fflatten_ir’ [-Wunused-variable] 110 | ph2_ir_t *fflatten_ir = add_ph2_ir(OP_define); | ^~~~~~~~~~~ Fix the erroneous variable name 'fflatten_ir' to 'flatten_ir' to avoid compilation errors. Fixes: 7f328f33a97d ("Apply editorial changes") --- src/riscv-codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riscv-codegen.c b/src/riscv-codegen.c index da9c5ef1..aa6b55cf 100644 --- a/src/riscv-codegen.c +++ b/src/riscv-codegen.c @@ -107,7 +107,7 @@ void cfg_flatten() for (fn_t *fn = FUNC_LIST.head; fn; fn = fn->next) { /* reserve stack */ - ph2_ir_t *fflatten_ir = add_ph2_ir(OP_define); + ph2_ir_t *flatten_ir = add_ph2_ir(OP_define); flatten_ir->src0 = fn->func->stack_size; for (basic_block_t *bb = fn->bbs; bb; bb = bb->rpo_next) { From 8982f0ab12d2a7b3b2843b79d14691ea0c1c8dd7 Mon Sep 17 00:00:00 2001 From: Kuan-Wei Chiu Date: Tue, 7 May 2024 13:04:56 +0800 Subject: [PATCH 2/2] CI: Fix ARCH=riscv was not tested The 'make clean' command does not delete config files. This led to an issue during testing with ARCH=riscv, where 'make' used the ARCH=arm config because the config file already existed. Consequently, ARCH=arm was tested twice while ARCH=riscv wasn't tested at all. The fix involves changing 'make clean' to 'make distclean' to ensure that ARCH=riscv undergoes complete testing. --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3113ff21..5c3f5212 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,9 +21,9 @@ jobs: sudo apt-get install -q -y build-essential make clean config make check-snapshots || exit 1 - make clean config ARCH=arm + make distclean config ARCH=arm make check || exit 1 - make clean config ARCH=riscv + make distclean config ARCH=riscv make check || exit 1 host-arm: