This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] Reduce vtable alignment
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Fri, 23 May 2014 19:30:25 +0200
- Subject: Re: [C++ patch] Reduce vtable alignment
- Authentication-results: sourceware.org; auth=none
- References: <20140516180442 dot GI20755 at kam dot mff dot cuni dot cz> <20140516191242 dot GA10833 at kam dot mff dot cuni dot cz> <CAFiYyc3S1TpPa8rM-yZn=e9ykkxj_T_kGNn5PzLQG=G-k4ZsAg at mail dot gmail dot com>
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 can add a code
to while program visibility pass to bump up alignment of vtables that are
externally visible.
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 promises. This would save the data segment size more progressively
at least for -flto.
Honza