[cfe-dev] libc++ std::cout alignment trouble (was: Re: [llvm] r240144 - [SLP] Vectorize for all-constant entries.)

Ed Maste via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 14 14:44:25 PDT 2015


On 14 October 2015 at 16:48, Tim Northover <t.p.northover at gmail.com> wrote:
>>
>> So there is something going on in llvm that bumps up the alignment, for
>> some reason, related to r240144.  I would like to either revert that
>> behavior, or try to find a way to work around it (except from reverting
>> r240144, that is).
>
> Reverting that revision would just be hiding the underlying issue;
> completely the wrong thing to do on trunk.

Right, we need to find the root cause. For now Dimitry has reverted
r240144 in the FreeBSD tree to work around the issue, but we need to
replace it with a real fix.

>> P.S.: In hindsight, specifying an explicit alignment for std::cout etc
>> was maybe not so handy.  But it's too late to change now, without
>> breaking the libc++ ABI...
>
> It's impossible to do otherwise (and maintain our cunning lazy
> initialization). Other places are using std::cout as an ostream, which
> has an ABI-required alignment of (at least) 8.

I'm a bit confused about where the bug actually is though. As I
understand it, the alignment attribute specifies the minimum
alignment, and the cunning char array trick actually imposes a 16-byte
ABI alignment. If so then I'd say the bug is libc++'s.



More information about the cfe-dev mailing list