Re: [PATCH 0/2] Kconfig: -O3 enablement

From: Arnd Bergmann
Date: Thu Jun 23 2022 - 14:28:49 EST


On Wed, Jun 22, 2022 at 3:57 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> On Wed, Jun 22, 2022 at 1:17 AM Nick Desaulniers <ndesaulniers@xxxxxxxxxx> wrote:
> >
> > On Tue, Jun 21, 2022 at 6:35 AM Miko Larsson <mikoxyzzz@xxxxxxxxx> wrote:
> > >
> > > Hi,
> > >
> > > This very small series allows -O3 to be used for all architectures. The
> > > first patch marks -O3 as experimental, with the reasoning being that it
> > > might expose unwanted regressions to users, and the second patch
> > > actually allows -O3 by removing the "depend on ARC" string.
> >
> > I think we should just remove -O3 support from KCONFIG.

I agree that would be best

> > If someone wants to mess around with "experimental features," there's
> > nothing stopping you from doing:
> >
> > $ make KCFLAGS=-O3
> >
>
> ARC uses -O3 since day1.
>
> "Generic build system uses -O2, we want -O3"
> in commit cfdbc2e16e65c1ec1c23057640607cee98d1a1bd
>
> If they want -O3, it is up to the ARC maintainer.

I suppose whatever the reason for using -O3 at the time has
likely changed by now.

> If you want to say "use this option carefully",
> EXPERT might be another option.
>
> depends on ARC || EXPERT

This probably also needs a dependency on !COMPILE_TEST so we don't
report compile-time problems that are specific to -O3. Maybe a good first
step would be to turn this into

depends on ARCH && EXPERT && !COMPILE_TEST

which should help both with compile-testing on ARC, and it would
prevent it from being visible on other architectures.

Arnd