rtti.c (get_tinfo_decl): Don't call comdat_linkage.
* cp/rtti.c (get_tinfo_decl): Don't call comdat_linkage. Do set DECL_COMDAT. (synthesize_tinfo_var): Take the public decl. (create_real_tinfo_var): Likewise. Check DECL_COMDAT. (emit_tinfo_decl): Adjust. Call import_export_decl. * cp/decl2.c (import_export_decl): Simplify tinfo decl handling. * config/mips/mips.c (mips_output_external): Don't do sdata optimization for a variable with DECL_COMDAT set. From-SVN: r53506
This commit is contained in:
parent
57cb4fe5b8
commit
ff48be5c79
@ -1,3 +1,8 @@
|
|||||||
|
2002-05-16 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* config/mips/mips.c (mips_output_external): Don't do sdata
|
||||||
|
optimization for a variable with DECL_COMDAT set.
|
||||||
|
|
||||||
2002-05-15 Aldy Hernandez <aldyh@redhat.com>
|
2002-05-15 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
* config/rs6000/altivec.h: Cleanups for tighter typechecking.
|
* config/rs6000/altivec.h: Cleanups for tighter typechecking.
|
||||||
|
@ -6035,6 +6035,7 @@ mips_output_external (file, decl, name)
|
|||||||
|
|
||||||
if (TARGET_GP_OPT
|
if (TARGET_GP_OPT
|
||||||
&& TREE_CODE (decl) != FUNCTION_DECL
|
&& TREE_CODE (decl) != FUNCTION_DECL
|
||||||
|
&& !DECL_COMDAT (decl)
|
||||||
&& (len = int_size_in_bytes (TREE_TYPE (decl))) > 0
|
&& (len = int_size_in_bytes (TREE_TYPE (decl))) > 0
|
||||||
&& ((section_name = DECL_SECTION_NAME (decl)) == NULL
|
&& ((section_name = DECL_SECTION_NAME (decl)) == NULL
|
||||||
|| strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0
|
|| strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2002-05-14 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* rtti.c (get_tinfo_decl): Don't call comdat_linkage.
|
||||||
|
Do set DECL_COMDAT.
|
||||||
|
(synthesize_tinfo_var): Take the public decl.
|
||||||
|
(create_real_tinfo_var): Likewise. Check DECL_COMDAT.
|
||||||
|
(emit_tinfo_decl): Adjust. Call import_export_decl.
|
||||||
|
* decl2.c (import_export_decl): Simplify tinfo decl handling.
|
||||||
|
|
||||||
2002-05-14 Alexandre Oliva <aoliva@redhat.com>
|
2002-05-14 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
* cp-tree.h (struct lang_type): Added non_zero_init.
|
* cp-tree.h (struct lang_type): Added non_zero_init.
|
||||||
|
@ -2509,6 +2509,11 @@ import_export_decl (decl)
|
|||||||
}
|
}
|
||||||
else if (tinfo_decl_p (decl, 0))
|
else if (tinfo_decl_p (decl, 0))
|
||||||
{
|
{
|
||||||
|
/* Here, we only decide whether or not the tinfo node should be
|
||||||
|
emitted with the vtable. The decl we're considering isn't
|
||||||
|
actually the one which gets emitted; that one is generated in
|
||||||
|
create_real_tinfo_var. */
|
||||||
|
|
||||||
tree ctype = TREE_TYPE (DECL_NAME (decl));
|
tree ctype = TREE_TYPE (DECL_NAME (decl));
|
||||||
|
|
||||||
if (IS_AGGR_TYPE (ctype))
|
if (IS_AGGR_TYPE (ctype))
|
||||||
@ -2528,20 +2533,14 @@ import_export_decl (decl)
|
|||||||
&& same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
|
&& same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
|
||||||
{
|
{
|
||||||
DECL_NOT_REALLY_EXTERN (decl)
|
DECL_NOT_REALLY_EXTERN (decl)
|
||||||
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
|
= ! CLASSTYPE_INTERFACE_ONLY (ctype);
|
||||||
|| (DECL_DECLARED_INLINE_P (decl)
|
DECL_COMDAT (decl) = 0;
|
||||||
&& ! flag_implement_inlines
|
|
||||||
&& !DECL_VINDEX (decl)));
|
|
||||||
|
|
||||||
/* Always make artificials weak. */
|
|
||||||
if (flag_weak)
|
|
||||||
comdat_linkage (decl);
|
|
||||||
}
|
}
|
||||||
else if (TYPE_BUILT_IN (ctype)
|
|
||||||
&& same_type_p (ctype, TYPE_MAIN_VARIANT (ctype)))
|
|
||||||
DECL_NOT_REALLY_EXTERN (decl) = 0;
|
|
||||||
else
|
else
|
||||||
comdat_linkage (decl);
|
{
|
||||||
|
DECL_NOT_REALLY_EXTERN (decl) = 1;
|
||||||
|
DECL_COMDAT (decl) = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
comdat_linkage (decl);
|
comdat_linkage (decl);
|
||||||
|
@ -59,7 +59,7 @@ static tree dfs_class_hint_mark PARAMS ((tree, void *));
|
|||||||
static tree dfs_class_hint_unmark PARAMS ((tree, void *));
|
static tree dfs_class_hint_unmark PARAMS ((tree, void *));
|
||||||
static int class_hint_flags PARAMS((tree));
|
static int class_hint_flags PARAMS((tree));
|
||||||
static tree class_initializer PARAMS((tree, tree, tree));
|
static tree class_initializer PARAMS((tree, tree, tree));
|
||||||
static tree synthesize_tinfo_var PARAMS((tree, tree));
|
static tree synthesize_tinfo_var PARAMS((tree));
|
||||||
static tree create_real_tinfo_var PARAMS((tree, tree, tree, tree, int));
|
static tree create_real_tinfo_var PARAMS((tree, tree, tree, tree, int));
|
||||||
static tree create_pseudo_type_info PARAMS((const char *, int, ...));
|
static tree create_pseudo_type_info PARAMS((const char *, int, ...));
|
||||||
static tree get_vmi_pseudo_type_info PARAMS((int));
|
static tree get_vmi_pseudo_type_info PARAMS((int));
|
||||||
@ -309,9 +309,8 @@ get_tinfo_decl (type)
|
|||||||
TREE_STATIC (d) = 1;
|
TREE_STATIC (d) = 1;
|
||||||
DECL_EXTERNAL (d) = 1;
|
DECL_EXTERNAL (d) = 1;
|
||||||
TREE_PUBLIC (d) = 1;
|
TREE_PUBLIC (d) = 1;
|
||||||
if (flag_weak || !typeinfo_in_lib_p (type))
|
|
||||||
comdat_linkage (d);
|
|
||||||
SET_DECL_ASSEMBLER_NAME (d, name);
|
SET_DECL_ASSEMBLER_NAME (d, name);
|
||||||
|
DECL_COMDAT (d) = 1;
|
||||||
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
|
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
|
||||||
|
|
||||||
pushdecl_top_level (d);
|
pushdecl_top_level (d);
|
||||||
@ -929,19 +928,23 @@ typeinfo_in_lib_p (type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a pseudo_type_info VAR_DECL suitable for the supplied
|
/* Generate a pseudo_type_info VAR_DECL suitable for the supplied
|
||||||
TARGET_TYPE and given the REAL_NAME. This is the structure expected by
|
TARGET_TYPE and corresponding to PUBLIC_DECL. This is the structure expected by
|
||||||
the runtime, and therefore has additional fields. If we need not emit a
|
the runtime, and therefore has additional fields. If we need not emit a
|
||||||
definition (because the runtime must contain it), return NULL_TREE,
|
definition (because the runtime must contain it), return NULL_TREE,
|
||||||
otherwise return the VAR_DECL. */
|
otherwise return the VAR_DECL. */
|
||||||
|
|
||||||
static tree
|
static tree
|
||||||
synthesize_tinfo_var (target_type, real_name)
|
synthesize_tinfo_var (public_decl)
|
||||||
tree target_type;
|
tree public_decl;
|
||||||
tree real_name;
|
|
||||||
{
|
{
|
||||||
tree var_init = NULL_TREE;
|
tree var_init = NULL_TREE;
|
||||||
tree var_type = NULL_TREE;
|
tree var_type = NULL_TREE;
|
||||||
int non_public = 0;
|
int non_public = 0;
|
||||||
|
tree target_type = TREE_TYPE (DECL_NAME (public_decl));
|
||||||
|
my_friendly_assert (target_type != NULL_TREE, 20000120);
|
||||||
|
|
||||||
|
/* Say we've dealt with it. */
|
||||||
|
TREE_TYPE (DECL_NAME (public_decl)) = NULL_TREE;
|
||||||
|
|
||||||
switch (TREE_CODE (target_type))
|
switch (TREE_CODE (target_type))
|
||||||
{
|
{
|
||||||
@ -1079,7 +1082,7 @@ synthesize_tinfo_var (target_type, real_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return create_real_tinfo_var (target_type,
|
return create_real_tinfo_var (target_type,
|
||||||
real_name, TINFO_PSEUDO_TYPE (var_type),
|
public_decl, TINFO_PSEUDO_TYPE (var_type),
|
||||||
var_init, non_public);
|
var_init, non_public);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1087,9 +1090,9 @@ synthesize_tinfo_var (target_type, real_name)
|
|||||||
make this variable public (comdat). */
|
make this variable public (comdat). */
|
||||||
|
|
||||||
static tree
|
static tree
|
||||||
create_real_tinfo_var (target_type, name, type, init, non_public)
|
create_real_tinfo_var (target_type, public_decl, type, init, non_public)
|
||||||
tree target_type;
|
tree target_type;
|
||||||
tree name;
|
tree public_decl;
|
||||||
tree type;
|
tree type;
|
||||||
tree init;
|
tree init;
|
||||||
int non_public;
|
int non_public;
|
||||||
@ -1098,6 +1101,7 @@ create_real_tinfo_var (target_type, name, type, init, non_public)
|
|||||||
tree decl;
|
tree decl;
|
||||||
tree hidden_name;
|
tree hidden_name;
|
||||||
char hidden[30];
|
char hidden[30];
|
||||||
|
tree name = DECL_ASSEMBLER_NAME (public_decl);
|
||||||
|
|
||||||
/* We cannot give this the name NAME, as that already is globally
|
/* We cannot give this the name NAME, as that already is globally
|
||||||
bound to the tinfo_decl we originally created for this type in
|
bound to the tinfo_decl we originally created for this type in
|
||||||
@ -1115,7 +1119,8 @@ create_real_tinfo_var (target_type, name, type, init, non_public)
|
|||||||
if (!non_public)
|
if (!non_public)
|
||||||
{
|
{
|
||||||
TREE_PUBLIC (decl) = 1;
|
TREE_PUBLIC (decl) = 1;
|
||||||
if (flag_weak || !typeinfo_in_lib_p (target_type))
|
if (flag_weak
|
||||||
|
|| (DECL_COMDAT (public_decl) && !typeinfo_in_lib_p (target_type)))
|
||||||
comdat_linkage (decl);
|
comdat_linkage (decl);
|
||||||
}
|
}
|
||||||
SET_DECL_ASSEMBLER_NAME (decl, name);
|
SET_DECL_ASSEMBLER_NAME (decl, name);
|
||||||
@ -1457,19 +1462,16 @@ emit_tinfo_decl (decl_ptr, data)
|
|||||||
void *data ATTRIBUTE_UNUSED;
|
void *data ATTRIBUTE_UNUSED;
|
||||||
{
|
{
|
||||||
tree tinfo_decl = *decl_ptr;
|
tree tinfo_decl = *decl_ptr;
|
||||||
tree tinfo_type, decl;
|
tree decl;
|
||||||
|
|
||||||
my_friendly_assert (TREE_TYPE (tinfo_decl) == tinfo_decl_type, 20000121);
|
my_friendly_assert (TREE_TYPE (tinfo_decl) == tinfo_decl_type, 20000121);
|
||||||
tinfo_type = TREE_TYPE (DECL_NAME (tinfo_decl));
|
|
||||||
my_friendly_assert (tinfo_type != NULL_TREE, 20000120);
|
import_export_decl (tinfo_decl);
|
||||||
|
if (DECL_REALLY_EXTERN (tinfo_decl) || !DECL_NEEDED_P (tinfo_decl))
|
||||||
if (!DECL_NEEDED_P (tinfo_decl))
|
|
||||||
return 0;
|
return 0;
|
||||||
/* Say we've dealt with it. */
|
|
||||||
TREE_TYPE (DECL_NAME (tinfo_decl)) = NULL_TREE;
|
|
||||||
|
|
||||||
create_tinfo_types ();
|
create_tinfo_types ();
|
||||||
decl = synthesize_tinfo_var (tinfo_type, DECL_ASSEMBLER_NAME (tinfo_decl));
|
decl = synthesize_tinfo_var (tinfo_decl);
|
||||||
|
|
||||||
return decl != 0;
|
return decl != 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user