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

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

Re: [avr-gcc-list] IAR vs GCC


From: Larry Barello
Subject: Re: [avr-gcc-list] IAR vs GCC
Date: Wed, 13 Jun 2001 08:38:22 -0700

Try linking with -lm to get the Michael Stumpf libraries.  The gnu float
libraries are written in C and quite fat.  The alternate libraries are in
assembler and amazingly tight.

When I compile and link, I get 1022 bytes including startup code.

I don't know what CV is doing, code wise, but by declaring all those
globals as volatile you force the gcc compiler to be pretty dumb.

If I take out the volatile, GCC produces 748 bytes of code.

If I make them automatics (except for D1), GCC produces 664 bytes of code.

----- Original Message -----
From: "Peter Bozzay" <address@hidden>
Cc: "AVR GCC List" <address@hidden>
Sent: Wednesday, June 13, 2001 7:57 AM
Subject: Re: [avr-gcc-list] IAR vs GCC


>
> Larry Barello wrote:
> >
> [...]
> > Dilbert II (no float)     7414        ----      7325
> >
> > Floating point support: My robot uses Michael Stumpf's floating point
> > library (gcc -lm), when I enable the floating point support in Dilbert
II
> > here are the resulting sizes (mega163)
> >
> > Dilbert II (with float)   9582        ----     10385
>
> Is it possible to make a binary size less than 3928 bytes from code
> below with gcc?
> If it is, how, which flags to use?
> I tried with the new version of gcc from www.combio.de/avr.
>
> volatile unsigned int D1;
> volatile float D2;
> volatile char T2;
> volatile unsigned int I2;
>
> void main (void)
> {
> T2 = 22;
> I2 = 1234;
> D2 = (343.8 + (T2 - 20) * 0.5875) * I2 / 20000;
> D1 = (int)D2;
> }
>
> The binary size, what CodeVisionAVR makes from this, is only 922
> bytes.
>
> Regards,
> Peter
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>




reply via email to

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