https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85047
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2018-03-23 CC| |marxin at gcc dot gnu.org Component|ada |lto Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- I think it's a fundamental issue with the streamer and how tree_is_indexable is a "flat" predicate but we test it from the toplevel like in lto_output_tree. The fix is probably to handle refs from within the DFS walk which also means to not simply stop at "indexable" refs (but still do a lookup whether they already exist in the index!) and handle them when they appear as leafs. A C testcase that should run into similar issues as the Ada one is void foo(int n) { struct X { int a[n]; } a; struct Y { struct X *p; } b; b.p = &a; } which isn't ICEing but at least is streaming two different copies of X.