This is the mail archive of the
mailing list for the GCC project.
Re: Remove unnecesary line number notes
On 11/9/06, Jan Hubicka <email@example.com> wrote:
> On Wed, Nov 08, 2006 at 05:45:18PM +0100, Jan Hubicka wrote:
> > > Jan Hubicka <firstname.lastname@example.org> writes:
> > >
> > > > 2006-07-25 Jan Hubicka <email@example.com>
> > > > * cfglayout.c (insn_locators_initialize): Delete line number insn.
> > >
> > > This is OK.
> > Hi,
> > I was holding this patch, because there was reported extra failure in
> > GDB testsuite (weird looking one caused by no longer duplicated line
> > number info). I've re-tested with new mainline and gdb-6.5 and
> > everything looks fine now, so I am going to commit it.
> Did you check that duplicate line number notes are emitted where they
> ought to be? Otherwise, I bet the problem just doesn't appear on
> whichever platform you tested it...
the problem has turned out to be rather simple mistake in final.c that
makes the loop to always skip first instruction.
Since this first instruction used to be line number note, but now it is
often function beg note, the walker then never emit the duplicated line
I am testing the attached patch and will commit it if it passes, as the
change is rather obvious. As incremental cleanups, I think
reorganization of the notes is quite neccesary. It is not dificult to
come with testcases where this code fails even at -O0 code, for instance
on x86-64 with variadic functions.
--- final.c (revision 118618)
+++ final.c (working copy)
@@ -1594,7 +1594,7 @@ final (rtx first, FILE *file, int optimi
/* Output the insns. */
- for (insn = NEXT_INSN (first); insn;)
+ for (insn = first; insn;)
if ((unsigned) INSN_UID (insn) >= INSN_ADDRESSES_SIZE ())
--- cfglayout.c (revision 118618)
+++ cfglayout.c (working copy)
@@ -277,6 +277,7 @@ insn_locators_initialize (void)
NOTE_EXPANDED_LOCATION (xloc, insn);
line_number = xloc.line;
file_name = xloc.file;
+ delete_insn (insn);
I believe the cfglayout.c hunk brought us a ~10% compile-time hit for c++bench
(introduced between revs 118648 and 118650). Maybe you are missing a
continue; after it and check_block_change on that insn get's us slow?