X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Fipa-devirt.c;h=3e040e273058f27f9aaa595117aff9496baf7f2f;hb=d1700aa1407c188165eb8e06f40bf059a9b81b16;hp=defa2ed3a5dc95bbd8411be1d04b8037bc9f9212;hpb=061a799b8e9b66c59dd55bb11c1b132ea74ebb43;p=gcc.git diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index defa2ed3a5d..3e040e27305 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -2020,7 +2020,7 @@ obj_type_ref_class (const_tree ref) ref = TREE_VALUE (TYPE_ARG_TYPES (ref)); gcc_checking_assert (TREE_CODE (ref) == POINTER_TYPE); tree ret = TREE_TYPE (ref); - if (!in_lto_p) + if (!in_lto_p && !TYPE_STRUCTURAL_EQUALITY_P (ret)) ret = TYPE_CANONICAL (ret); else ret = get_odr_type (ret)->type; @@ -2042,7 +2042,7 @@ get_odr_type (tree type, bool insert) int base_id = -1; type = TYPE_MAIN_VARIANT (type); - if (!in_lto_p) + if (!in_lto_p && !TYPE_STRUCTURAL_EQUALITY_P (type)) type = TYPE_CANONICAL (type); gcc_checking_assert (can_be_name_hashed_p (type)