[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] perf/x86/intel: Mark expected switch fall-throughs
On Tue, Jun 25, 2019 at 5:47 AM Miguel Ojeda
<> wrote:
> On Tue, Jun 25, 2019 at 9:19 AM Peter Zijlstra <> wrote:
> >
> > Can it build a kernel without patches yet? That is, why should I care
> > what LLVM does?

Unreleased versions of Clang built from source can; the latest release
of Clang-8 doesn't have asm goto support required for
CONFIG_JUMP_LABEL. Things can get complicated based on which kernel
tree/branch (mainline, -next, stable), arch, and configs, but I think
we just have a few long tail bugs left.

We're currently planning multiple output constraint support w/ asm
goto, and have recently implemented things like
__GCC_ASM_FLAG_OUTPUTS__. If there's other features that we should
start implementing, please let us know.

Give it a shot and let us know what works or doesn't.

For more info, see our
Bug tracker:

Or reach out to us via
irc: #clangbuiltlinux on
or attend our public bi-weekly (once ever 2 weeks, not twice a week) meeting

> Having more than a single compiler is always a good idea. You benefit
> from more warnings, more tooling, a second implementation for
> reference/comparison, etc.
> As for what is the current state, I think they are close, specially
> for aarch64, but I let Nick, Nathan et. al. answer that! :-) (Cc'd).
> They had a talk in FOSDEM 2019 about it, too.
> Also CC'ing Luc since he changed sparse to stop ignoring the attribute
> so that __has_attribute() would work, but I am not sure if there has
> been further work on supporting it properly.
> > > Also note that C2x may get [[fallthrough]]. See N2267 and N2335. At
> > > that point, surely tools/IDEs/analyzers will support it :-) The
> > > question is whether we want to wait that long to replace the comments.
> >
> > #define __fallthrough [[fallthrough]]
> >
> > right?
> Yes and no. The exact spelling we use does not matter much. My point
> with that paragraph was that since C2x will (maybe) add fallthrough,
> as C++17 did, every compiler/analyzer/IDE/etc. that is still missing
> support for it will have to eventually add it even if they ignore GNU
> attributes. At that point, I would guess most will likely add all
> spellings too.

Regarding __attribute__((fallthrough)), it's currently a work in
progress in Clang:

~Nick Desaulniers

 \ /
  Last update: 2019-06-25 20:16    [W:0.129 / U:3.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site