From cde87e7c213f037c4eb71c865c4ed01b2473b932 Mon Sep 17 00:00:00 2001 From: ktietz Date: Fri, 28 Dec 2012 21:49:59 +0000 Subject: [PATCH] * rtti.c (LONGPTR_T): New helper-macro. (get_pseudo_ti_init): Initialize offset_type by LONGPTR_T type instead of 'long' type. (create_tinfo_types): Use for offset/flags field LONGPTR_T type instead of 'long' type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194745 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/rtti.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f6abef636826..a57051ebf5fa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2012-12-28 Kai Tietz + + * rtti.c (LONGPTR_T): New helper-macro. + (get_pseudo_ti_init): Initialize offset_type by LONGPTR_T + type instead of 'long' type. + (create_tinfo_types): Use for offset/flags field LONGPTR_T + type instead of 'long' type. + 2012-12-19 Jason Merrill PR c++/55724 diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index b13ec171bbb2..de28371c6796 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -89,6 +89,12 @@ typedef enum tinfo_kind /* ... abi::__vmi_type_info */ } tinfo_kind; +/* Helper macro to get maximum scalar-width of pointer or of the 'long'-type. + This of interest for llp64 targets. */ +#define LONGPTR_T \ + integer_types[(POINTER_SIZE <= TYPE_PRECISION (integer_types[itk_long]) \ + ? itk_long : itk_long_long)] + /* A vector of all tinfo decls that haven't yet been emitted. */ vec *unemitted_tinfo_decls; @@ -1116,7 +1122,7 @@ get_pseudo_ti_init (tree type, unsigned tk_index) tree binfo = TYPE_BINFO (type); int nbases = BINFO_N_BASE_BINFOS (binfo); vec *base_accesses = BINFO_BASE_ACCESSES (binfo); - tree offset_type = integer_types[itk_long]; + tree offset_type = LONGPTR_T; tree base_inits = NULL_TREE; int ix; vec *init_vec = NULL; @@ -1420,7 +1426,7 @@ create_tinfo_types (void) fields = field; field = build_decl (BUILTINS_LOCATION, - FIELD_DECL, NULL_TREE, integer_types[itk_long]); + FIELD_DECL, NULL_TREE, LONGPTR_T); DECL_CHAIN (field) = fields; fields = field; -- 2.47.2