I use WinAVR Version 20070525 to compile a program which must run on a FPSLIC.
Everything works fine, but when reading data that I stored in program space (PROGMEM) I read the wrong data.
Looking at the listing file, the GCC created the following code to read from program space:
The ld instruction is used to load data from data space and not program space.
Shouldn't the GCC used the LPM instruction, like so:?
Reading the avr-lic-user-manual, they say under 6.14 (pgmspace.h> that the target must support the LPM instruction. The FPSLIC does support the LPM instruction.
So why does GCC created the wrong code?