Clear calls_comdat_local when comdat group is dissolved
authorJan Hubicka <hubicka@ucw.cz>
Tue, 3 Dec 2019 18:24:00 +0000 (19:24 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 3 Dec 2019 18:24:00 +0000 (18:24 +0000)
while looking into Firefox inlining dumps I noticed that we often do not
inline because we think function calls comdat local while the comdat group
itself has been dissolved.

* cgraph.c (cgraph_node::verify_node): Check that calls_comdat_local
is set only for symbol in comdat group.
* symtab.c (symtab_node::dissolve_same_comdat_group_1): Clear it.

From-SVN: r278944

gcc/ChangeLog
gcc/cgraph.c
gcc/symtab.c

index 58696cefaac211aad72e5a71d2e214cf2b7ad69b..89bdf3b43e1c5cf5e4f14975861e410fa6256cbb 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-03  Jan Hubicka  <hubicka@ucw.cz>
+
+       * cgraph.c (cgraph_node::verify_node): Check that calls_comdat_local
+       is set only for symbol in comdat group.
+       * symtab.c (symtab_node::dissolve_same_comdat_group_1): Clear it.
+
 2019-12-03  Jan Hubicka  <hubicka@ucw.cz>
 
        * cgraph.c: Include tree-into-ssa.h
index ae61de4849eefb4e0da5870dddce9f0162ea400a..7288440708ee52472a9107bfead32bebc6fc83fe 100644 (file)
@@ -3094,6 +3094,11 @@ cgraph_node::verify_node (void)
       error ("inline clone is forced to output");
       error_found = true;
     }
+  if (calls_comdat_local && !same_comdat_group)
+    {
+      error ("calls_comdat_local is set outside of a comdat group");
+      error_found = true;
+    }
   for (e = indirect_calls; e; e = e->next_callee)
     {
       if (e->aux)
index f4317d02b719bc817ef2b4bbb8ddd66c42d22ed7..a88f45c43416ffe9eeae5bf9f06206338c9c8721 100644 (file)
@@ -489,6 +489,8 @@ symtab_node::dissolve_same_comdat_group_list (void)
     {
       next = n->same_comdat_group;
       n->same_comdat_group = NULL;
+      if (dyn_cast <cgraph_node *> (n))
+       dyn_cast <cgraph_node *> (n)->calls_comdat_local = false;
       /* Clear comdat_group for comdat locals, since
          make_decl_local doesn't.  */
       if (!TREE_PUBLIC (n->decl))