Subject: Re: mips kernel profiling?
To: Ethan Solomita <ethan@geocast.com>
From: Simon Burge <simonb@netbsd.org>
List: port-mips
Date: 04/20/2000 13:43:38
Ethan Solomita wrote:

> 	To reply to myself, it seems that it's the cross compiler that is
> busted. When I compile using the native MIPS gcc the code is correct --
> the .s file created via -S option to gcc does the "addiu $sp,$sp,-8"
> *before* the jump to mcount, not in the branch delay slot. The cross
> compiler optimizes it into the branch delay slot.
> 
> 	However it looks like the .s files that come out of gcc are laid out
> without taking the branch delay slot into account, ie. that appears to
> come at a later stage. This leaves the cross-compiler's .s file as
> wrong.

The assembler will fill the branch delay slot for you with the instruction
that it best thinks should be there.  It _wont_ fill the slot of you are
in a "set .noreorder" block - then the responsibility of the BDslot is yours.

Wierd that the cross-compiler is busted...

Simon.