From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: <clang-built-linux@googlegroups.com>,
<andriy.shevchenko@intel.com>, <bp@alien8.de>,
<dan.j.williams@intel.com>, <linux-kernel@vger.kernel.org>,
<linux@rasmusvillemoes.dk>, <mingo@redhat.com>,
<peterz@infradead.org>, <tglx@linutronix.de>, <x86@kernel.org>,
<ilie.halip@gmail.com>, <natechancellor@gmail.com>
Subject: Re: [PATCH v6 1/2] x86: fix bitops.h warning with a moved cast
Date: Mon, 4 May 2020 18:14:43 -0700 [thread overview]
Message-ID: <20200504181443.00007a3d@intel.com> (raw)
In-Reply-To: <20200504193524.GA221287@google.com>
On Mon, 4 May 2020 12:51:12 -0700
Nick Desaulniers <ndesaulniers@google.com> wrote:
> Sorry for the very late report. It turns out that if your config
> tickles __builtin_constant_p just right, this now produces invalid
> assembly:
>
> $ cat foo.c
> long a(long b, long c) {
> asm("orb\t%1, %0" : "+q"(c): "r"(b));
> return c;
> }
> $ gcc foo.c
> foo.c: Assembler messages:
> foo.c:2: Error: `%rax' not allowed with `orb'
>
> The "q" constraint only has meanting on -m32 otherwise is treated as
> "r".
>
> Since we have the mask (& 0xff), can we drop the `b` suffix from the
> instruction? Or is a revert more appropriate? Or maybe another way to
> skin this cat?
Figures that such a small change can create problems :-( Sorry for the
thrash!
The patches in the link below basically add back the cast, but I'm
interested to see if any others can come up with a better fix that
a) passes the above code generation test
b) still keeps sparse happy
c) passes the test module and the code inspection
If need be I'm OK with a revert of the original patch to fix the issue
in the short term, but it seems to me there must be a way to satisfy
both tools. We went through several iterations on the way to the final
patch that we might be able to pluck something useful from.
> Link: https://github.com/ClangBuiltLinux/linux/issues/961
> This is blowing up our KernelCI reports.
ASIDE:
Bummer, how come none of those KernelCI reports are part of
zero-day testing at https://01.org/lkp/documentation/0-day-test-service
I'm interested in your answer but don't want to pollute this thread,
feel free to contact me directly for this one or start a new thread?
next prev parent reply other threads:[~2020-05-05 1:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 22:17 [PATCH v6 1/2] x86: fix bitops.h warning with a moved cast Jesse Brandeburg
2020-03-10 22:17 ` [PATCH v6 2/2] lib: make a test module with set/clear bit Jesse Brandeburg
2020-04-15 14:46 ` Andy Shevchenko
2020-03-11 4:37 ` [PATCH v6 1/2] x86: fix bitops.h warning with a moved cast Luc Van Oostenryck
2020-03-17 19:25 ` Peter Zijlstra
2020-03-18 21:59 ` [tip: x86/asm] x86: Fix " tip-bot2 for Jesse Brandeburg
2020-05-04 19:37 ` [PATCH v6 1/2] x86: fix " Nick Desaulniers
2020-05-05 1:14 ` Jesse Brandeburg [this message]
2020-05-05 15:14 ` Andy Shevchenko
2020-05-05 17:29 ` Nick Desaulniers
2020-05-05 17:47 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200504181443.00007a3d@intel.com \
--to=jesse.brandeburg@intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=dan.j.williams@intel.com \
--cc=ilie.halip@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mingo@redhat.com \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.