This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
line numbers vs sched-ebb
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: davidm at hpl dot hp dot com
- Date: Wed, 7 May 2003 17:21:26 -0700
- Subject: line numbers vs sched-ebb
- References: <200304220036.h3M0auFX001635@napali.hpl.hp.com> <20030422204607.GB21400@redhat.com> <16056.45456.719289.327504@napali.hpl.hp.com>
On Wed, May 07, 2003 at 12:11:12AM -0700, David Mosberger wrote:
> $ cat t.c
> void bar(void);
> void baz(void);
> void foo(int p)
> {
> if (p == 0)
> bar();
> baz();
> }
> $ cc1 -g -O2 t.c
[...]
> .loc 1 4 0
> br.call.sptk.many b0 = bar#
[ Note the incorrect line number 4 before the call to bar. ]
Indeed, *all* ebb sequences get marked as starting on the
same line number as the beginning of the function. :-(
Fixed thus. There should probably be a gdb test for this...
r~
* sched-ebb.c (schedule_ebb): Supply the correct starting
block number to save_line_notes.
Index: sched-ebb.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-ebb.c,v
retrieving revision 1.25
diff -u -p -u -r1.25 sched-ebb.c
--- sched-ebb.c 25 Feb 2003 21:43:16 -0000 1.25
+++ sched-ebb.c 8 May 2003 00:17:37 -0000
@@ -514,7 +514,7 @@ schedule_ebb (head, tail)
if (write_symbols != NO_DEBUG)
{
- save_line_notes (0, head, tail);
+ save_line_notes (first_bb->index, head, tail);
rm_line_notes (head, tail);
}