public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/49868] New: Implement named address space to place/access data in flash memory
@ 2011-07-27 12:45 gjl at gcc dot gnu.org
  2011-08-04 13:51 ` [Bug target/49868] " gjl at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-07-27 12:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49868

           Summary: Implement named address space to place/access data in
                    flash memory
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
                CC: eric.weddington@atmel.com
            Target: avr


Created attachment 24841
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24841
Sample code to show usage of __pgm address space.

AVR is Harvard architecture and it need special instructions to read data from
flash (LPM) which are different to the instructions needed to read data from
RAM.

The address space is not linearized.  Linearizing the address space at the
compiler level is not really wanted because this would mean gread deal of
overhead and incompatibility with current implementation.

The current situation is this:

To put data in flash storage (section .progmem.data) there is a decl attribute
"progmem".  To access the data, inline assembly is used, e.g. by means of
pgm_read_* functions supplied by avr-libc.

A Named Address Space enales to write type-safe code that is not cluttered up
with inline assembly access functions all over the place.

Moreover, some optimizations like PR49857 (Put constant switch-tables into
flash) and PR43745 (Put VTABLES into flash) need named addresses to express the
flash-access inside GCC.


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

end of thread, other threads:[~2012-03-22 14:49 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 12:45 [Bug target/49868] New: Implement named address space to place/access data in flash memory gjl at gcc dot gnu.org
2011-08-04 13:51 ` [Bug target/49868] " gjl at gcc dot gnu.org
2011-10-07 15:23 ` gjl at gcc dot gnu.org
2011-10-07 15:25 ` gjl at gcc dot gnu.org
2011-10-07 15:29 ` gjl at gcc dot gnu.org
2011-10-20 14:36 ` eric.weddington at atmel dot com
2011-10-20 15:19 ` gjl at gcc dot gnu.org
2011-11-15  9:36 ` gjl at gcc dot gnu.org
2011-11-18 17:00 ` gjl at gcc dot gnu.org
2011-11-18 23:08 ` gjl at gcc dot gnu.org
2011-12-06 14:41 ` gjl at gcc dot gnu.org
2011-12-15 16:38 ` gjl at gcc dot gnu.org
2011-12-15 19:09 ` gjl at gcc dot gnu.org
2012-01-10  9:43 ` gjl at gcc dot gnu.org
2012-01-20 12:39 ` gjl at gcc dot gnu.org
2012-01-20 13:01 ` gjl at gcc dot gnu.org
2012-01-24 13:18 ` gjl at gcc dot gnu.org
2012-01-25 19:09 ` gjl at gcc dot gnu.org
2012-02-28  8:45 ` gjl at gcc dot gnu.org
2012-03-12 17:56 ` gjl at gcc dot gnu.org
2012-03-20 11:49 ` gjl at gcc dot gnu.org
2012-03-22 15:04 ` 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).