public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50807] New: [avr]
@ 2011-10-20 10:13 gjl at gcc dot gnu.org
  2011-10-20 10:17 ` [Bug target/50807] [avr] gjl at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-10-20 10:13 UTC (permalink / raw)
  To: gcc-bugs

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".


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-21 14:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-20 10:13 [Bug target/50807] New: [avr] gjl at gcc dot gnu.org
2011-10-20 10:17 ` [Bug target/50807] [avr] gjl at gcc dot gnu.org
2011-10-26 18:00 ` [Bug target/50807] [avr] Constructor writing to RAM for variable in Flash jakub at gcc dot gnu.org
2012-03-01 15:26 ` jakub at gcc dot gnu.org
2013-04-12 16:16 ` jakub at gcc dot gnu.org
2013-06-11 11:43 ` gjl at gcc dot gnu.org
2013-11-10  8:10 ` pinskia at gcc dot gnu.org
2014-09-21 14:36 ` gjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).