+2011-05-09 Richard Guenther <rguenther@suse.de>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p
+ for diagnostics.
+ (lto_symtab_merge): Likewise. Do not register types here.
+ (lto_symtab_merge_decls_2): Likewise.
+ (lto_symtab_merge_decls_1): Likewise.
+ * gimple.h (enum gtc_mode, gimple_types_compatible_p): Do not declare.
+ * gimple.c (enum gtc_mode): Declare.
+ (gimple_types_compatible_p): Make static.
+
2011-05-09 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.md (TD/TF mem to reg move splitter): Make the
}
+enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 };
+
static hashval_t gimple_type_hash_1 (const void *, enum gtc_mode);
/* Structure used to maintain a cache of some type pairs compared by
FOR_MERGING_P is true the an incomplete type and a complete type
are considered different, otherwise they are considered compatible. */
-bool
+static bool
gimple_types_compatible_p (tree t1, tree t2, enum gtc_mode mode)
{
VEC(type_pair_t, heap) *sccstack = NULL;
extern bool gimple_compare_field_offset (tree, tree);
extern tree gimple_register_type (tree);
extern tree gimple_register_canonical_type (tree);
-enum gtc_mode { GTC_MERGE = 0, GTC_DIAG = 1 };
-extern bool gimple_types_compatible_p (tree, tree, enum gtc_mode);
extern void print_gimple_types_stats (void);
extern void free_gimple_type_tables (void);
extern tree gimple_unsigned_type (tree);
/* Redirect all incoming edges. */
compatible_p
- = gimple_types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
- TREE_TYPE (TREE_TYPE (node->decl)), GTC_DIAG);
+ = types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
+ TREE_TYPE (TREE_TYPE (node->decl)));
for (e = node->callers; e; e = next)
{
next = e->next_caller;
if (TREE_CODE (decl) == FUNCTION_DECL)
{
- if (!gimple_types_compatible_p (TREE_TYPE (prevailing_decl),
- TREE_TYPE (decl), GTC_DIAG))
+ if (!types_compatible_p (TREE_TYPE (prevailing_decl),
+ TREE_TYPE (decl)))
/* If we don't have a merged type yet...sigh. The linker
wouldn't complain if the types were mismatched, so we
probably shouldn't either. Just use the type from
prevailing_type = TYPE_MAIN_VARIANT (TREE_TYPE (prevailing_decl));
type = TYPE_MAIN_VARIANT (TREE_TYPE (decl));
- /* We have to register and fetch canonical types here as the global
- fixup process didn't yet run. */
- prevailing_type = gimple_register_type (prevailing_type);
- type = gimple_register_type (type);
- if (!gimple_types_compatible_p (prevailing_type, type, GTC_DIAG))
+ if (!types_compatible_p (prevailing_type, type))
{
if (COMPLETE_TYPE_P (type))
return false;
if (TREE_CODE (tem1) != TREE_CODE (tem2))
return false;
- if (!gimple_types_compatible_p (gimple_register_type (tem1),
- gimple_register_type (tem2),
- GTC_DIAG))
+ if (!types_compatible_p (tem1, tem2))
return false;
}
/* Diagnose all mismatched re-declarations. */
FOR_EACH_VEC_ELT (tree, mismatches, i, decl)
{
- if (!gimple_types_compatible_p (TREE_TYPE (prevailing->decl),
- TREE_TYPE (decl), GTC_DIAG))
+ if (!types_compatible_p (TREE_TYPE (prevailing->decl), TREE_TYPE (decl)))
diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
"type of %qD does not match original "
"declaration", decl);
inform (DECL_SOURCE_LOCATION (prevailing->decl),
"previously declared here");
- /* Register and adjust types of the entries. */
- for (e = (lto_symtab_entry_t) *slot; e; e = e->next)
- TREE_TYPE (e->decl) = gimple_register_type (TREE_TYPE (e->decl));
-
/* Merge the chain to the single prevailing decl and diagnose
mismatches. */
lto_symtab_merge_decls_2 (slot, diagnosed_p);