From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3791 invoked by alias); 7 Feb 2013 14:35:57 -0000 Received: (qmail 1335 invoked by uid 48); 7 Feb 2013 14:35:25 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56231] warning traces have bogus line information when using LTO Date: Thu, 07 Feb 2013 14:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: lto X-Bugzilla-Severity: major X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00664.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56231 --- Comment #4 from Richard Biener 2013-02-07 14:35:24 UTC --- (In reply to comment #3) > (In reply to comment #1) > > Index: gcc/lto-streamer-in.c > > =================================================================== > > --- gcc/lto-streamer-in.c (revision 195841) > > +++ gcc/lto-streamer-in.c (working copy) > > @@ -164,13 +164,8 @@ lto_input_location (struct bitpack_d *bp > > data_in->current_col = bp_unpack_var_len_unsigned (bp); > > > > if (file_change) > > - { > > - if (prev_file) > > - linemap_add (line_table, LC_LEAVE, false, NULL, 0); > > - > > - linemap_add (line_table, LC_ENTER, false, data_in->current_file, > > - data_in->current_line); > > - } > > + linemap_add (line_table, LC_RENAME, false, data_in->current_file, > > + data_in->current_line); > > else if (line_change) > > linemap_line_start (line_table, data_in->current_line, > > data_in->current_col); > > Does not work because of > > const struct line_map * > linemap_add (struct line_maps *set, enum lc_reason reason, > unsigned int sysp, const char *to_file, linenum_type to_line) > { > ... > /* When we enter the file for the first time reason cannot be > LC_RENAME. */ > linemap_assert (!(set->depth == 0 && reason == LC_RENAME)); > > trying > > Index: gcc/lto-streamer-in.c > =================================================================== > --- gcc/lto-streamer-in.c (revision 195846) > +++ gcc/lto-streamer-in.c (working copy) > @@ -165,11 +165,12 @@ lto_input_location (struct bitpack_d *bp > > if (file_change) > { > - if (prev_file) > - linemap_add (line_table, LC_LEAVE, false, NULL, 0); > - > - linemap_add (line_table, LC_ENTER, false, data_in->current_file, > - data_in->current_line); > + if (!prev_file) > + linemap_add (line_table, LC_ENTER, false, data_in->current_file, > + data_in->current_line); > + else > + linemap_add (line_table, LC_RENAME, false, data_in->current_file, > + data_in->current_line); > } > else if (line_change) > linemap_line_start (line_table, data_in->current_line, > data_in->current_col); > > we'll still eventually enter a file multiple times that way. But let's see > if it makes a difference... Doesn't make a difference.