This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
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>
Created an attachment (id=16797) [edit] output from g++ -v
Created an attachment (id=16798) [edit] pgmspace.ii for the failing g++ compilation Actual compile command: /Downloads/arduino-0012/hardware/tools/avr/bin/avr-g++ pgmspace.c -mmcu=atmega168 -c -o pgmspace43c++.o -save-temps -v >&foo.out
Bug has been reproduced on at least two hosts. See also avrfreaks discussion: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=515859#515859
Note that this is a GCC 4.3.x regression; GCC 4.2.x compiled the code the way expected.
GCC 4.3.3 is being released, adjusting target milestone.
GCC 4.3.4 is being released, adjusting target milestone.