diff options
-rw-r--r-- | core/cortex-m/panic.c | 13 | ||||
-rw-r--r-- | core/cortex-m0/panic.c | 13 |
2 files changed, 22 insertions, 4 deletions
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c index 248d27f0b7..fd80061b95 100644 --- a/core/cortex-m/panic.c +++ b/core/cortex-m/panic.c @@ -401,8 +401,17 @@ void exception_panic(void) [pstack] "r" (pstack_addr) : /* Constraints protecting these from being clobbered. * Gcc should be using r0 & r12 for pregs and pstack. */ - "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", - "r10", "r11", "cc", "memory" + "r1", "r2", "r3", "r4", "r5", "r6", + /* clang warns that we're clobbering a reserved register: + * inline asm clobber list contains reserved registers: R7 + * [-Werror,-Winline-asm]. The intent of the clobber list is + * to force pregs and pstack to be in R0 and R12, which + * still holds. + */ +#ifndef __clang__ + "r7", +#endif + "r8", "r9", "r10", "r11", "cc", "memory" ); } diff --git a/core/cortex-m0/panic.c b/core/cortex-m0/panic.c index 26447e4b7a..b0fa1f4e1d 100644 --- a/core/cortex-m0/panic.c +++ b/core/cortex-m0/panic.c @@ -163,8 +163,17 @@ void exception_panic(void) [pstack] "r" (pstack_addr) : /* Constraints protecting these from being clobbered. * Gcc should be using r0 & r12 for pregs and pstack. */ - "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", - "r10", "r11", "cc", "memory" + "r1", "r2", "r3", "r4", "r5", "r6", + /* clang warns that we're clobbering a reserved register: + * inline asm clobber list contains reserved registers: R7 + * [-Werror,-Winline-asm]. The intent of the clobber list is + * to force pregs and pstack to be in R0 and R12, which + * still holds. + */ +#ifndef __clang__ + "r7", +#endif + "r8", "r9", "r10", "r11", "cc", "memory" ); } |