This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix lost locus issues at -O0 -g (PRs debug/29609, debug/36690, debug/37616)


On Tue, Oct 07, 2008 at 09:51:07AM -0700, Ian Lance Taylor wrote:
> > +	      if (e->dest != EXIT_BLOCK_PTR)
> > +		{
> > +		  insn = BB_HEAD (e->dest);
> > +		  if (!INSN_P (insn))
> > +		    insn = next_insn (insn);
> > +		  if (insn && INSN_P (insn)
> > +		      && INSN_LOCATOR (insn) == (int) e->goto_locus)
> > +		    continue;
> > +		}
> 
> Why not use next_nonnote_insn instead of next_insn?

I was afraid next_nonnote_insn could fall through over a BB note into
a different BB.  Guess I could skip over other notes by hand, or
just iterate through insns, until either INSN_P is found or BB_END (e->dest)
is passed.

> > --- gcc/testsuite/gcc.dg/debug/pr37616.c.jj	2008-10-01 14:35:14.000000000 +0200
> > +++ gcc/testsuite/gcc.dg/debug/pr37616.c	2008-10-01 15:50:15.000000000 +0200
> > @@ -0,0 +1,37 @@
> > +/* PR debug/37616 */
> > +/* Test that one can put breakpoints onto continue, exitlab and break
> > +   and actually see program reaching those breakpoints.  */
> > +/* { dg-do run } */
> > +/* { dg-options "-O0 -g -dA" } */
> 
> I don't understand how this test tests what the comment describes.

The debug/pr*.c tests obviously only test whether you can compile/link/run the
program, the debug/dwarf2/pr*.c test are almost identical and test whether
the desired locus is emitted and the intent is that the same tests will be
used in gdb testsuite where it can be all tested more thoroughly.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]