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

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

Re: [avr-gcc-list] Horrible code


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Horrible code
Date: Wed, 17 May 2006 10:39:02 +0200 (MET DST)

"James L. Evans" <address@hidden> wrote:

> Could someone with a 4.1 version of the AVR-GCC compiler please
> compile the following code (-Os) and see if it generates better code
> than the horrible code (25 instructions) generated for Case 2 by
> version 3.4.3?

Here's the code generated by GCC 4.1.0 with -mmcu=atmega128 -Os:

..global test7
        .type   test7, @function
test7:
        sbis 57-0x20,6
        rjmp .L15
..L4:
        out 59-0x20,__zero_reg__
        sbic 57-0x20,6
        rjmp .L4
..L15:
        sbic 57-0x20,6
        rjmp .L17
..L7:
        out 59-0x20,__zero_reg__
        sbis 57-0x20,6
        rjmp .L7
..L17:
        sbic 57-0x20,6
        rjmp .L19
..L10:
        out 59-0x20,__zero_reg__
        sbis 57-0x20,6
        rjmp .L10
..L19:
        sbic 57-0x20,6
        rjmp .L21
..L13:
        out 59-0x20,__zero_reg__
        sbis 57-0x20,6
        rjmp .L13
..L21:
        ret

-- 

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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