//avr-gcc -mmcu=atmega32u4 -S -O2 -o - progtest1.c
#include <avr/pgmspace.h>
const char a = 100;
% avr-gcc -mmcu=atmega32u4 -O2 -S -o - vartest1.c
.file "vartest1.c"
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__SREG__ = 0x3f
__tmp_reg__ = 0
__zero_reg__ = 1
.text
.global a
.section .rodata
.type a, @object
.size a, 1
a:
.byte 100
.ident "GCC: (Homebrew AVR GCC 8.4.0_2) 8.4.0"
.global __do_copy_data
//avr-gcc -mmcu=atmega32u4 -S -O2 -o - progtest2.c
#include <avr/pgmspace.h>
const char b PROGMEM = 101;
% avr-gcc -mmcu=atmega32u4 -O2 -S -o - vartest2.c
.file "vartest2.c"
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__SREG__ = 0x3f
__tmp_reg__ = 0
__zero_reg__ = 1
.text
.global b
.section .progmem.data,"a",@progbits
.type b, @object
.size b, 1
b:
.byte 101
.ident "GCC: (Homebrew AVR GCC 8.4.0_2) 8.4.0"
<avr/pgmspace.h>
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
#define PROGMEM __ATTR_PROGMEM__