mn10300: add cc clobbers to asm statements
gcc 4.2.1 for MN10300 is more agressive than the older gcc in reordering/moving other insns between an insn that sets flags and an insn that uses those flags. This leads to trouble with asm statements which are missing an explicit "cc" clobber. This patch adds the explicit "cc" clobber to asm statements which do indeed clobber the condition flags. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
b0641e86fb
commit
d6bb7a1ad3
@@ -165,7 +165,7 @@ static inline __attribute__((const))
|
||||
unsigned long __ffs(unsigned long x)
|
||||
{
|
||||
int bit;
|
||||
asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x));
|
||||
asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x) : "cc");
|
||||
return bit;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ static inline __attribute__((const))
|
||||
int __ilog2_u32(u32 n)
|
||||
{
|
||||
int bit;
|
||||
asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n));
|
||||
asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n) : "cc");
|
||||
return bit;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user