Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-05-05 Thread Heiko Carstens
On Mon, May 03, 2021 at 10:41:45AM -0700, Linus Torvalds wrote: > It would be lovely if somebody also took a look at some of the other > zlib code, like inflate.c itself. But some of that code has rather > subtle changes for things like s390 hardware support, and we have > thihngs like our fallthro

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-05-03 Thread Vineet Gupta
On 5/3/21 10:41 AM, Linus Torvalds wrote: > On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta > wrote: >> I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 >> causing wrong codegen. > So it does seem to be a gcc bug or at least mis-feature where gcc gets > the aliasing decision wro

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-05-03 Thread Linus Torvalds
On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta wrote: > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > causing wrong codegen. So it does seem to be a gcc bug or at least mis-feature where gcc gets the aliasing decision wrong when vectorizing the code. That said, the fact

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-05-01 Thread Oleksandr Natalenko
Hello. On Fri, Apr 30, 2021 at 03:06:30PM -0700, Linus Torvalds wrote: > On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta > wrote: > > > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > > causing wrong codegen. > > I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERF

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Vineet Gupta
On 4/30/21 3:06 PM, Linus Torvalds wrote: > On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta > wrote: >> >> I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 >> causing wrong codegen. > > I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERFORMANCE_O3 > entirely. > > The

Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Vineet Gupta
Hi, I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 causing wrong codegen. Config needs to have initramfs + gzip compressed. CONFIG_HAVE_KERNEL_GZIP=y CONFIG_KERNEL_GZIP=y CONFIG_DECOMPRESS_GZIP=y CONFIG_INITRAMFS_COMPRESSION_GZIP=y lib

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Linus Torvalds
On Fri, Apr 30, 2021 at 3:44 PM Vineet Gupta wrote: > > I agree that -O2 is default, but we've had -O3 default for ARC kernel > forever, since last decade seriously. The reason I turned it on back > then was upside of 10% performance improvement on select LMBench numbers > on hardware at the time

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Linus Torvalds
On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta wrote: > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > causing wrong codegen. I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERFORMANCE_O3 entirely. The advantages are very questionable - with a lot of the optimiza