ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones as having...
authorJan Hubicka <hubicka@ucw.cz>
Sat, 22 Nov 2014 21:08:07 +0000 (22:08 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 22 Nov 2014 21:08:07 +0000 (21:08 +0000)
* ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones
as having abstract origin used.
* ipa-inline-transform.c (can_remove_node_now_p_1): Drop abstract origin check.
(clone_inlined_nodes): Copy abstract originflag.
* lto-cgraph.c (compute_ltrans_boundary): Use get_create to get abstract origin node.

From-SVN: r217973

gcc/ChangeLog
gcc/ipa-inline-transform.c
gcc/ipa.c
gcc/lto-cgraph.c

index 6c15bce92f3b1af74e1de74a935257e847e5278b..7a735d54f4c34b36ac7d0e39814b23839a076143 100644 (file)
@@ -1,3 +1,11 @@
+2014-11-22  Jan Hubicka  <hubicka@ucw.cz>
+
+       * ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones
+       as having abstract origin used.
+       * ipa-inline-transform.c (can_remove_node_now_p_1): Drop abstract origin check.
+       (clone_inlined_nodes): Copy abstract originflag.
+       * lto-cgraph.c (compute_ltrans_boundary): Use get_create to get abstract origin node.
+
 2014-11-22  Uros Bizjak  <ubizjak@gmail.com>
 
        * params.def (PARAM_MAX_COMPLETELY_PEELED_INSNS): Increase to 200.
index 9b806c1bf6615ac7e28e214a69dc7a3c61c9bc01..a64e4dd379cf1e2615786056eb36872ec287d0bc 100644 (file)
@@ -100,7 +100,6 @@ can_remove_node_now_p_1 (struct cgraph_node *node)
      the callgraph so references can point to it.  */
   return (!node->address_taken
          && !node->has_aliases_p ()
-         && !node->used_as_abstract_origin
          && node->can_remove_if_no_direct_calls_p ()
          /* Inlining might enable more devirtualizing, so we want to remove
             those only after all devirtualizable virtual calls are processed.
@@ -218,6 +217,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
                                       update_original, vNULL, true,
                                       inlining_into,
                                       NULL);
+         n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
          e->redirect_callee (n);
        }
     }
index 54b30aab83ce6cdb50d808e8c392945f7d7c6ca5..4f87b75946cfb070b62e4c176b90a3418b7b06ab 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -360,9 +360,18 @@ symbol_table::remove_unreachable_nodes (bool before_inlining_p, FILE *file)
              && DECL_ABSTRACT_ORIGIN (node->decl))
            {
              struct cgraph_node *origin_node
-             = cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (node->decl));
-             origin_node->used_as_abstract_origin = true;
-             enqueue_node (origin_node, &first, &reachable);
+             = cgraph_node::get (DECL_ABSTRACT_ORIGIN (node->decl));
+             if (origin_node && !origin_node->used_as_abstract_origin)
+               {
+                 origin_node->used_as_abstract_origin = true;
+                 gcc_assert (!origin_node->prev_sibling_clone);
+                 gcc_assert (!origin_node->next_sibling_clone);
+                 for (cgraph_node *n = origin_node->clones; n;
+                      n = n->next_sibling_clone)
+                   if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
+                     n->used_as_abstract_origin = true;
+                 enqueue_node (origin_node, &first, &reachable);
+               }
            }
          /* If any symbol in a comdat group is reachable, force
             all externally visible symbols in the same comdat
index 3ce2367a3bfe8bf88d1f4ca5e684ec31e699f23d..d424e145474f45b084831142768046fd147a70b9 100644 (file)
@@ -877,7 +877,8 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
       if (DECL_ABSTRACT_ORIGIN (node->decl))
        {
          struct cgraph_node *origin_node
-         = cgraph_node::get (DECL_ABSTRACT_ORIGIN (node->decl));
+         = cgraph_node::get_create (DECL_ABSTRACT_ORIGIN (node->decl));
+         origin_node->used_as_abstract_origin = true;
          add_node_to (encoder, origin_node, true);
        }
     }