https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65536
--- Comment #13 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Manuel López-Ibáñez from comment #12) > When reading, it is possible to merge different TU line_tables into a single > one quite efficiently (in the order of the maps and not in the order of > triplets or maximum location_t). When adding each new TU line_table to the > unified one, one keeps track of the last location_t assigned, and uses this > later to convert out of order the old location_t from each TU line_table to > the new location_t of the new unified line_table. If the merge function is implemented within line-map.c, it could be extremely efficient in terms of memory re-allocations. I think with the other approaches we end up reallocating the whole table many times because we do not know how many maps we need in advance (admittedly, anything else would be better than the current approach, because it seems LTO is creating a lot of empty maps).