aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-devirt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r--gcc/ipa-devirt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 0340dec..3ab7049 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1883,10 +1883,11 @@ add_type_duplicate (odr_type val, tree type)
return build_bases;
}
-/* REF is OBJ_TYPE_REF, return the class the ref corresponds to. */
+/* REF is OBJ_TYPE_REF, return the class the ref corresponds to.
+ FOR_DUMP_P is true when being called from the dump routines. */
tree
-obj_type_ref_class (const_tree ref)
+obj_type_ref_class (const_tree ref, bool for_dump_p)
{
gcc_checking_assert (TREE_CODE (ref) == OBJ_TYPE_REF);
ref = TREE_TYPE (ref);
@@ -1902,8 +1903,10 @@ obj_type_ref_class (const_tree ref)
tree ret = TREE_TYPE (ref);
if (!in_lto_p && !TYPE_STRUCTURAL_EQUALITY_P (ret))
ret = TYPE_CANONICAL (ret);
+ else if (odr_type ot = get_odr_type (ret, !for_dump_p))
+ ret = ot->type;
else
- ret = get_odr_type (ret)->type;
+ gcc_assert (for_dump_p);
return ret;
}