From: Georg-Johann Lay Date: Thu, 12 Jan 2012 17:23:32 +0000 (+0000) Subject: backport: re PR target/51756 (wrong warning: uninitialized variable put into program... X-Git-Tag: releases/gcc-4.6.3~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0b83804a659b7dc853138d5358659e3d4d67fbf;p=thirdparty%2Fgcc.git backport: re PR target/51756 (wrong warning: uninitialized variable put into program memory area) Backport from mainline r183129 PR target/51756 * config/avr/avr.c (avr_encode_section_info): Test for absence of DECL_EXTERNAL when checking for initializers of progmem variables. From-SVN: r183131 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f31e6753ef35..46fcde454180 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ -2012-01-12 Matthew Gretton-Dann +2012-01-12 Georg-Johann Lay + + Backport from mainline r183129 + PR target/51756 + * config/avr/avr.c (avr_encode_section_info): Test for absence of + DECL_EXTERNAL when checking for initializers of progmem variables. + +22012-01-12 Matthew Gretton-Dann Backport from mainline 2012-01-11 Matthew Gretton-Dann diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index b5a61a364500..6c4b517ee30d 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -5154,6 +5154,7 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p) if (new_decl_p && decl && DECL_P (decl) && NULL_TREE == DECL_INITIAL (decl) + && !DECL_EXTERNAL (decl) && avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) { warning (OPT_Wuninitialized,