This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50807] New: [avr]
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Oct 2011 10:12:21 +0000
- Subject: [Bug target/50807] New: [avr]
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50807
Bug #: 50807
Summary: [avr]
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gjl@gcc.gnu.org
CC: eric.weddington@atmel.com
Target: avr
The following line of code
const char __attribute__((progmem)) var = "Hallo"[0];
compileds with
avr-g++ progmem.c -S -Os
compiles code that tries to initialize var at run time:
.section .text.startup,"ax",@progbits
.type _GLOBAL__sub_I_progmem.c, @function
_GLOBAL__sub_I_progmem.c:
ldi r24,lo8(72)
sts _ZL3var,r24
ret
.size _GLOBAL__sub_I_progmem.c, .-_GLOBAL__sub_I_progmem.c
.global __do_global_ctors
.section .ctors,"a",@progbits
.word gs(_GLOBAL__sub_I_progmem.c)
.local _ZL3var
.comm _ZL3var,1,1
As var is located in flash and thus cannot be initialized at runtime, there
should be an error message like
"progmem variable var cannot be initialized at load time".