[Top] [All Lists]

Re: More GCC problems

To: Ian Chilton <>
Subject: Re: More GCC problems
From: Ralf Baechle <>
Date: Fri, 3 Nov 2000 17:18:05 +0100
In-reply-to: <>; from on Fri, Nov 03, 2000 at 02:37:25PM +0000
References: <>
On Fri, Nov 03, 2000 at 02:37:25PM +0000, Ian Chilton wrote:

> Hello,
> > /tmp/cca08866.s: Assembler messages:
> > /tmp/cca08866.s:27593: Error: Branch out of range
> > /tmp/cca08866.s:27632: Error: Branch out of range
> > /tmp/cca08866.s:27637: Error: Branch out of range

This is a bug in all MIPS versions of gas I've ever examined, including the
vendors of GNU based development systems like Algorithmics.  The problem is
that gcc is producing code that results in loops of over 128kb size, so the
range of a normal branch is exceeded.  Gas should then convert assembler
code such as

        # > 128kb loop body
        bnez    reg, loop


        # > 128kb loop body
        beq     reg, endloop
        jump    loop

That's a non-trivial gas modification.

This is becoming an increasing problem with today's codesize.  Right now
only few applications are affected but Moore's law is mercyless ...

In this particular case I'll simply optimizing the code with -O1 or higher
will help by getting the loop body's size below 128kb size.  This may also
help with other affected packages.  It's however only a temporary solution;
we'll see code in the not to far future where the optimizer is no longer
able to get the code size below the critical size of 128kb.


<Prev in Thread] Current Thread [Next in Thread>