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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Possible patch:

diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 288e3c0f4c6..6441ab30c8b 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -591,7 +591,7 @@ local_tree_p (tree t)
         Only work hard for main variants;
         variant types will inherit locality.  */
       return TYPE_MAIN_VARIANT (t) == t
-            && odr_type_p (t) && type_with_linkage_p (t)
+            && in_lto_p && odr_type_p (t) && type_with_linkage_p (t)
             && type_in_anonymous_namespace_p (t);
     default:
       return false;

Reply via email to