[AVR] Fix PR51756

Submitted by Georg-Johann Lay on Jan. 12, 2012, 3:25 p.m.

Details

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

Commit Message

Georg-Johann Lay Jan. 12, 2012, 3:25 p.m.
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.
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.
http://gcc.gnu.org/viewcvs?view=revision&revision=183131

Patch hide | download patch | download mbox

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,