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: Eric Weddington
Subject: RE: [avr-gcc-list] Question about code size
Date: Sun, 18 Mar 2007 07:49:02 -0600

 

> -----Original Message-----
> From: Dave Hylands [mailto:address@hidden 
> Sent: Friday, March 16, 2007 11:43 PM
> To: Eric Weddington
> Cc: Erik Christiansen; AVR-GCC-list
> Subject: Re: [avr-gcc-list] Question about code size
> 
> Hi Eric (and Erik and Paulo),
> 
> > Can you determine where that difference is? Like you did 
> with the inlined
> > code.
> 
> I wrote the following C function:
<snip> 
> It appears that the compiler is promoting the unsigned
> char's to ints.
> 
> If the integer promotion is removed, then you'd loose, a push, a pop,
> a load of zero and the cp instruction, resulting in a 2 byte smaller
> function - that would be nice :)

:-/
I would probably recommend that you fill out a GCC bug report on the missed
optimization. Your loop index variable is declared as an unsigned char, and
never used in any other expression. There's no reason for it to promote it
to an integer.

 
> Aside: I've just moved my development platform from Windows to linux.
> Where would I go to get the latest patches for gcc/binutils/et al.?
> 
> I'm currently using Marc Bodmer's build_avr_toolchain.sh script which
> is the latest version I've found so far. It's using gcc-4.2-20060819

As long as you don't mind playing with fire. ;-)
Gcc-4.2-20060819 is a *snapshot* of a development branch, i.e. it's not
release yet. And not only that, it's an old snapshot from August of last
year. The GCC project will be coming out with the first release candidate of
4.2 shortly. I would recommend that you use a released version such as
4.1.2, or wait until 4.2.0 is release, which I would guess would be sometime
in the next few weeks. If you really want to try the bleeding edge, then at
least use a more recent snapshot of 4.2.

Eric





reply via email to

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