[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210501210337.66qxgomc643lbdyi@spock.localdomain>
Date: Sat, 1 May 2021 23:03:37 +0200
From: Oleksandr Natalenko <oleksandr@...alenko.name>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Vineet Gupta <Vineet.Gupta1@...opsys.com>,
Arnd Bergmann <arnd@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Jann Horn <jannh@...gle.com>,
lkml <linux-kernel@...r.kernel.org>,
arcml <linux-snps-arc@...ts.infradead.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: Heads up: gcc miscompiling initramfs zlib decompression code at
-O3
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 <Vineet.Gupta1@...opsys.com> 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.
FWIW, we used to find real bugs using -O3 in the past [1].
> The advantages are very questionable - with a lot of the optimizations
> at O3 being about loops, something which the kernel to a close
> approximation doesn't have.
>
> Most kernel loops are "count on one hand" iterations, and loop
> optimizations generally just make things worse.
>
> And we've had problems with -O3 before, because not only are the
> optimizations a bit esoteric, they are often relatively untested. If
> you look around at various projects (outside the kernel), -O2 is
> generally the "default".
>
> And that's entirely ignoring the gcc history - where -O3 has often
> been very buggy indeed. It's gotten much better, but I just don't see
> the upside of using -O3.
>
> In fact, it looks like we already have that
>
> depends on ARC
>
> for -O3, exactly because nobody really wants to use this.
>
> So this bug seems to be entirely ARC-specific, in that only ARC can
> use -O3 for the kernel already.
>
> Linus
[1] https://lore.kernel.org/lkml/673b885183fb64f1cbb3ed2387524077@natalenko.name/
--
Oleksandr Natalenko (post-factum)
Powered by blists - more mailing lists