We use lto_file_data in 1to1 partitioning, so we need to not zero it
out. Nothing depends on lto_file_data being NULL.

gcc/ChangeLog:

        * cgraph.cc (cgraph_node::release_body): Keep lto_file_data.
        (cgraph_node::remove): likewise.
        * lto-section-in.cc (lto_free_function_in_decl_state_for_node):
        likewise.
        * varpool.cc (varpool_node::remove): likewise.

gcc/lto/ChangeLog:

        * lto-symtab.cc (lto_symtab_merge_symbols_1): likewise.
---
 gcc/cgraph.cc         | 11 ++---------
 gcc/lto-section-in.cc |  1 -
 gcc/lto/lto-symtab.cc |  6 +-----
 gcc/varpool.cc        |  6 +-----
 4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index 32071a84bac..a83e3825dc3 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -2015,11 +2015,7 @@ cgraph_node::release_body (bool keep_arguments)
   if (!used_as_abstract_origin && DECL_INITIAL (decl))
     DECL_INITIAL (decl) = error_mark_node;
   release_function_body (decl);
-  if (lto_file_data)
-    {
-      lto_free_function_in_decl_state_for_node (this);
-      lto_file_data = NULL;
-    }
+  lto_free_function_in_decl_state_for_node (this);
   if (flag_checking && clones)
     {
       /* It is invalid to release body before materializing clones except
@@ -2131,10 +2127,7 @@ cgraph_node::remove (void)
        release_body ();
     }
   else
-    {
-      lto_free_function_in_decl_state_for_node (this);
-      lto_file_data = NULL;
-    }
+    lto_free_function_in_decl_state_for_node (this);
 
   decl = NULL;
   if (call_site_hash)
diff --git a/gcc/lto-section-in.cc b/gcc/lto-section-in.cc
index 1dd9520137a..bf8621925dc 100644
--- a/gcc/lto-section-in.cc
+++ b/gcc/lto-section-in.cc
@@ -448,7 +448,6 @@ lto_free_function_in_decl_state_for_node (symtab_node *node)
       lto_free_function_in_decl_state (*slot);
       node->lto_file_data->function_decl_states->clear_slot (slot);
     }
-  node->lto_file_data = NULL;
 }
 
 
diff --git a/gcc/lto/lto-symtab.cc b/gcc/lto/lto-symtab.cc
index 66674a4415f..8d7fc6805e9 100644
--- a/gcc/lto/lto-symtab.cc
+++ b/gcc/lto/lto-symtab.cc
@@ -953,11 +953,7 @@ lto_symtab_merge_symbols_1 (symtab_node *prevailing)
          else
            {
              DECL_INITIAL (e->decl) = error_mark_node;
-             if (e->lto_file_data)
-               {
-                 lto_free_function_in_decl_state_for_node (e);
-                 e->lto_file_data = NULL;
-               }
+             lto_free_function_in_decl_state_for_node (e);
              symtab->call_varpool_removal_hooks (dyn_cast<varpool_node *> (e));
            }
          e->remove_all_references ();
diff --git a/gcc/varpool.cc b/gcc/varpool.cc
index 976e0fa60aa..8dc5f986294 100644
--- a/gcc/varpool.cc
+++ b/gcc/varpool.cc
@@ -172,11 +172,7 @@ void
 varpool_node::remove (void)
 {
   symtab->call_varpool_removal_hooks (this);
-  if (lto_file_data)
-    {
-      lto_free_function_in_decl_state_for_node (this);
-      lto_file_data = NULL;
-    }
+  lto_free_function_in_decl_state_for_node (this);
 
   /* When streaming we can have multiple nodes associated with decl.  */
   if (symtab->state == LTO_STREAMING)
-- 
2.50.0

Reply via email to