Commit 6542950e by Jan Hubicka Committed by Jan Hubicka

re PR lto/65378 (Tweak to wording of -Wodr message)


	PR lto/65378
	* ipa-utils.h (warn_types_mismatch): Update prototype.
	* ipa-devirt.c (odr_types_equivalent_p): Add loc1/loc2
	parameters.
	(type_mismatch_p): New function.
	(warn_types_mismatch): Reorg to work better on non-C++ types.
	(odr_types_equivalent_p): Add loc1/loc2 parameters.
	(add_type_duplicate): Update.
	* lto-symtab.c (warn_type_compatibility_p): Fix call of
	odr_or_derived_type_p.
	(lto_symtab_merge_decls_2): Update call of warn_types_mismatch.

From-SVN: r224248
parent 97ded4cd
2015-06-08 Jan Hubicka <hubicka@ucw.cz>
PR lto/65378
* ipa-utils.h (warn_types_mismatch): Update prototype.
* ipa-devirt.c (odr_types_equivalent_p): Add loc1/loc2
parameters.
(type_mismatch_p): New function.
(warn_types_mismatch): Reorg to work better on non-C++ types.
(odr_types_equivalent_p): Add loc1/loc2 parameters.
(add_type_duplicate): Update.
2015-06-08 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/66444
......
......@@ -86,7 +86,8 @@ bool types_must_be_same_for_odr (tree, tree);
bool types_odr_comparable (tree, tree, bool strict = false);
cgraph_node *try_speculative_devirtualization (tree, HOST_WIDE_INT,
ipa_polymorphic_call_context);
void warn_types_mismatch (tree t1, tree t2);
void warn_types_mismatch (tree t1, tree t2, location_t loc1 = UNKNOWN_LOCATION,
location_t loc2 = UNKNOWN_LOCATION);
bool odr_or_derived_type_p (const_tree t);
bool odr_types_equivalent_p (tree type1, tree type2);
......
2015-06-06 Jan Hubicka <hubicka@ucw.cz>
PR lto/65378
* lto-symtab.c (warn_type_compatibility_p): Fix call of
odr_or_derived_type_p.
(lto_symtab_merge_decls_2): Update call of warn_types_mismatch.
2015-06-08 Jan Hubicka <hubicka@ucw.cz>
* lto.c (hash_canonical_type): Do not hash TREE_CODE of TREE_TYPE of
pointers.
......
......@@ -212,7 +212,7 @@ warn_type_compatibility_p (tree prevailing_type, tree type)
int lev = 0;
/* C++ provide a robust way to check for type compatibility via the ODR
rule. */
if (odr_or_derived_type_p (prevailing_type) && odr_type_p (type)
if (odr_or_derived_type_p (prevailing_type) && odr_or_derived_type_p (type)
&& !odr_types_equivalent_p (prevailing_type, type))
lev = 2;
......@@ -542,7 +542,9 @@ lto_symtab_merge_decls_2 (symtab_node *first, bool diagnosed_p)
"declaration", decl);
if (diag)
warn_types_mismatch (TREE_TYPE (prevailing->decl),
TREE_TYPE (decl));
TREE_TYPE (decl),
DECL_SOURCE_LOCATION (prevailing->decl),
DECL_SOURCE_LOCATION (decl));
diagnosed_p |= diag;
}
else if ((DECL_USER_ALIGN (prevailing->decl)
......
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