GCC/Clang: cope with __set_CPSR changing condition codes
Add a "cc" clobber to __set_CPSR to reflect the fact that it could be
changing the condition codes.
diff --git a/CMSIS/Core_A/Include/cmsis_armclang.h b/CMSIS/Core_A/Include/cmsis_armclang.h
index a8a67ba..c9479e4 100644
--- a/CMSIS/Core_A/Include/cmsis_armclang.h
+++ b/CMSIS/Core_A/Include/cmsis_armclang.h
@@ -398,7 +398,7 @@
*/
__STATIC_FORCEINLINE void __set_CPSR(uint32_t cpsr)
{
-__ASM volatile ("MSR cpsr, %0" : : "r" (cpsr) : "memory");
+__ASM volatile ("MSR cpsr, %0" : : "r" (cpsr) : "cc", "memory");
}
/** \brief Get Mode
diff --git a/CMSIS/Core_A/Include/cmsis_gcc.h b/CMSIS/Core_A/Include/cmsis_gcc.h
index 1b9194b..3c9bdfb 100644
--- a/CMSIS/Core_A/Include/cmsis_gcc.h
+++ b/CMSIS/Core_A/Include/cmsis_gcc.h
@@ -637,7 +637,7 @@
*/
__STATIC_FORCEINLINE void __set_CPSR(uint32_t cpsr)
{
-__ASM volatile ("MSR cpsr, %0" : : "r" (cpsr) : "memory");
+__ASM volatile ("MSR cpsr, %0" : : "r" (cpsr) : "cc", "memory");
}
/** \brief Get Mode