[avr-libc-dev] LPM instructions in optimized code causes unintended behavior in execution

2010-06-16 Thread Thomas Carsten Franke
Hi, I went into a strange situation in xmega128 project after reading from signature or calibration row. I used the pgm_read_byte functions after setting the NVM command accordingly. Both I did with disabled interrupts to prevent any disturbing. I did not restored the NVM CMD because I didn't

Re: [avr-libc-dev] LPM instructions in optimized code causes unintended behavior in execution

2010-06-16 Thread Joerg Wunsch
As Thomas Carsten Franke wrote: I did not restored the NVM CMD because I didn't know that it would has to be. This is correct. We recently added a note to the documentation in the header file avr/pgmspace.h telling that on Xmega devices, all the functions will only work as designed if NVM_CMD

[avr-libc-dev] RE: [avr-libc-commit] [2175] Now that the last member of the avrxmega3architecture is gone, drop

2010-06-16 Thread Weddington, Eric
My apologies for the breakage. And thanks for fixing. Eric -Original Message- From: avr-libc-commit-bounces+eric.weddington=atmel@nongnu.org [mailto:avr-libc-commit-bounces+eric.weddington=atmel@nong nu.org] On Behalf Of Joerg Wunsch Sent: Wednesday, June 16, 2010 1:56

Re: [avr-libc-dev] LPM instructions in optimized code causes unintended behavior in execution

2010-06-16 Thread Joerg Wunsch
As Wouter van Gulik wrote: Although true, I rather think this is a GCC bug. The avr instruction documentation says LPM R31, Z+ has undefined results. In the example it was oke to use LPM R31, Z. IMHO, the respective code is hand-crafted asm code in avr-libc. Please file a bug report. --

Re: [avr-libc-dev] LPM instructions in optimized code causes unintended behavior in execution

2010-06-16 Thread Joerg Wunsch
As Wouter van Gulik wrote: IMHO, the respective code is hand-crafted asm code in avr-libc. Are you sure? The code is about a jump table, is that in avr-libc? Errm, you are right... -- cheers, Jorg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/

Re: [avr-libc-dev] LPM instructions in optimized code causes unintended behavior in execution

2010-06-16 Thread Wouter van Gulik
- Oorspronkelijk bericht - As Wouter van Gulik wrote: Although true, I rather think this is a GCC bug. The avr instruction documentation says LPM R31, Z+ has undefined results. In the example it was oke to use LPM R31, Z. IMHO, the respective code is hand-crafted asm code in