Debugging line numbers for delayed branches

Andrew STUBBS andrew.stubbs@st.com
Mon Oct 22 12:52:00 GMT 2007


Daniel Jacobowitz wrote:
> On Fri, Oct 19, 2007 at 10:02:05AM +0100, Andrew STUBBS wrote:
>> It was a year ago, so I would have been using GCC 4.1.1 at the time.
> 
> So this code was already present - I don't see how this could happen
> but maybe it's SH specific :-(
> 

I finally managed to track down the details of the problem I had. Here 
is the example code I had:

--------
#include <stdio.h>

int
main ()
{
   int a = 10;

   while (a)
   {
     printf ("a = %d\n", a);
     a--;
   }

   return 0;
}
--------

The problem was demonstrated by setting a breakpoint on line 8.

However, the problem would appear to have been with the assembler or 
linker, not the compiler, because I have two old toolsets which both 
produce the same .s file, yet one has the bug and the other does not. In 
both cases I tested the binary with the same debugger (GDB 6.6), so that 
is not the problem.

I cannot reproduce the issue with my current tools.

Sorry for the red herring.

Andrew



More information about the Gcc-patches mailing list