avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Need help compiling testcase with gcc 3.3.5 or 3.4.3


From: Andy Hutchinson
Subject: Re: [avr-gcc-list] Need help compiling testcase with gcc 3.3.5 or 3.4.3
Date: Fri, 28 Jan 2005 23:59:52 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

The size issue is almost certaintly caused by the peephole optimisation.

Initial instruction length guesses are set as attributes in avr.md. Basically this keep jumps in range and estimates should be for worst case. When the registers and operands are eventually determined, the length gets adjusted by the routines inside avr.c - again to get the jump range/type correct.

Peephole optimisation changes things really late in the process - peepholes that create asm code (rather than RTL) do not change lengths - so it should be wrong.

On the otherhand there could well be a few mistakes in length calculations! It is unlikely to cause any problems. If estimates are too high jumps might be "bigger" than they need to be - but they will still hit the right spot as labels are used. Low estimates may cause jump out of range problems or bad code with a skip.
Its worth keeping an  eye on.

I think -mdebug adds instrction length and cost estimates to .lst file.

address@hidden wrote:

On Saturday 29 January 2005 11:41, Andy Hutchinson wrote:

Many Thanks to summarize 3.4.3 has same response as WINAVR 3.3.1

I've filed bug report on 4.0 for lack of loop reversal - but it will be
treated as missed optimisation unless other ports take a big hit.

gcc-avr has problem with pattern matching - This happens at least back
to 3.3.1

The AVR.MD RTL peephole turns sign status tests (Rx<=0) + jump into (RX
& -32768) +jump. Then  "*sbrx_and_branchhi" turns this into SBRS.
Unfortunately this occurs before  the potentially more efficient code
peephole ((Rx=Rx-1)<=0)+jump is tried.

Somehow I have to figure out how to catch things before 1st peephole
grabs the sign test. Probabley another RTL peephole and delete the old
code ones.


Interesting thing with avr-gcc 4.0 -- wrong size in comment.
Look:
    ...
testloop1:
/* prologue: frame size=0 */
        push r28
        push r29
/* prologue end (size=2) */
        ldi r28,lo8(10)
        ldi r29,hi8(10)
.L2:
        call foo
        sbiw r28,1
        brne .L2
/* epilogue: frame size=0 */
        pop r29
        pop r28
        ret
/* epilogue end (size=3) */
/* function testloop1 size 12 (7) */

Similar error is in 3.3.4 also.

I have send a message to gcc bug-list (#19684).


_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]