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

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Sat Oct 10 17:01:42 PDT 2015


On Sat, Oct 10, 2015 at 04:52:57PM -0700, Tim Northover wrote:
> On 10 October 2015 at 14:22, Joerg Sonnenberger via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
> > On Sat, Oct 10, 2015 at 02:17:38PM -0700, Michael Zolotukhin via cfe-dev wrote:
> >> it looks like you relatively recently touched code in
> >> enforceKnownAlignment. Could you please comment on whether it’s correct
> >> behavior or not?
> >
> > This looks entirely correct to me as long as PrefAlign <= 16 for AMD64.
> 
> I'm not so sure, especially when we get to other targets that don't
> have the special AMD64 rule about objects > 16 bytes in size getting
> that alignment.

So there are two slightly different things here. I think we should be
able to raise the alignment of global objects, independently of what the
platform ABI says. Now on the specific case of AMD64, there is a
separate ABI rule which makes this a correct transform.

> It seems that the way ELF's R_..._COPY relocations work make an
> externally visible object's alignment part of a .so's ABI whether we
> like it or not. I just don't see a way around that which allows us to
> increase it at the moment.

The strange part is that noone seems to be observing this outside
FreeBSD, which has a pretty ancient ld. What I don't know is where ld
*is* picking up the 64bit alignment from.

Joerg



More information about the cfe-dev mailing list