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

--- Comment #14 from David Edelsohn <dje at gcc dot gnu.org> ---
Honza suggested

Index: varasm.c
===================================================================
--- varasm.c    (revision 241793)
+++ varasm.c    (working copy)
@@ -6036,7 +6036,8 @@
 #ifdef MAKE_DECL_ONE_ONLY
       MAKE_DECL_ONE_ONLY (decl);
 #endif
-      symbol->set_comdat_group (comdat_group);
+      if (HAVE_COMDAT_GROUP)
+        symbol->set_comdat_group (comdat_group);
     }
   else if (VAR_P (decl)
            && (DECL_INITIAL (decl) == 0
Index: ipa-comdats.c
===================================================================
--- ipa-comdats.c       (revision 241793)
+++ ipa-comdats.c       (working copy)
@@ -210,6 +210,7 @@
 {
   symtab_node *head = (symtab_node *)head_p;

+  gcc_assert (HAVE_COMDAT_GROUP || head_p == NULL);
   gcc_assert (!symbol->get_comdat_group ());
   symbol->set_comdat_group (head->get_comdat_group ());
   symbol->add_to_same_comdat_group (head);

I bootstrapped and tested both trunk with the patch, and 6-branch with the
patch and Richi's backported tree-ssa-sccvn.c patch.  The good news is 6-branch
bootstraps with the above patch and a backport of Richi's patch, so COMDAT is
the cause.  The bad news, as one can see from the published test results, is
testsuite carnage -- ugly, ugly, ugly.   Hundreds of new failures in C, C++ and
libstdc++.  Apparently something needs COMDAT groups, although it doesn't fully
function on AIX.

I will try again without the COMDAT patch and gating ipa-comdats on
HAVE_COMDAT_GROUP.

Reply via email to