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

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

Re: [avr-gcc-list] Unused registers saves/restores ?


From: Dmitry K.
Subject: Re: [avr-gcc-list] Unused registers saves/restores ?
Date: Tue, 10 Jun 2003 08:29:50 +1100
User-agent: KMail/1.5

10 Jun 2003 08:12 Eric wrote:
> > Hello all,
> >
> > Compiler:
> >     avr-gcc --version
> >     avr-gcc (GCC) 3.3.1 20030519 (prerelease)
> >
> > Programm:
> >     typedef struct { long a; int b; } lo_in;
> >
> >     lo_in foo_lo_in (void)
> >     {
> >         lo_in x;
> >         x.a = 1;
> >         x.b = 2;
> >         return x;
> >     };
> >
> > Compile with:
> >     avr-gcc -O3 -S foo_lo_in.c
> >
> > Result: r2,3,4,7,... not used, but saved/restored:
>
> Do you get the same with other optimizations? Including -Os?
>
> Eric

avr-gcc -Os -S foo_lo_in.c  ==>  roughly the same (r8,r9,...):

/* prologue end (size=26) */
        clr r2
        mov r7,r2
        ldi r24,lo8(1)
        ldi r25,hi8(1)
        ldi r26,hlo8(1)
        ldi r27,hhi8(1)
        std Y+1,r24
        std Y+2,r25
        std Y+3,r26
        std Y+4,r27
        ldi r24,lo8(2)
        ldi r25,hi8(2)
        std Y+5,r24
        std Y+6,r25
        ldd r24,Y+6
        ldd r2,Y+1
        ldd r3,Y+2
        ldd r4,Y+3
        ldd r5,Y+4
        ldd r6,Y+5
        mov r15,r24
        mov r18,r2
        mov r19,r3
        mov r20,r4
        mov r21,r5
        mov r22,r6
        mov r23,r15
        mov r24,r7
        mov r25,r7
/* epilogue: frame size=6 */

avr-gcc -O3 -fssa -S foo_lo_in.c  ==>
        internal compiler error: in extract_insn, at recog.c:2175



reply via email to

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