Commit 63890e25 authored by Fabio Baltieri's avatar Fabio Baltieri Committed by Mahesh Mahadevan
Browse files

arch: arm: cortex_m: add memory to the clobber list



Add "memory" to the clobber list"

From GCC 14 the compiler optimizes away memory accesses that do not
impact the asm block. Adding the memory to the clobber list lets the
compiler know that the memory state is to be preserved.

Signed-off-by: default avatarWilfried Chauveau <wilfried.chauveau@arm.com>
Signed-off-by: default avatarFabio Baltieri <fabiobaltieri@google.com>
parent 7015a0ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
	"bx    r4\n"		/* We don’t intend to return, so there is no need to link. */
	:
	: "r" (_main), "r" (stack_ptr)
	: "r0", "r1", "r2", "r3", "r4", "ip", "lr");
	: "r0", "r1", "r2", "r3", "r4", "ip", "lr", "memory");

	CODE_UNREACHABLE;
}