[Bug target/50733] avr-gcc 4.3.5 generates incorrect code when using PROGMEM macro
wek at host dot sk
gcc-bugzilla@gcc.gnu.org
Wed Oct 19 11:01:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50733
Jan Waclawek <wek at host dot sk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wek at host dot sk
--- Comment #1 from Jan Waclawek <wek at host dot sk> 2011-10-19 11:01:13 UTC ---
You cannot access variables placed into FLASH using the PROGMEM macro simply by
their name as if they would be normal variables (which are located in RAM). You
have to use dedicated functions such as pgm_read_byte() prototyped in
<avr/pgmspace.h>
Please refer to the relevant portions of avr-libc user manual
http://www.nongnu.org/avr-libc/user-manual/pgmspace.html and/or the PROGMEM
tutorial on avrfreaks.net
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=38003&start=all&postdays=0&postorder=asc
More information about the Gcc-bugs
mailing list