> -----Original Message----- > From: Joerg Wunsch [mailto:[EMAIL PROTECTED] > 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 _______________________________________________ AVR-libc-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-libc-dev
