[libcpu][arm] ArmClang 编译优化错误 (#6071)

This commit is contained in:
JonasWen 2022-06-15 17:19:51 +08:00 committed by GitHub
parent ccbecfc220
commit b010e434ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,7 @@
* 2013-06-23 aozima support lazy stack optimized.
* 2018-07-24 aozima enhancement hard fault exception handler.
* 2019-07-03 yangjie add __rt_ffs() for armclang.
* 2022-06-12 jonas fixed __rt_ffs() for armclang.
*/
#include <rtthread.h>
@ -473,12 +474,12 @@ exit
int __rt_ffs(int value)
{
__asm volatile(
"CMP r0, #0x00 \n"
"CMP %0, #0x00 \n"
"BEQ 1f \n"
"RBIT r0, r0 \n"
"CLZ r0, r0 \n"
"ADDS r0, r0, #0x01 \n"
"RBIT %0, %0 \n"
"CLZ %0, %0 \n"
"ADDS %0, %0, #0x01 \n"
"1: \n"