This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/83121] [8 Regression] ICE: in linemap_ordinary_map_lookup, at libcpp/line-map.c:995
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Dec 2017 21:39:47 +0000
- Subject: [Bug lto/83121] [8 Regression] ICE: in linemap_ordinary_map_lookup, at libcpp/line-map.c:995
- Auto-submitted: auto-generated
- References: <bug-83121-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83121
--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Here's a work-in-progress fix for this:
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 540f038..f3d2e4a 100644
--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -1844,7 +1844,12 @@ add_type_duplicate (odr_type val, tree type)
}
}
- /* Next compare memory layout. */
+ /* Next compare memory layout.
+ The DECL_SOURCE_LOCATIONs in this invocation came from LTO streaming.
+ We must apply the location cache to ensure that they are valid
+ before we can pass them to odr_types_equivalent_p (PR lto/83121). */
+ if (lto_location_cache::current_cache)
+ lto_location_cache::current_cache->apply_location_cache ();
if (!odr_types_equivalent_p (val->type, type,
!flag_ltrans && !val->odr_violated && !warned,
&warned, &visited,