From ace4469fc40b7b4e03352c165c5069878de9b274 Mon Sep 17 00:00:00 2001 From: Francesco Conti Date: Fri, 31 Jan 2025 21:16:05 +0100 Subject: [PATCH] Add -fno-tree-loop-distribute-patterns to avoid spurious memset --- rules/pulpos/targets/pulpissimo.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rules/pulpos/targets/pulpissimo.mk b/rules/pulpos/targets/pulpissimo.mk index 510b6fb..7eb0f2f 100644 --- a/rules/pulpos/targets/pulpissimo.mk +++ b/rules/pulpos/targets/pulpissimo.mk @@ -34,7 +34,12 @@ PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9 PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9 endif +# without -fno-tree-loop-distribute-patterns, gcc would insert memset & co where it shouldn't! only avoid this option in CV32E40X+LLVM +ifdef USE_CV32E40X PULP_CFLAGS += -fdata-sections -ffunction-sections -include chips/pulpissimo/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo +else +PULP_CFLAGS += -fno-tree-loop-distribute-patterns -fdata-sections -ffunction-sections -include chips/pulpissimo/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo +endif PULP_OMP_CFLAGS += -fopenmp -mnativeomp PULP_CC ?= riscv32-unknown-elf-gcc