[avr-gcc-list] Code optimistaion in AVR Tiny13

2009-02-16 Thread Robert von Knobloch
Hello, I write code for Tiny13 embedded applications using 'C' to improve maintainability. Due to some small issues I decided to update my entire toolchain to the latest (greatest?) versions. Upon going back to some old projects I notice that re-compiling makes the code grow quite horribly. In

Re: [avr-gcc-list] Code optimistaion in AVR Tiny13

2009-02-16 Thread Ruud Vlaming
On Monday 16 February 2009 15:11, Robert von Knobloch wrote: On inspection I find that the compiler has 'in-lined' at least 3 function calls that I had written as a function to achieve compactness. Is there any way I can stop this, or is this a bug? There has been some discussions about this

RE: More volatile musings [was: Re: [avr-gcc-list] memcpy() : problem when passing destination pointer]

2009-02-16 Thread Weddington, Eric
-Original Message- From: John Regehr [mailto:reg...@cs.utah.edu] Sent: Saturday, February 14, 2009 9:49 PM To: Weddington, Eric Cc: Andy Warner; avr-gcc-list@nongnu.org Subject: RE: More volatile musings [was: Re: [avr-gcc-list] memcpy() : problem when passing destination

Re: [avr-gcc-list] Code optimistaion in AVR Tiny13

2009-02-16 Thread Anatoly Sokolov
Hi, add OS_main attribute to main function, -mtiny-stack Anatoly. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

[avr-gcc-list] RE: inline control

2009-02-16 Thread larry barello
I explicitly inline code with the following attribute #define _INLINE_ static inline __attribute__((always_inline)) For my medium size project (lots of menus/graphics/various sensors and serial port devices) 1) -no-inline-small-function- 69034 2) --param inline-call-cost=2 - 68964 3)

[avr-gcc-list] GCC code gen on xmega

2009-02-16 Thread larry barello
What follows is a pretty typical sequence for a vararg function on the XMEGA. In particular, why does the code generator do the funky double call rather than just subtract the right number from the SP? I am guessing this is a left-over code from the early XMEGA stack handling. Also typical,

RE: [avr-gcc-list] GCC code gen on xmega

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of larry barello Sent: Monday, February 16, 2009 10:37 AM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] GCC

RE: [avr-gcc-list] GCC code gen on xmega

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of larry barello Sent: Monday, February 16, 2009 10:37 AM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] GCC

[avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Thomas D. Dean
I have code producing strange results. The application uses an 8-bit counter and overflow counts to measure distance with an ultrasonic transponder. The overflow and count look Ok. Fitting an equation to experimental data, I get dist = 0.013657 * cnts + -3.996578. Converting the

[avr-gcc-list] Re: Code optimistaion in AVR Tiny13

2009-02-16 Thread David Brown
Ruud Vlaming wrote: On Monday 16 February 2009 15:11, Robert von Knobloch wrote: On inspection I find that the compiler has 'in-lined' at least 3 function calls that I had written as a function to achieve compactness. Is there any way I can stop this, or is this a bug? There has been some

[avr-gcc-list] Re: inline control

2009-02-16 Thread David Brown
larry barello wrote: I explicitly inline code with the following attribute #define _INLINE_ static inline __attribute__((always_inline)) For my medium size project (lots of menus/graphics/various sensors and serial port devices) 1) -no-inline-small-function- 69034 2) --param

Re: [avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Georg-Johann Lay
Thomas D. Dean schrieb: I have code producing strange results. Hi. Your code looks strange, too ;-) distance = =895*distance; [...] 895*distance generates a call to __mulsi3, multiplying r25:22 by r21:18 and returning the result in r25:22. However, I cannot find where r21:18

RE: [avr-gcc-list] Re: inline control

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 2:32 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Re:

RE: [avr-gcc-list] Re: Code optimistaion in AVR Tiny13

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 2:31 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Re: Code

[avr-gcc-list] Re: inline control

2009-02-16 Thread David Brown
Weddington, Eric wrote: -Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 2:32 PM To: avr-gcc-list@nongnu.org Subject:

[avr-gcc-list] Re: Code optimistaion in AVR Tiny13

2009-02-16 Thread David Brown
Weddington, Eric wrote: -Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 2:31 PM To: avr-gcc-list@nongnu.org Subject:

RE: [avr-gcc-list] Re: Code optimistaion in AVR Tiny13

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 5:07 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Re: Code

RE: [avr-gcc-list] Re: inline control

2009-02-16 Thread Weddington, Eric
-Original Message- From: avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. org] On Behalf Of David Brown Sent: Monday, February 16, 2009 5:04 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Re:

Re: [avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Thomas D. Dean
On Mon, 2009-02-16 at 23:37 +0100, Georg-Johann Lay wrote: distance = =895*distance; See my followup message about the typo. distance = 895*distance. [...] 895*distance generates a call to __mulsi3, multiplying r25:22 by r21:18 and returning the result in r25:22.

Re: [avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Joerg Wunsch
Thomas D. Dean tomd...@speakeasy.org wrote: However, I cannot find where r21:18 are set in the code. For me, they always get set right before the call: b6: 29 e2 ldi r18, 0x29 ; 41 b8: 39 e0 ldi r19, 0x09 ; 9 ba: 40 e0 ldi r20,

Re: [avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Thomas D. Dean
On Tue, 2009-02-17 at 07:05 +0100, Joerg Wunsch wrote: So you'd have to explain which compiler version exactly you are using (including patches). I am using the Ubuntu 8.10 package, installed with apt-get. Most likely from the ANL archive. # avr-gcc --version avr-gcc (GCC) 4.3.0 ... #

Re: [avr-gcc-list] Problem With Call to Mulsi3

2009-02-16 Thread Joerg Wunsch
Thomas D. Dean tomd...@speakeasy.org wrote: I am using the Ubuntu 8.10 package, installed with apt-get. Most likely from the ANL archive. # avr-gcc --version avr-gcc (GCC) 4.3.0 Ouch. That's most likely an unpatched GCC 4.3.0, which was known to have many (sic) serious bugs for the AVR