stephen lu <lumotuwe@xxxxxxxxx> writes: [...] > This is safe by adding "memory" Clobber . > asm volatile("mrs r12, cpsr\n\t" > "orr r12, r12, #0xC0\n\t" > "msr cpsr_c, r12\n\t" :: : "r12", "cc", "memory"); > c *= b; /* This is safe. */ > asm volatile("mrs r12, cpsr\n" > "bic r12, r12, #0xC0\n" > "msr cpsr_c, r12" ::: "r12", "cc", "memory"); Try this: asm volatile("mrs r12, cpsr\n\t" "orr r12, r12, #0xC0\n\t" "msr cpsr_c, r12\n\t" :: : "r12", "cc", "memory"); *(int volatile *) &c *= *(int volatile *) &b; asm volatile("mrs r12, cpsr\n" "bic r12, r12, #0xC0\n" "msr cpsr_c, r12" ::: "r12", "cc", "memory"); HTH -- Sergey