+2018-10-26 Jan Hubicka <jh@suse.cz>
+
+ * ipa-devirt.c (odr_subtypes_equivalent_p): Fix recursion.
+ (warn_types_mismatch): Fix walk of DECL_NAME.
+ (odr_types_equivalent_p): Fix overactive assert.
+
2018-10-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/87105
}
if (visited->add (pair))
return true;
- if (odr_types_equivalent_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2),
- false, NULL, visited, loc1, loc2)
- && !type_variants_equivalent_p (t1, t2, warn, warned))
+ if (!odr_types_equivalent_p (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2),
+ false, NULL, visited, loc1, loc2))
+ return false;
+ if (!type_variants_equivalent_p (t1, t2, warn, warned))
return false;
return true;
}
if (TREE_CODE (n1) == TYPE_DECL)
n1 = DECL_NAME (n1);
if (TREE_CODE (n2) == TYPE_DECL)
- n1 = DECL_NAME (n2);
+ n2 = DECL_NAME (n2);
/* Most of the time, the type names will match, do not be unnecesarily
verbose. */
if (IDENTIFIER_POINTER (n1) != IDENTIFIER_POINTER (n2))
/* Check first for the obvious case of pointer identity. */
if (t1 == t2)
return true;
- gcc_assert (!type_with_linkage_p (TYPE_MAIN_VARIANT (t1))
- || !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t1)));
- gcc_assert (!type_with_linkage_p (TYPE_MAIN_VARIANT (t2))
- || !type_in_anonymous_namespace_p (TYPE_MAIN_VARIANT (t2)));
/* Can't be the same type if the types don't have the same code. */
if (TREE_CODE (t1) != TREE_CODE (t2))
if (level & 2)
diag = warning_at (DECL_SOURCE_LOCATION (decl),
OPT_Wodr,
- "%qD violates the C++ One Definition Rule ",
+ "%qD violates the C++ One Definition Rule",
decl);
if (!diag && (level & 1))
diag = warning_at (DECL_SOURCE_LOCATION (decl),
+2018-10-26 Jan Hubicka <jh@suse.cz>
+
+ * g++.dg/lto/odr-1_0.C: Fix template.
+ * g++.dg/lto/odr-1_1.C: Fix template.
+
2018-10-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/87105