[Bug ipa/79776] [7 Regression] ICE on valid code in insert_vi_for_tree, at tree-ssa-structalias.c:2807
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 23 10:10:00 GMT 2017
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;
}
More information about the Gcc-bugs
mailing list