]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto: Keep lto file data
authorMichal Jires <mjires@suse.cz>
Mon, 25 Aug 2025 15:26:47 +0000 (17:26 +0200)
committerMichal Jires <mjires@suse.cz>
Thu, 30 Oct 2025 15:49:33 +0000 (16:49 +0100)
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
gcc/lto-section-in.cc
gcc/lto/lto-symtab.cc
gcc/varpool.cc

index d1b2e2a162c06539aa52f91fee892dbd56d82978..ab09376a1a0d27ba0827a782918b2ca61d851d06 100644 (file)
@@ -2220,11 +2220,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
@@ -2336,10 +2332,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)
index 1dd9520137a17f673c6e67562e0ae7adf1b5d6ba..bf8621925dc8363021108ff5d6f281c46d318aff 100644 (file)
@@ -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;
 }
 
 
index 66674a4415f84cc7d3e68ea18d9300062c614d36..8d7fc6805e92b35bb847e78ff5e9638a712de28c 100644 (file)
@@ -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 ();
index 976e0fa60aa09de7d6e5f9669610d7267b03b872..8dc5f986294505bdc824e7811503b4ce483ed9c9 100644 (file)
@@ -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)