https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65536
--- Comment #28 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #26) > Created attachment 35130 [details] > linemap > > this is a proof of concept patch that makes streamer in to collect locations > into a "cache" and apply them in sorted order (looking up correct max_column > hints) at the end of handling of a given section. It also has facility to > throw away locations of trees that are freed. > while sorting at stream in time is not cool, it does not show top in the > profiles > and memory use of the cache is actually dominated by other stuff we read, > so this seems to work quite well in practice. Main problem would be if > someone > copied/used the locator before cache is applied. > > This helps to get all lines and most of carrets right on firefox. I killed my > Chromium tree so can't test it there (Martin, perhaps you could try?) Sure. Unfortunately, there's still ICE, which is caused by a function body load that happens in IPA ICF: In function ‘Create’: lto1: internal compiler error: Segmentation fault 0x9037df crash_signal ../../gcc/toplev.c:383 0xed909c new_linemap ../../libcpp/line-map.c:265 0xed9467 linemap_add(line_maps*, lc_reason, unsigned int, char const*, unsigned int) ../../libcpp/line-map.c:314 0xed98d0 linemap_line_start(line_maps*, unsigned int, unsigned int) ../../libcpp/line-map.c:566 0xa8b190 unpack_ts_block_value_fields ../../gcc/tree-streamer-in.c:414 0xa8b190 streamer_read_tree_bitfields(lto_input_block*, data_in*, tree_node*) ../../gcc/tree-streamer-in.c:538 0x80a791 lto_read_tree_1 ../../gcc/lto-streamer-in.c:1197 0x80ab04 lto_read_tree ../../gcc/lto-streamer-in.c:1234 0x80ab04 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ../../gcc/lto-streamer-in.c:1353 0x80ae01 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*) ../../gcc/lto-streamer-in.c:1258 0x80ae64 lto_input_tree(lto_input_block*, data_in*) ../../gcc/lto-streamer-in.c:1368 0xe26ff1 input_gimple_stmt ../../gcc/gimple-streamer-in.c:186 0xe26ff1 input_bb(lto_input_block*, LTO_tags, data_in*, function*, int) ../../gcc/gimple-streamer-in.c:303 0x80c457 input_function ../../gcc/lto-streamer-in.c:992 0x80c457 lto_read_body_or_constructor ../../gcc/lto-streamer-in.c:1129 0x614d5d cgraph_node::get_untransformed_body() ../../gcc/cgraph.c:3225 0xe6e580 ipa_icf::sem_function::init() ../../gcc/ipa-icf.c:1167 0xe6b730 ipa_icf::sem_item_optimizer::parse_nonsingleton_classes() ../../gcc/ipa-icf.c:2617 0xe72b9a ipa_icf::sem_item_optimizer::execute() ../../gcc/ipa-icf.c:2419 0xe74386 ipa_icf_driver ../../gcc/ipa-icf.c:3304 I also attach ODR warnings before and after the patch. Diff > > I did not have much time today to test the patch. It also saves quite a lot > of > memory, about 400MB on firefox I guess. > > Honza