Re: [PATCH RFC v2 02/25] stackdepot: prevent Clang from optimizing away stackdepot_memcmp()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 7, 2019 at 10:46 AM Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> wrote:
> On 11/7/19 12:22 PM, Alexander Potapenko wrote:
> > On Thu, Nov 7, 2019 at 10:04 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> >> On Thu, Nov 7, 2019 at 7:08 AM Sergey Senozhatsky
> >> <sergey.senozhatsky.work@xxxxxxxxx> wrote:
> >> The normal way to do a volatile access would be
> >> READ_ONCE()/WRITE_ONCE(), but that seems stronger than
> >> the barrier() here. I'd just stick to adding a barrier.
> > I actually like the READ_ONCE idea more, as READ_ONCE is really a
> > documented way to prevent the compiler from merging reads, which is
> > what we want here.
>
> I would rather go with -fno-builtin-bcmp or maybe even -fno-builtin if that works.

The commit message for 5f074f3e192f ("lib/string.c: implement a basic bcmp")
mentions that  -fno-builtin-bcmp did not work for LTO when the global bcmp()
help was added. I don't know whether the same applies here, but my guess is
that it's the same issue.

      Arnd




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux