https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116726

--- Comment #5 from Martin Uecker <muecker at gwdg dot de> ---

Fix being tested.

diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 58b2724b39e..ba6d96d26b2 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -1686,8 +1686,11 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree
t2,
            data->anon_field = !DECL_NAME (s1);
            data->pointedto = false;

+           const struct tagged_tu_seen_cache *cache = data->cache;
            data->cache = &entry;
-           if (!comptypes_internal (TREE_TYPE (s1), TREE_TYPE (s2), data))
+           bool ret = comptypes_internal (TREE_TYPE (s1), TREE_TYPE (s2),
data);
+           data->cache = cache;
+           if (!ret)
              return false;

            tree st1 = TYPE_SIZE (TREE_TYPE (s1));

Reply via email to