Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Jan Waclawek
1. If you complain of missed optimisations, you should post the command line switches you have used, the -Ox switch at least. 2. Don't use the naked attribute if you don't understand its implications - here, main uses stack frame which has not been created due to naked; this might work only by

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Bill Westfield
On Jan 26, 2012, at 2:10 PM, Georg-Johann Lay wrote: I tested the code with avr-gcc 4.5 and command line options -Os -mmcu=atmega8 With the attributes, the object size is 54 bytes. Without the attributes the object size is 64 bytes. With 4.5.3 ? Whatever this issue is, it apparently snuck

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Jan Waclawek
Johann: I could reproduce it with one of the 4.7 packages (an older one) you provided. --- Moreover, in 4.7 it also stores the variable to stack frame even without naked, so that could be called a missed optimisation/regression. --- As far as code ineffiency goes, while there is always a

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Georg-Johann Lay
William Chops Westfield wrote: On Jan 26, 2012, at 2:10 PM, Georg-Johann Lay wrote: I tested the code with avr-gcc 4.5 and command line options -Os -mmcu=atmega8 With the attributes, the object size is 54 bytes. Without the attributes the object size is 64 bytes. 4.5.3 ? Whatever this

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread William Chops Westfield
On Jan 26, 2012, at 2:10 PM, Georg-Johann Lay wrote: I tested the code with avr-gcc 4.5 and command line options -Os -mmcu=atmega8 With the attributes, the object size is 54 bytes. Without the attributes the object size is 64 bytes. 4.5.3 ? Whatever this issue is, it apparently snuck in

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Johannes Bauer
On 27.01.2012 01:40, William Chops Westfield wrote: (reports are that 4.5.2 produced smaller code than 4.3.2) Hmmm... defiant joe [~/tmp]: avr-gcc -dumpversion 4.3.4 defiant joe [~/tmp]: avr-gcc -ggdb -Os -c -mmcu=atmega328p -mshort-calls foo.c defiant joe [~/tmp]: avr-size foo.o text

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Georg-Johann Lay
William Chops Westfield wrote: Hi, don't forget to use reply to all or at least to CC the lists themselves. On Jan 27, 2012, at 3:23 AM, Georg-Johann Lay wrote: 4.5.3 ? Whatever this issue is, it apparently snuck in between 4.5.2 and 4.5.3. The only remarkable difference between 4.5.2 and

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Joerg Wunsch
William \Chops\ Westfield wes...@mac.com wrote: int main(void) __attribute__ ((naked)) __attribute__ ((section (.init9))); Instead of trying to force main into being naked, I think it would be better to use the OS_main attribute. Btw., please subscribe to the list. You might miss replies

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Georg-Johann Lay
Jan Waclawek schrieb: Moreover, in 4.7 it also stores the variable to stack frame even without naked, so that could be called a missed optimisation/regression. Thanks for pointing this out. I was lost in all that optimization conversation and thought it was an optimization issue from the

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eric.weddington=atmel@nongnu.org [mailto:avr- gcc-list-bounces+eric.weddington=atmel@nongnu.org] On Behalf Of Bill Westfield Sent: Friday, January 27, 2012 4:28 PM To: avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Weird

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread William Chops Westfield
To condense and summarize: Problem: optiboot, a very small bootloader, grows signficantly in binary size when going from gcc 4.5.2 to gcc 4.5.3. This turns out to be because it misses code factoring optimizations in optiboot's main() function, which is declared with attribute naked to save

Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re naked.

2012-01-27 Thread William Chops Westfield
On Jan 27, 2012, at 12:38 PM, Joerg Wunsch wrote: please subscribe to the list. You might miss replies otherwise. I am subscribed (at gmail); I've just be replying with the wrong from address :-( BillW ___ AVR-GCC-list mailing list