This is the mail archive of the
mailing list for the GCC project.
Re: Remove unnecesary line number notes
- From: Jan Hubicka <jh at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>, Ian Lance Taylor <iant at google dot com>, Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Thu, 9 Nov 2006 23:37:44 +0100
- Subject: Re: Remove unnecesary line number notes
- References: <20060725173910.GA20358@kam.mff.cuni.cz> <email@example.com> <20061108164518.GC11911@atrey.karlin.mff.cuni.cz> <20061108170625.GA31287@nevyn.them.org>
> 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);