diff mbox

[AVR] Fix PR51756

Message ID 4F0EFB4D.1070106@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay Jan. 12, 2012, 3:25 p.m. UTC
This PR prints a false warning because missing DECL_EXTERNAL test in
avr_encode_section_info that checks if progmem variables come with initializer
or not.

Ok for trunk?

	PR target/51756
	* config/avr/avr.c (avr_encode_section_info): Test for absence of
	DECL_EXTERNAL when checking for initializers of progmem variables.

Johann

--

Comments

Denis Chertykov Jan. 12, 2012, 4:26 p.m. UTC | #1
2012/1/12 Georg-Johann Lay <avr@gjlay.de>:
> This PR prints a false warning because missing DECL_EXTERNAL test in
> avr_encode_section_info that checks if progmem variables come with initializer
> or not.
>
> Ok for trunk?
>
>        PR target/51756
>        * config/avr/avr.c (avr_encode_section_info): Test for absence of
>        DECL_EXTERNAL when checking for initializers of progmem variables.

Approved.

Denis.
Georg-Johann Lay Jan. 12, 2012, 5:28 p.m. UTC | #2
http://gcc.gnu.org/viewcvs?view=revision&revision=183131
diff mbox

Patch

Index: gcc/config/avr/avr.c
===================================================================
--- gcc/config/avr/avr.c        (revision 183058)
+++ gcc/config/avr/avr.c        (working copy)
@@ -7222,6 +7222,7 @@  avr_encode_section_info (tree decl, rtx
   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,