https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79061
--- Comment #14 from Maxim Ostapenko <m.ostapenko at samsung dot com> --- (In reply to Richard Biener from comment #13) > (In reply to Maxim Ostapenko from comment #12) > > Created attachment 40525 [details] > > Untested fix 2. > > > > The patch I'm testing now. > > DECL_SOURCE_LOCATION is streamed for all decls already: > > if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL)) > stream_output_location (ob, &bp, DECL_SOURCE_LOCATION (expr)); Aha, right, thank you. But it seems that stream_output_location fails to find it in the location cache that's probably caused by this line in lto.c: /* We have the special case of size-1 SCCs that are pre-merged by means of identifier and string sharing for example. ??? Maybe we should avoid streaming those as SCCs. */ tree first = streamer_tree_cache_get_tree (data_in->reader_cache, from); if (len == 1 && (TREE_CODE (first) == IDENTIFIER_NODE || TREE_CODE (first) == INTEGER_CST || TREE_CODE (first) == TRANSLATION_UNIT_DECL)) continue; that prohibits /* Tree merging failed, mark entries in location cache as permanent. */ data_in->location_cache.accept_location_cache (); several lines below. Perhaps we can just remove TREE_CODE (first) == TRANSLATION_UNIT_DECL from the condition?