This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Modify the mips gas behavior for -g -O


On Sun, Feb 10, 2002 at 04:26:31PM -0500, Don Bowman wrote:
> 
> On Wed, Feb 06, 2002 at 12:45:38PM -0800, H . J . Lu wrote:
> > On Wed, Feb 06, 2002 at 11:32:59AM +0100, Ralf Baechle wrote:
> > > > 
> > > > There is an extra "nop" in the delay slot. I don't think gas is smart
> > > > enough to fill the delay slot. I will put back those ".set noredor".
> > > 
> > > The solution is to move the move instruction in front of the branch
> > > instruction.  The assembler will then move it into the delay slot:
> > > 
> > 
> > I found out why it didn't work for me. The problem is -g turns off
> > filling  the delay slot. The mips as has
> 
> Its kind of important to disable the delay-slot filling when debugging.
> You can't put a break-point in a delay slot [well, its technically
> feasibly to do so, but OS's don't support it since they'd need
> to interpret the instruction in the previous slot]. With the delay slot
> filled, this might be the first instruction from the next line of
> C code, and then gdb will be unable to put a break there.
> 
> I don't recommend installing the patch.

But the case H.J. is changing is '-g -O'.  You've got to expect that
sort of problem when you compile with optimization.  GCC maintains a
strict policy of not changing code generation in response to -g flags;
I think gas should do the same.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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