+2015-05-19 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-devirt.c (type_in_anonymous_namespace_p): Return true
+ or implicit declarations.
+ (odr_type_p): Check that TYPE_NAME is TYPE_DECL before looking
+ into it.
+ (get_odr_type): Check type has linkage before adding bases.
+ (register_odr_type): Check that type has linkage before adding it.
+ (type_known_to_have_no_deriavations_p): Rename to ..
+ (type_known_to_have_no_derivations_p): This one.
+ * ipa-utils.h (type_known_to_have_no_deriavations_p): Rename to ..
+ (type_known_to_have_no_derivations_p): This one.
+ * ipa-polymorphic-call.c
+ (ipa_polymorphic_call_context::restrict_to_inner_type): Check that
+ type has linkage.
+
2015-05-19 Eric Botcazou <ebotcazou@adacore.com>
* stor-layout.c (finalize_type_size): Use AGGREGATE_TYPE_P.
if (TYPE_STUB_DECL (t) && !TREE_PUBLIC (TYPE_STUB_DECL (t)))
{
+ if (DECL_ARTIFICIAL (TYPE_NAME (t)))
+ return true;
tree ctx = DECL_CONTEXT (TYPE_NAME (t));
while (ctx)
{
to care, since it is used only for type merging. */
gcc_checking_assert (in_lto_p || flag_lto);
- return (TYPE_NAME (t)
+ return (TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL
&& (DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (t))));
}
}
if (build_bases && TREE_CODE (type) == RECORD_TYPE && TYPE_BINFO (type)
+ && type_with_linkage_p (type)
&& type == TYPE_MAIN_VARIANT (type))
{
tree binfo = TYPE_BINFO (type);
makes it possible that non-ODR type is main_odr_variant of ODR type.
Things may get smoother if LTO FE set mangled name of those types same
way as C++ FE does. */
- if (odr_type_p (main_odr_variant (TYPE_MAIN_VARIANT (type))))
+ if (odr_type_p (main_odr_variant (TYPE_MAIN_VARIANT (type)))
+ && odr_type_p (TYPE_MAIN_VARIANT (type)))
get_odr_type (TYPE_MAIN_VARIANT (type), true);
if (TYPE_MAIN_VARIANT (type) != type && odr_type_p (main_odr_variant (type)))
get_odr_type (type, true);
/* Return true if type is known to have no derivations. */
bool
-type_known_to_have_no_deriavations_p (tree t)
+type_known_to_have_no_derivations_p (tree t)
{
return (type_all_derivations_known_p (t)
&& (TYPE_FINAL_P (t)
types. Testing it here may help us to avoid speculation. */
if (otr_type && TREE_CODE (outer_type) == RECORD_TYPE
&& (!in_lto_p || odr_type_p (outer_type))
- && type_known_to_have_no_deriavations_p (outer_type))
+ && type_with_linkage_p (outer_type)
+ && type_known_to_have_no_derivations_p (outer_type))
maybe_derived_type = false;
/* Type can not contain itself on an non-zero offset. In that case
goto no_useful_type_info;
cur_offset = new_offset;
- type = subtype;
+ type = TYPE_MAIN_VARIANT (subtype);
if (!speculative)
{
outer_type = type;
tree subbinfo_with_vtable_at_offset (tree, unsigned HOST_WIDE_INT, tree);
void compare_virtual_tables (varpool_node *, varpool_node *);
bool type_all_derivations_known_p (const_tree);
-bool type_known_to_have_no_deriavations_p (tree);
+bool type_known_to_have_no_derivations_p (tree);
bool contains_polymorphic_type_p (const_tree);
void register_odr_type (tree);
bool types_must_be_same_for_odr (tree, tree);