Re: [avr-gcc-list] volatile...

2006-12-15 Thread Joerg Wunsch
Javier Almansa Sobrino [EMAIL PROTECTED] wrote: I've noted a non volatile variable is like don't exists (I think). A local variable can often be optimized by the compiler into a register, and it will live there only for the short amount of time when its value is really needed. It might not

Re: [avr-gcc-list] volatile...

2006-12-15 Thread David Brown
[EMAIL PROTECTED] wrote: Hello Javier, Javier Almansa Sobrino wrote: Hi everybody. I've a little stupid question What's the differece between a volatile variable in a funcion and the same variable not volatile? I've noted a non volatile variable is like don't exists (I think).

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Graham Davies
David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! On the subject of volatile isn't enough and straying further from AVR, remember that if your machine has a data cache you need to figure out how to not have the cache between

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. Sometimes I don't use volatile at all on the variables, and just use

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Dave Hansen
From: Paulo Marques [EMAIL PROTECTED] Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. You've opened some new cans of

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Dave Hansen wrote: From: Paulo Marques [EMAIL PROTECTED] Graham Davies wrote: David Brown wrote: You are missing a number of points ... Well, I think we're getting close to complete coverage now! Well, since we are going for complete coverage, I'll add my 2 cents, then. You've opened

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Galen Seitz
One more suggestion... If you are using global volatiles shared between an interrupt and mainline code, interrupt handler performance may be improved by moving the volatile into a temporary variable. galen volatile uint16_t counter; SIGNAL(TMR0_OVERFLOW) { uint16_t tmp; tmp =

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Dave Hansen
From: Paulo Marques [EMAIL PROTECTED] Dave Hansen wrote: [...] You've opened some new cans of worms here, but I'll only make one small comment I was afraid of that (the cans of worms, not your comment) ;) Thanks for noticing the implied smiley. Looking at what I wrote, I'm not sure it

Re: [avr-gcc-list] volatile...

2006-12-15 Thread Paulo Marques
Dave Hansen wrote: From: Paulo Marques [EMAIL PROTECTED] [...] But you're actually wrong about the volatile not being needed. Because the sei instruction doesn't claim anything about memory clobbers, without volatile the compiler would be free to re-order instructions and do the sei before

[avr-gcc-list] General tips on patching gcc?

2006-12-15 Thread Rick Mann
Hi. I have 3 main questions: a) I think I found the patches I need to support the at90usbxxx parts. Is this right? http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01001.html b) The email referenced above has a subject prefixed with [AVR][4.2]. As far as I know, the latest release of gcc is

Re: [avr-gcc-list] Help! gcc 4.1.1, dwarf-2 and Atmel USB parts

2006-12-15 Thread Xiaofan Chen
On 12/16/06, Rick Mann [EMAIL PROTECTED] wrote: Sorry for the long preamble. You can skip to the real question below... I'm trying to build one of Atmel's USB samples (the generic HID device) that targets the at90usb1287. According to the documentation, it works with WinAVR 20060421, so at