This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ipa/79776] [7 Regression] ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807


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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, PTA simply assumes that cgraph_for_symbol_thunks_and_aliases will call
the callback for nodes with different decls.  If it's not easy to arrange for
that a "simple" fix would be sth like

Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c  (revision 246414)
+++ gcc/tree-ssa-structalias.c  (working copy)
@@ -7617,7 +7617,15 @@ associate_varinfo_to_alias (struct cgrap
 {
   if ((node->alias || node->thunk.thunk_p)
       && node->analyzed)
-    insert_vi_for_tree (node->decl, (varinfo_t)data);
+    {
+      /* We can run into duplicate decls, so gracefully handle those.  */
+      bool existed;
+      varinfo_t &vi = vi_for_tree->get_or_insert (node->decl, &existed);
+      if (existed)
+       gcc_assert (vi == (varinfo_t)data);
+      else
+       vi = (varinfo_t)data;
+    }
   return false;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]