[Bug lto/99447] [11 Regression] ICE (segfault) in lookup_page_table_entry

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 17 12:39:02 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99447

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
So like this.

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 80140757d16..447d9a920f7 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1854,6 +1854,9 @@ cgraph_node::release_body (bool keep_arguments)
      needed to emit debug info later.  */
   if (!used_as_abstract_origin && DECL_INITIAL (decl))
     DECL_INITIAL (decl) = error_mark_node;
+  /* Zap references to call stmts of our body.  */
+  for (cgraph_edge *e = callees; e; e = e->next_callee)
+    e->call_stmt = NULL;
   release_function_body (decl);
   if (lto_file_data)
     {


More information about the Gcc-bugs mailing list