This is the mail archive of the
mailing list for the binutils project.
Re: PATCH: Modify the mips gas behavior for -g -O
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Don Bowman <don at sandvine dot com>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>,"'hjl at lucon dot org'" <hjl at lucon dot org>
- Date: Sun, 10 Feb 2002 16:29:27 -0500
- Subject: Re: PATCH: Modify the mips gas behavior for -g -O
- References: <FE045D4D9F7AED4CBFF1B3B813C85337675B4D@mail.sandvine.com>
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