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

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

Re: [avr-gcc-list] Question about code size


From: Erik Christiansen
Subject: Re: [avr-gcc-list] Question about code size
Date: Fri, 16 Mar 2007 20:00:33 +1100
User-agent: Mutt/1.5.9i

On Fri, Mar 16, 2007 at 12:00:19AM -0800, Dave Hylands wrote:
> hi Erik.
> 
> >Does -fno-default-inline do any good?
> 
> I get the following warning:
> cc1: warning: command line option "-fno-default-inline" is valid for
> C++/ObjC++ but not for C

Yes, on cleaning my spectacles, that seems to be right. (Not optimal in
your case, though.)

Errm, it is safe to assume you're using -Os, and not one of the other
optimisations? ;-)

> >> It seems to be inlining the putch function which is called many times,
> >> and the inlined version is quite a bit bigger than calling the
> >> function.
> >
> >If the above doesn't do it, how about:
> >
> >#define NOINLINE __attribute__ ((__noinline__))
> >
> >on the functions that shouldn't be inlined?
> >(OK, that could be laborious if there are a lot of them. :-)
> 
> That seems to work. If I put it front of every function, then I get
> the size down to 890 bytes (it was 1366 bytes before this).
> 
> The 3.4.5 compiler generated 848 bytes.
> 
> At least the bootloader is under 1k again.

Hmmm, maybe I'm not a complete dufus for writing whole slabs in
assembler, after all. It does make things proof against compiler
updates. :-)

Erik
(Scurrying out the door, in answer to the siren call of the weekend.)




reply via email to

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