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

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

RE: [avr-libc-dev] [RFC] Optimize for space


From: Eric Weddington
Subject: RE: [avr-libc-dev] [RFC] Optimize for space
Date: Tue, 02 Oct 2007 15:15:23 -0600


> -----Original Message-----
> From: Joerg Wunsch [mailto:address@hidden
> Sent: Tuesday, October 02, 2007 12:21 PM
> To: 'avr-libc-dev'
> Cc: Eric Weddington
> Subject: Re: [avr-libc-dev] [RFC] Optimize for space
>
> As Eric Weddington wrote:
>
> > Currently, some devices are opitimized for "speed" in
> > devtools/gen-avr-lib-tree.sh. I'd like to change the current setup
> > to optimize for space for all devices. See attached patch.
>
> The question is whether distinguishing CFLAGS_SPACE and CFLAGS_SPEED
> still makes any sense at all then.
>
> Just curious, did you compare the resulting codesizes for the
> different -O levels?  My last comparison is a bit dated now, and
> it's quite possible something else (like -O1 or -O2) might make
> more sense with the current compiler(s).

Admittedly, no, I haven't done those comparisons. Both CFLAGS_SPACE and
CFLAGS_SPEED use -Os, but CFLAGS_SPACE also adds -mcall-prologues, so that
is the only difference between the two. Using -mcall-prologues is useful and
will reduce code size as the application grows over some trivially small
size.

But overall, I'd rather distribute an avr-libc that has the smallest
possible size over the fastest path through the code. In practice, they are
usually not that much different. However, benchmarks comparing different
compilers (for the same chip/family), and even comparing different
chip/families (but 8-bit devices), focus almost exclusively on code *size*,
whether that's right or wrong.

Eric Weddington






reply via email to

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