Skip to content

Commit 37363d5

Browse files
fabiobaltierinashif
authored andcommitted
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: Wilfried Chauveau <[email protected]> Signed-off-by: Fabio Baltieri <[email protected]> (cherry picked from commit 63890e2)
1 parent 8926e65 commit 37363d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/core/cortex_m/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
588588
"bx r4\n" /* We don’t intend to return, so there is no need to link. */
589589
:
590590
: "r" (_main), "r" (stack_ptr)
591-
: "r0", "r1", "r2", "r3", "r4", "ip", "lr");
591+
: "r0", "r1", "r2", "r3", "r4", "ip", "lr", "memory");
592592

593593
CODE_UNREACHABLE;
594594
}

0 commit comments

Comments
 (0)