Commit 8264e6c3 by Georg-Johann Lay Committed by Georg-Johann Lay

re PR target/80462 ([avr] Incorrect "warning: uninitialized variable 'xxx' put…

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
parent 664306b9
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> 2017-04-19 Richard Biener <rguenther@suse.de>
PR ipa/65972 PR ipa/65972
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "backend.h" #include "backend.h"
#include "target.h" #include "target.h"
#include "rtl.h" #include "rtl.h"
#include "tree.h"
#include "cgraph.h"
#include "c-family/c-common.h" #include "c-family/c-common.h"
#include "cfghooks.h" #include "cfghooks.h"
#include "df.h" #include "df.h"
...@@ -10127,9 +10129,14 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p) ...@@ -10127,9 +10129,14 @@ avr_encode_section_info (tree decl, rtx rtl, int new_decl_p)
&& !DECL_EXTERNAL (decl) && !DECL_EXTERNAL (decl)
&& avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) && avr_progmem_p (decl, DECL_ATTRIBUTES (decl)))
{ {
warning (OPT_Wuninitialized, // Don't warn for (implicit) aliases like in PR80462.
"uninitialized variable %q+D put into " tree asmname = DECL_ASSEMBLER_NAME (decl);
"program memory area", 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); default_encode_section_info (decl, rtl, new_decl_p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment