[PATCH] D36562: [Bitfield] Make the bitfield a separate location if it has width of legal integer type and its bit offset is naturally aligned for the type

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 4 01:57:27 PDT 2017


On Sun, Sep 3, 2017 at 10:41 PM Hal Finkel via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Nevertheless, I think that you've convinced me that this is a least-bad
> solution. I'll want a flag preserving the old behavior. Something like
> -fwiden-bitfield-accesses (modulo bikeshedding).
>
Several different approaches have been discussed in this thread, I'm not
sure what you mean about "least-bad solution"...

I remain completely unconvinced that we should change the default behavior.
At most, I'm not strongly opposed to adding an attribute that indicates
"please try to use narrow loads for this bitfield member" and is an error
if applied to a misaligned or non-byte-sized bitfield member. But I remain
strongly opposed to changing the default behavior. We have one or two cases
that regress and are easily addressed by source changes (either to not use
bitfields or to use an attribute). I don't think that is cause to change
the lowering Clang has used for years and potentially regress many other
use cases.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170904/81f81038/attachment.html>


More information about the cfe-commits mailing list