This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/79776] [7 Regression] ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Mar 2017 10:10:54 +0000
- Subject: [Bug ipa/79776] [7 Regression] ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807
- Auto-submitted: auto-generated
- References: <bug-79776-4@http.gcc.gnu.org/bugzilla/>
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;
}