+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
#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"
&& !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);