summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-05-05 15:53:45 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-15 16:15:00 +1000
commit069138d6476bc303313c4d36a57b90dc67345b49 (patch)
tree1395fbed1e1491728c865500fcdb25942c59506a
parent2fa2819f65ad2767da848dceeed7cb44e34595e1 (diff)
downloadlinux-crypto-069138d6476bc303313c4d36a57b90dc67345b49.tar.gz
linux-crypto-069138d6476bc303313c4d36a57b90dc67345b49.zip
crypto: blake2b - Fix clang optimization for ARMv7-M
When building for ARMv7-M, clang-9 or higher tries to unroll some loops, which ends up confusing the register allocator to the point of generating rather bad code and using more than the warning limit for stack frames: warning: stack frame size of 1200 bytes in function 'blake2b_compress' [-Wframe-larger-than=] Forcing it to not unroll the final loop avoids this problem. Fixes: 3c197bb20a97 ("crypto: blake2b - add blake2b generic implementation") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/blake2b_generic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/blake2b_generic.c b/crypto/blake2b_generic.c
index 1d262374..0ffd8d92 100644
--- a/crypto/blake2b_generic.c
+++ b/crypto/blake2b_generic.c
@@ -129,7 +129,9 @@ static void blake2b_compress(struct blake2b_state *S,
ROUND(9);
ROUND(10);
ROUND(11);
-
+#ifdef CONFIG_CC_IS_CLANG
+#pragma nounroll /* https://bugs.llvm.org/show_bug.cgi?id=45803 */
+#endif
for (i = 0; i < 8; ++i)
S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
}