]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Fix bad inline asm constraint in create_zero_mask()
authorAnton Blanchard <anton@samba.org>
Fri, 29 Apr 2016 22:29:27 +0000 (08:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 2 May 2016 01:10:25 +0000 (11:10 +1000)
commit397864c680fa2c6b1218f67c6fa5cc9c0547b2d8
treefabfb14d64976dd601e42038cf3dad800a8bb5d2
parent4c2f7c401e907c8724aed76f0f938d77dcd7af80
powerpc: Fix bad inline asm constraint in create_zero_mask()

In create_zero_mask() we have:

addi %1,%2,-1
andc %1,%1,%2
popcntd %0,%1

using the "r" constraint for %2. r0 is a valid register in the "r" set,
but addi X,r0,X turns it into an li:

li r7,-1
andc r7,r7,r0
popcntd r4,r7

Fix this by using the "b" constraint, for which r0 is not a valid
register.

This was found with a kernel build using gcc trunk, narrowed down to
when -frename-registers was enabled at -O2. It is just luck however
that we aren't seeing this on older toolchains.

Thanks to Segher for working with me to find this issue.

Cc: stable@vger.kernel.org
Fixes: 8d3e5c18f822 ("powerpc: word-at-a-time optimization for 64-bit Little Endian")
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/word-at-a-time.h