MIPS gas relaxation still doesn't work

H. J. Lu hjl@lucon.org
Mon Oct 14 09:16:00 GMT 2002


On Mon, Oct 14, 2002 at 05:09:38PM +0100, Richard Sandiford wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
> > Can gcc be be modified not to generate noreorder/nomacro for branchs if
> > gas is used?
> 
> Sounds like you're suggesting gcc should leave gas to fill delay slots?
> 

Yes, when gcc doesn't know how.

> gcc is usually much better at filling delay slots than gas is.  gas just
> looks at the previous instruction to see if it's suitable.  gcc can pull
> pull instructions from the branch target instead.
> 

I don't think so. Please check out g++.dg/opt/longbranch1.C. gcc 3.2
generates:

$L7488:
        lw      $2,52($fp)
        .set    noreorder
        .set    nomacro

        bne     $2,$0,$L7493
        nop
        j       $L2
        nop

        .set    macro
        .set    reorder
$L7493:

It is no better than gas and disables the branch relaxation. I don't
why gcc shouldn't let gas handle it in this case. That is gcc should
never fill the delay slot with nop.


H.J.



More information about the Binutils mailing list