Commit c4fcd06a by Richard Guenther Committed by Richard Biener

lto-symtab.c (lto_symtab_merge): Use gtc_mode enum values.

2010-07-23  Richard Guenther  <rguenther@suse.de>

	* lto-symtab.c (lto_symtab_merge): Use gtc_mode enum
	values.
	(lto_symtab_merge_decls_2): Likewise.
	* tree-ssa.c (useless_type_conversion_p): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Likewise.
	* gimple.c (gtc_visited2, gtc_ob2): Remove.
	(struct type_pair_d): Make same_p an array indexed by mode.
	Update comment.
	(lookup_type_pair): Update initialization.
	(struct sccs): Adjust same_p type.
	(gimple_types_compatible_p_1, gtc_visit, gimple_types_compatible_p):
	Adjust.
	(print_gimple_types_stats): Likewise.
	* gimple.h (enum gtc_mode): New.
	(gimple_types_compatible_p): Adjust prototype.

From-SVN: r162461
parent 6afb52d3
2010-07-23 Richard Guenther <rguenther@suse.de>
* lto-symtab.c (lto_symtab_merge): Use gtc_mode enum
values.
(lto_symtab_merge_decls_2): Likewise.
* tree-ssa.c (useless_type_conversion_p): Likewise.
* lto-streamer-in.c (input_gimple_stmt): Likewise.
* gimple.c (gtc_visited2, gtc_ob2): Remove.
(struct type_pair_d): Make same_p an array indexed by mode.
Update comment.
(lookup_type_pair): Update initialization.
(struct sccs): Adjust same_p type.
(gimple_types_compatible_p_1, gtc_visit, gimple_types_compatible_p):
Adjust.
(print_gimple_types_stats): Likewise.
* gimple.h (enum gtc_mode): New.
(gimple_types_compatible_p): Adjust prototype.
2010-07-23 Daniel Jacobowitz <dan@codesourcery.com>
* dwarf2out.c (dwarf2out_frame_debug): Check for queued saves
......
......@@ -956,7 +956,8 @@ extern tree get_call_expr_in (tree t);
extern void recalculate_side_effects (tree);
extern bool gimple_compare_field_offset (tree, tree);
extern tree gimple_register_type (tree);
extern bool gimple_types_compatible_p (tree, tree, bool);
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);
......
......@@ -962,7 +962,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
if (tem == field
|| (gimple_types_compatible_p (TREE_TYPE (tem),
TREE_TYPE (field),
false)
GTC_DIAG)
&& DECL_NONADDRESSABLE_P (tem)
== DECL_NONADDRESSABLE_P (field)
&& gimple_compare_field_offset (tem, field)))
......
......@@ -349,7 +349,7 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
if (TREE_CODE (decl) == FUNCTION_DECL)
{
if (!gimple_types_compatible_p (TREE_TYPE (prevailing_decl),
TREE_TYPE (decl), false))
TREE_TYPE (decl), GTC_DIAG))
/* 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
......@@ -382,7 +382,7 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
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, false))
if (!gimple_types_compatible_p (prevailing_type, type, GTC_DIAG))
{
if (COMPLETE_TYPE_P (type))
return false;
......@@ -408,7 +408,8 @@ lto_symtab_merge (lto_symtab_entry_t prevailing, lto_symtab_entry_t entry)
return false;
if (!gimple_types_compatible_p (gimple_register_type (tem1),
gimple_register_type (tem2), false))
gimple_register_type (tem2),
GTC_DIAG))
return false;
}
......@@ -603,7 +604,7 @@ lto_symtab_merge_decls_2 (void **slot)
for (i = 0; VEC_iterate (tree, mismatches, i, decl); ++i)
{
if (!gimple_types_compatible_p (TREE_TYPE (prevailing->decl),
TREE_TYPE (decl), false))
TREE_TYPE (decl), GTC_DIAG))
diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
"type of %qD does not match original "
"declaration", decl);
......
......@@ -1427,7 +1427,7 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
else if (AGGREGATE_TYPE_P (inner_type)
&& TREE_CODE (inner_type) == TREE_CODE (outer_type))
return (in_lto_p
&& gimple_types_compatible_p (outer_type, inner_type, false));
&& gimple_types_compatible_p (outer_type, inner_type, GTC_DIAG));
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment