From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17182 invoked by alias); 18 Dec 2003 06:45:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17175 invoked by uid 48); 18 Dec 2003 06:45:49 -0000 Date: Thu, 18 Dec 2003 06:47:00 -0000 From: "ken at realtronix dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20031218064547.13428.ken@realtronix.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/13428] New: gcc-avr doesn't work properly with PGM string X-Bugzilla-Reason: CC X-SW-Source: 2003-12/txt/msg01877.txt.bz2 List-Id: gcc version as: Configured with: ../configure --prefix=/e/avrdev/install --target=avr --enable- languages=c,c++ --disable-nls --enable-win32-registry=WinAVR Thread model: single gcc version 3.3.1 demo program as: #include #include #include const char foo[] PROGMEM = "foo"; const char bar[] PROGMEM = "bar"; PGM_P Langs[2] PROGMEM = {foo, bar}; int main(void) { unsigned char i; char buf[2][5]; //strcpy_P works fine with constant index strcpy_P(buf[0], Langs[0]); //correctly copy 'foo' strcpy_P(buf[1], Langs[1]); //correctly copy 'bar' //but strcpy_P copy char from wrong address if use variable indexing for (i=0; i<2; i++) strcpy_P(buf[i], Langs[i]); //copy garbages!!! return 1; } -- Summary: gcc-avr doesn't work properly with PGM string Product: gcc Version: 3.3.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ken at realtronix dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13428