This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
AVR __progmem__ variable reading
- From: Łukasz Kostka <lukasz dot kostka at netng dot pl>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 22 Feb 2019 23:34:13 +0100
- Subject: AVR __progmem__ variable reading
Hi
I am using for a while now gcc and especially __progmem__ attribute. I’d like to report a feature request for gcc to handle reading from flash memory variables. Compiler has all the knowledge (target device, availability of LPM, ELPM instructions etc.) in order to properly interpret variable is accessed (eg. by array subscription).
This would remove need for any assembly code written to do this.
Make user code much cleaner.
GCC having all this knowledge can optimize end assembly code.
Simple attribute addition will switch from array in memory to array in flash.
Can serve as future implementations for other platforms.
What do you think ?