https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65536
Bug ID: 65536 Summary: [5 regression] LTO line number information garbled Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org As shown in https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01151.html warnings seems to come out wrong with large programs. I did not manage to reproduce it with small testcase. Columns tends to be 0 and line numbers (somewhat) off usually pointing to the begging of type definition instead of the field in question but sometimes they just point in further distance. This reproduce both on Fireofx and Chromium The problem goes away with: Index: lto-streamer-in.c =================================================================== --- lto-streamer-in.c (revision 221582) +++ lto-streamer-in.c (working copy) @@ -200,7 +200,7 @@ lto_input_location (struct bitpack_d *bp if (column_change) current_col = bp_unpack_var_len_unsigned (bp); - if (file_change) + if (file_change || 1) { if (prev_file) linemap_add (line_table, LC_LEAVE, false, NULL, 0); (which also quite significantly increases memory use). The warnings seems to be right on beggining and gets worse at end, so I suspect it is some kind of overflow in libcpp. The problem stays with: Index: lto-streamer-in.c =================================================================== --- lto-streamer-in.c (revision 221582) +++ lto-streamer-in.c (working copy) @@ -207,7 +207,7 @@ lto_input_location (struct bitpack_d *bp linemap_add (line_table, LC_ENTER, false, current_file, current_line); } - else if (line_change) + else if (line_change || 1) linemap_line_start (line_table, current_line, current_col); return linemap_position_for_column (line_table, current_col); One obvious thing is that linemap_line_start takes argument 3 to be max column hint, but we pass current_col that is not cool. I see that libcpp seems to drop the column info after some threshold (that is clearly too small for LTO) but why the line numbers are off?