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: MIPS gas relaxation still doesn't work


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.


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