diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2017-04-19 12:20:57 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2017-04-19 12:20:57 +0000 |
commit | 8264e6c39c497349881ee2259451f8ba9f1b8cd9 (patch) | |
tree | 373ff6836ae299fae41908547e6da771100420a6 | |
parent | 664306b9d8b32f6d1fcc6fdd9ba19712d494b3ee (diff) | |
download | gcc-8264e6c39c497349881ee2259451f8ba9f1b8cd9.zip gcc-8264e6c39c497349881ee2259451f8ba9f1b8cd9.tar.gz gcc-8264e6c39c497349881ee2259451f8ba9f1b8cd9.tar.bz2 |
re PR target/80462 ([avr] Incorrect "warning: uninitialized variable 'xxx' put into program memory area" for identical strings)
PR target/80462
* config/avr/avr.c (tree.h): Include it.
(cgraph.h): Include it.
(avr_encode_section_info): Don't warn for uninitialized progmem
variable if it's just an alias.
From-SVN: r246997
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85025d4..1995cd5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-04-19 Georg-Johann Lay <avr@gjlay.de> + + PR target/80462 + * config/avr/avr.c (tree.h): Include it. + (cgraph.h): Include it. + (avr_encode_section_info): Don't warn for uninitialized progmem + variable if it's just an alias. + 2017-04-19 Richard Biener <rguenther@suse.de> PR ipa/65972 diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index dde712c..648a125 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -25,6 +25,8 @@ #include "backend.h" #include "target.h" #include "rtl.h" +#include "tree.h" +#include "cgraph.h" #include "c-family/c-common.h" #include "cfghooks.h" #include "df.h" @@ -10127,9 +10129,14 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p) && !DECL_EXTERNAL (decl) && avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) { - warning (OPT_Wuninitialized, - "uninitialized variable %q+D put into " - "program memory area", decl); + // Don't warn for (implicit) aliases like in PR80462. + tree asmname = DECL_ASSEMBLER_NAME (decl); + varpool_node *node = varpool_node::get_for_asmname (asmname); + bool alias_p = node && node->alias; + + if (!alias_p) + warning (OPT_Wuninitialized, "uninitialized variable %q+D put into " + "program memory area", decl); } default_encode_section_info (decl, rtl, new_decl_p); |