diff mbox

Ping #1: [Patch, AVR]: Fix PR34734

Message ID 4E0B0BB7.9040107@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay June 29, 2011, 11:25 a.m. UTC
Denis Chertykov wrote:
> 2011/6/29 Georg-Johann Lay <avr@gjlay.de>:
>> Denis Chertykov wrote:
>>> 2011/6/28 Georg-Johann Lay <avr@gjlay.de>:
>>>> http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01462.html
>>>>
>>>> Georg-Johann Lay wrote:
>>>>> PR34734 produces annoying, false warnings if __attribute__((progmem))
>>>>> is used in conjunction with C++.  DECL_INITIAL is not yet set up in
>>>>> avr_handle_progmem_attribute.
>>>>>
>>>>> Johann
>>>>>
>>>>>       PR target/34734
>>>>>       * config/avr/avr.c (avr_handle_progmem_attribute): Move warning
>>>>>       about uninitialized data attributed 'progmem' from here...
>>>>>       (avr_encode_section_info): ...to this new function.
>>>>>       (TARGET_ENCODE_SECTION_INFO): New define.
>>>>>       (avr_section_type_flags): For data in ".progmem.data", remove
>>>>>       section flag SECTION_WRITE.
>>>> avr_encode_section_info is good place to emit the warning:
>>>> DECL_INITIAL has stabilized for C++, the warning will appear even for
>>>> unused variables that will eventually be thrown away, and the warning
>>>> appears only once (new_decl_p).
>>> Approved.
>>>
>>> Denis.
>> Is this a patch that should be backported?
>> 4.6?
>> 4.5?
>>
>> It's not fix for "bug or doc" but very annoying, false warning.
> 
> You can backport it if you want.
> 
> I'm usually didn't backport such patches.
> 
> Denis.

Ok, maybe Eric or Anatoly have some preference for 4.5/4.6.

Applied to 4.7 together with following corrigendum:

Comments

Weddington, Eric June 29, 2011, 1:34 p.m. UTC | #1
> -----Original Message-----
> From: Georg-Johann Lay [mailto:avr@gjlay.de]
> Sent: Wednesday, June 29, 2011 5:26 AM
> To: Denis Chertykov
> Cc: gcc-patches@gcc.gnu.org; Weddington, Eric; Anatoly Sokolov
> Subject: Re: Ping #1: [Patch, AVR]: Fix PR34734
> 
> >
> > You can backport it if you want.
> >
> > I'm usually didn't backport such patches.
> >
> > Denis.
> 
> Ok, maybe Eric or Anatoly have some preference for 4.5/4.6.
> 

I would like it for the 4.6 series, if possible. I think that the next releases of the various avr toolchain distributions will very probably be moving up to 4.6.x.

Eric
Georg-Johann Lay June 30, 2011, 1:50 p.m. UTC | #2
Weddington, Eric wrote:
>> -----Original Message-----

>>> You can backport it if you want.
>>> 
>>> I'm usually didn't backport such patches.
>>> 
>>> Denis.
>> Ok, maybe Eric or Anatoly have some preference for 4.5/4.6.
> 
> I would like it for the 4.6 series, if possible. I think that the
> next releases of the various avr toolchain distributions will very
> probably be moving up to 4.6.x.
> 
> Eric

http://gcc.gnu.org/viewcvs/branches/gcc-4_6-branch/gcc/config/avr/avr.c?r1=175706&r2=175704&pathrev=175706

Backported to 4.6 and set PR34734 milestone to 4.6.2.

Johann
diff mbox

Patch

Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c    (revision 175628)
+++ config/avr/avr.c    (working copy)
@@ -5161,7 +5161,7 @@  avr_section_type_flags (tree decl, const
 /* Implement `TARGET_ENCODE_SECTION_INFO'.  */

 static void
-avr_encode_section_info (tree decl, rtx rtl ATTRIBUTE_UNUSED,
+avr_encode_section_info (tree decl, rtx rtl,
                          int new_decl_p)
 {
   /* In avr_handle_progmem_attribute, DECL_INITIAL is not yet
@@ -5177,6 +5177,8 @@  avr_encode_section_info (tree decl, rtx
                "uninitialized variable %q+D put into "
                "program memory area", decl);
     }
+
+  default_encode_section_info (decl, rtl, new_decl_p);
 }