]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r274504
authorMartin Liska <mliska@suse.cz>
Fri, 23 Aug 2019 11:42:19 +0000 (13:42 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 23 Aug 2019 11:42:19 +0000 (11:42 +0000)
2019-08-23  Martin Liska  <mliska@suse.cz>

PR ipa/91508
Backport from mainline
2019-08-15  Martin Liska  <mliska@suse.cz>

PR ipa/91438
* cgraph.c (cgraph_node::remove): When setting
n->origin = NULL for all nested functions, reset
also next_nested.

From-SVN: r274853

gcc/ChangeLog
gcc/cgraph.c

index 9d3214e02927a1ff55264fa03a0e0887e75b5672..cfc39d66abc4996d83558416ddc6b1b843596e50 100644 (file)
@@ -1,3 +1,14 @@
+2019-08-23  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/91508
+       Backport from mainline
+       2019-08-15  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/91438
+       * cgraph.c (cgraph_node::remove): When setting
+       n->origin = NULL for all nested functions, reset
+       also next_nested.
+
 2019-08-23  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index d9e7353bd7bf9fa5a4db1846562e86f399f7fcaa..1febb6369a089b82579352300370c711c6f350e2 100644 (file)
@@ -1779,8 +1779,6 @@ cgraph_node::release_body (bool keep_arguments)
 void
 cgraph_node::remove (void)
 {
-  cgraph_node *n;
-
   if (symtab->ipa_clones_dump_file && symtab->cloned_nodes.contains (this))
     fprintf (symtab->ipa_clones_dump_file,
             "Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), order,
@@ -1797,8 +1795,13 @@ cgraph_node::remove (void)
      */
   force_output = false;
   forced_by_abi = false;
-  for (n = nested; n; n = n->next_nested)
+  cgraph_node *next = nested;
+  for (cgraph_node *n = nested; n; n = next)
+  {
+    next = n->next_nested;
     n->origin = NULL;
+    n->next_nested = NULL;
+  }
   nested = NULL;
   if (origin)
     {
@@ -1852,7 +1855,7 @@ cgraph_node::remove (void)
      */
   if (symtab->state != LTO_STREAMING)
     {
-      n = cgraph_node::get (decl);
+      cgraph_node *n = cgraph_node::get (decl);
       if (!n
          || (!n->clones && !n->clone_of && !n->global.inlined_to
              && ((symtab->global_info_ready || in_lto_p)