From aeed25a6c76cba8822bb42829d721134bbda6208 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sat, 24 May 2014 01:42:22 +0000 Subject: [PATCH] * rtti.c: Include tm_p.h (emit_tinfo_decl): Force RTTI data to be aligned to required ABI alignment only. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210887 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/rtti.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5f6ee37..2cfc428 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2014-05-23 Jan Hubicka + * rtti.c: Include tm_p.h + (emit_tinfo_decl): Force RTTI data to be aligned to required + ABI alignment only. + +2014-05-23 Jan Hubicka + * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN ignoring other target adjustments. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index e9e2c44..b665a8d 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "tm_p.h" #include "stringpool.h" #include "stor-layout.h" #include "cp-tree.h" @@ -1596,6 +1597,12 @@ emit_tinfo_decl (tree decl) DECL_INITIAL (decl) = init; mark_used (decl); cp_finish_decl (decl, init, false, NULL_TREE, 0); + /* Avoid targets optionally bumping up the alignment to improve + vector instruction accesses, tinfo are never accessed this way. */ +#ifdef DATA_ABI_ALIGNMENT + DECL_ALIGN (decl) = DATA_ABI_ALIGNMENT (decl, TYPE_ALIGN (TREE_TYPE (decl))); + DECL_USER_ALIGN (decl) = true; +#endif return true; } else -- 2.7.4