Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-15 Thread Herbert Xu
On Tue, May 05, 2020 at 03:53:45PM +0200, Arnd Bergmann wrote: > 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: > >

Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-08 Thread Nathan Chancellor
On Fri, May 08, 2020 at 11:31:07PM +0200, Arnd Bergmann wrote: > On Wed, May 6, 2020 at 7:12 AM Nathan Chancellor > wrote: > > > - > > > +#ifdef CONFIG_CC_IS_CLANG > > > > Given your comment in the bug: > > > > "The code is written to assume no loops are unrolled" > > > > Does it make sense to

Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-08 Thread Arnd Bergmann
On Wed, May 6, 2020 at 7:12 AM Nathan Chancellor wrote: > > - > > +#ifdef CONFIG_CC_IS_CLANG > > Given your comment in the bug: > > "The code is written to assume no loops are unrolled" > > Does it make sense to make this unconditional and take compiler > heuristics out of it? > > > +#pragma

Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-05 Thread Nathan Chancellor
On Tue, May 05, 2020 at 03:53:45PM +0200, Arnd Bergmann wrote: > 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: > >

[PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-05 Thread Arnd Bergmann
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'