[Top][All Lists]
[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 09:56:37 +1100 |
User-agent: |
KMail/1.5 |
10 Jun 2003 09:20 Eric wrote:
> > 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
>
> Is there an optimization level where it doesn't produce a
> problem? (i.e. -O0, -O1, -O2)
>
> Eric
avr-gcc -O0 -S ==> best result:
/* File "foo_lo_in.c": code 75 = 0x004b ( 40), prologues 18,
epilogues
17 */
Body is greate, but prologue/epilogue small.