The program source is trivial (yes, I've attached the .ii file as well):
   #include <avr/pgmspace.h>
   prog_uchar foo [10][10] = { 0 };
When compiled with g++ 4.3.0, this does not actually put the data in program
space.
BillW-MacOSX<1063> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-g++
pgmspace.c -mmcu=atmega168 -c -o pgmspace43c++.o --version
avr-g++ (GCC) 4.3.0
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

BillW-MacOSX<1064> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-g++
pgmspace.c -mmcu=atmega168 -c -o pgmspace43c++.o         
BillW-MacOSX<1065> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-size
pgmspace43c++.o
   text    data     bss     dec     hex filename
      0       0     100     100      64 pgmspace43c++.o 

It works correctly with gcc 4.3.0 (from the same distribution), and it works
correctly with g++ 4.1

BillW-MacOSX<1060> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-gcc
pgmspace.c -mmcu=atmega168 -c -o pgmspace43cc.o --version
avr-gcc (GCC) 4.3.0
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

BillW-MacOSX<1061> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-gcc
pgmspace.c -mmcu=atmega168 -c -o pgmspace43cc.o
BillW-MacOSX<1062> /Downloads/arduino-0012/hardware/tools/avr/bin/avr-size
pgmspace43cc.o
   text    data     bss     dec     hex filename
    100       0       0     100      64 pgmspace43cc.o
BillW-MacOSX<1063>


-- 
           Summary: __attribute__((__progmem__)) not propagated from typedef
                    to data
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: westfw at yahoo dot com
GCC target triplet: avr


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

Reply via email to