]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/51756 (wrong warning: uninitialized variable put into program...
authorGeorg-Johann Lay <avr@gjlay.de>
Thu, 12 Jan 2012 17:23:32 +0000 (17:23 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Thu, 12 Jan 2012 17:23:32 +0000 (17:23 +0000)
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

gcc/ChangeLog
gcc/config/avr/avr.c

index f31e6753ef355140c4cc9dd075635e8bcbee70c8..46fcde4541803f8a3646d99fb3f9062a60743828 100644 (file)
@@ -1,4 +1,11 @@
-2012-01-12  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+2012-01-12  Georg-Johann Lay  <avr@gjlay.de>
+
+       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  <matthew.gretton-dann@arm.com>
 
        Backport from mainline
        2012-01-11  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
index b5a61a36450001d072f2d2c22d8a5e9bad0e2141..6c4b517ee30da7f94124c13e72fe4878f72da6e9 100644 (file)
@@ -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,