Re: [C++ patch] Reduce vtable alignment

2014-05-23 Thread Jason Merrill
On 05/23/2014 01:30 PM, Jan Hubicka wrote: Vtables are always accessed via the vtbl pointer otherwise (that is almost always misaligned because of the offset to RTTI pointer), so for vtables static to given compilation unit, there is no way other compiler can derive the alignment based on ABI pro

Re: [C++ patch] Reduce vtable alignment

2014-05-23 Thread Jan Hubicka
Hi, I would like to ping these two patches. If we conclude it is absolutely unsafe to not align virtual tables to 16byte boundary (that is an x86_64 ABI requirement for array datastructures but I would like to argue that vtables are compiler controlled ones and do not need to follow ABI here), I ca

Re: [C++ patch] Reduce vtable alignment

2014-05-19 Thread Jan Hubicka
> > Hmm, but if the optimizers or the target can rely on DATA_ABI_ALIGNMENT > > then we can't really lower it. Because we can make the vtable escape > > to another unit that sees it as just an array of pointers? > > Sure, they can rely on DATA_ABI_ALIGNMENT (if that macro is defined), but > anyth

Re: [C++ patch] Reduce vtable alignment

2014-05-19 Thread Jakub Jelinek
On Mon, May 19, 2014 at 10:52:52AM +0200, Richard Biener wrote: > On Fri, May 16, 2014 at 9:12 PM, Jan Hubicka wrote: > > this patch makes also the rtti type info for A in the testcase: > > > > struct A > > { > > virtual void foo(void) {}; > > virtual void foo2(void) {}; > > virtual void foo

Re: [C++ patch] Reduce vtable alignment

2014-05-19 Thread Richard Biener
On Fri, May 16, 2014 at 9:12 PM, Jan Hubicka wrote: > Hi, > this patch makes also the rtti type info for A in the testcase: > > struct A > { > virtual void foo(void) {}; > virtual void foo2(void) {}; > virtual void foo3(void) {}; > virtual void foo4(void) {}; > virtual void foo5(void) {}

Re: [C++ patch] Reduce vtable alignment

2014-05-16 Thread Jan Hubicka
Hi, this patch makes also the rtti type info for A in the testcase: struct A { virtual void foo(void) {}; virtual void foo2(void) {}; virtual void foo3(void) {}; virtual void foo4(void) {}; virtual void foo5(void) {}; } a; aligned only to the ABI requirement (8) instead of being bumped

[C++ patch] Reduce vtable alignment

2014-05-16 Thread Jan Hubicka
Hi, compiling: struct A { virtual void foo(void) {}; virtual void foo2(void) {}; virtual void foo3(void) {}; virtual void foo4(void) {}; virtual void foo5(void) {}; } a; give 32 byte alignment to the virtual table on i386, because we bump up alignments of arrays to size of vector operat