Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-10 Thread Russell King - ARM Linux admin
On Wed, Jul 10, 2019 at 10:33:31AM +0200, Arnd Bergmann wrote: > On Wed, Jul 10, 2019 at 12:25 AM Russell King - ARM Linux admin > wrote: > > > > On Tue, Jul 09, 2019 at 08:40:51PM +0200, Arnd Bergmann wrote: > > > On Tue, Jul 9, 2019 at 8:08 PM 'Nick Desaulniers' via Clang Built > > > Linux wrot

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-10 Thread Arnd Bergmann
On Wed, Jul 10, 2019 at 12:25 AM Russell King - ARM Linux admin wrote: > > On Tue, Jul 09, 2019 at 08:40:51PM +0200, Arnd Bergmann wrote: > > On Tue, Jul 9, 2019 at 8:08 PM 'Nick Desaulniers' via Clang Built > > Linux wrote: > > > On Tue, Jul 9, 2019 at 1:41 AM Linus Walleij > > > wrote: > > >

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Russell King - ARM Linux admin
On Tue, Jul 09, 2019 at 08:40:51PM +0200, Arnd Bergmann wrote: > On Tue, Jul 9, 2019 at 8:08 PM 'Nick Desaulniers' via Clang Built > Linux wrote: > > On Tue, Jul 9, 2019 at 1:41 AM Linus Walleij > > wrote: > > > > > I guess this brings up the old question whether the compiler should > > > be wor

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Arnd Bergmann
On Tue, Jul 9, 2019 at 8:08 PM 'Nick Desaulniers' via Clang Built Linux wrote: > On Tue, Jul 9, 2019 at 1:41 AM Linus Walleij wrote: > > > I guess this brings up the old question whether the compiler should > > be worked around or just considered immature, but as it happens this > > Definitely a

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Nick Desaulniers
On Tue, Jul 9, 2019 at 5:26 AM Russell King - ARM Linux admin wrote: > > On Tue, Jul 09, 2019 at 02:17:58PM +0200, Linus Walleij wrote: > > On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann wrote: > > > > > -#define xip_iprefetch()do { asm volatile (".rep 8; nop; .endr"); > > > } while (0) >

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Nick Desaulniers
On Tue, Jul 9, 2019 at 1:41 AM Linus Walleij wrote: > > On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann wrote: > > > llvm gets confused by inline asm with .rep directives, > > Are the LLVM developers aware of the bug? > It seems like something we can work around but should > eventually be fixed pro

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Russell King - ARM Linux admin
On Tue, Jul 09, 2019 at 02:17:58PM +0200, Linus Walleij wrote: > On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann wrote: > > > -#define xip_iprefetch()do { asm volatile (".rep 8; nop; .endr"); } > > while (0) > > +#define xip_iprefetch()do { >

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Linus Walleij
On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann wrote: > -#define xip_iprefetch()do { asm volatile (".rep 8; nop; .endr"); } > while (0) > +#define xip_iprefetch()do { > \ > +asm volatile ("nop; nop; nop; nop; nop; nop; nop; nop;"

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Linus Walleij
On Tue, Jul 9, 2019 at 11:17 AM Russell King - ARM Linux admin wrote: > On Tue, Jul 09, 2019 at 10:41:05AM +0200, Linus Walleij wrote: > > I guess this brings up the old question whether the compiler should > > be worked around or just considered immature, but as it happens this > > other day I wa

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Russell King - ARM Linux admin
On Tue, Jul 09, 2019 at 10:41:05AM +0200, Linus Walleij wrote: > I guess this brings up the old question whether the compiler should > be worked around or just considered immature, but as it happens this > other day I was grep:ing around to find "the 8 NOP" that is so > compulsively inserted in ARM

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-09 Thread Linus Walleij
On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann wrote: > llvm gets confused by inline asm with .rep directives, Are the LLVM developers aware of the bug? It seems like something we can work around but should eventually be fixed properly in LLVM, right? > which > can lead to miscalculating the num

Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-08 Thread Nick Desaulniers
On Mon, Jul 8, 2019 at 1:31 PM Arnd Bergmann wrote: > > llvm gets confused by inline asm with .rep directives, which > can lead to miscalculating the number of instructions inside it, > and in turn lead to an overflow for relative address calculation: > > /tmp/cfi_cmdset_0002-539a47.s: Assembler m

[PATCH] ARM: mtd-xip: work around clang/llvm bug

2019-07-08 Thread Arnd Bergmann
llvm gets confused by inline asm with .rep directives, which can lead to miscalculating the number of instructions inside it, and in turn lead to an overflow for relative address calculation: /tmp/cfi_cmdset_0002-539a47.s: Assembler messages: /tmp/cfi_cmdset_0002-539a47.s:11288: Error: bad immedia