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

2010-06-17 Thread Wouter van Gulik
Joerg Wunsch schreef: 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... We should probably file a bug report at binutils as well. gas is excepting an

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

2010-06-17 Thread Wouter van Gulik
Wouter van Gulik schreef: Joerg Wunsch schreef: 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... We should probably file a bug report at binutils as well.

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

2010-06-17 Thread Wouter van Gulik
- Oorspronkelijk bericht - 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

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

2010-06-17 Thread Wouter van Gulik
On 17/06/10 10:15, Thomas Carsten Franke wrote: Am 17.06.2010 09:38, schrieb Wouter van Gulik: Wouter van Gulik schreef: Joerg Wunsch schreef: As Wouter van Gulik wrote: IMHO, the respective code is hand-crafted asm code in avr-libc. Are you sure?

[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

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