avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Strange asm output


From: Dmitry K.
Subject: Re: [avr-libc-dev] Strange asm output
Date: Thu, 11 Nov 2004 12:38:10 +1000
User-agent: KMail/1.5

Yes, 3.4.1 (and 3.4.2) produce such a worse code.
Send to gcc-buglist, please.

I do not use 3.4.x: there are opened bugs for AVR.

(Extra `ret' is deleted without `-g' option.)


11 Nov 2004 09:43 Nicolas Schodet wrote:
> [...]
>
> I change my original code, so I writed a new one:
>
> /* toto.c */
> #include <inttypes.h>
>
> int32_t
> toto (int32_t a)
> {
>     if (a & (1L << 23))
>         return 1;
>     else
>         return 0;
> }
>
> Command line:
>
> avr-gcc -g -Wall -O2 -mmcu=atmega128 -MMD -S -o toto.s toto.c
>
> Gcc version:
>
> avr-gcc (GCC) 3.4.1
>
> Result:
>
> .global toto
>         .type   toto, @function
> toto:
>         .stabn 68,0,6,.LM1-toto
> .LM1:
> /* prologue: frame size=0 */
> /* prologue end (size=0) */
>         movw r26,r24
>         movw r24,r22
>         .stabn 68,0,7,.LM2-toto
> .LM2:
>         ldi r18,23
> 1:      lsr r27
>         ror r26
>         ror r25
>         ror r24
>         dec r18
>         brne 1b
>         andi r24,lo8(1)
>         andi r25,hi8(1)
>         or r24,r25
>         breq .L2
>         .stabn 68,0,8,.LM3-toto
> .LM3:
>         ldi r22,lo8(1)
>         ldi r23,hi8(1)
>         ldi r24,hlo8(1)
>         ldi r25,hhi8(1)
>         ret
> .L2:
>         .stabn 68,0,10,.LM4-toto
> .LM4:
>         ldi r22,lo8(0)
>         ldi r23,hi8(0)
>         ldi r24,hlo8(0)
>         ldi r25,hhi8(0)
>         .stabn 68,0,11,.LM5-toto
> .LM5:
>         ret
> /* epilogue: frame size=0 */
>         ret
> /* epilogue end (size=1) */
> /* function toto size 24 (23) */
>         .size   toto, .-toto
>
> Tell me if you need more informations.
>
> /Nicolas
>
>
> _______________________________________________
> AVR-libc-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-libc-dev





reply via email to

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