This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,avr] Fix PR80462
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Senthil Kumar Selvaraj <senthilkumar dot selvaraj at microchip dot com>
- Date: Wed, 19 Apr 2017 15:46:34 +0400
- Subject: Re: [patch,avr] Fix PR80462
- Authentication-results: sourceware.org; auth=none
- References: <33edbd36-e09f-63d4-7b5f-1eb149c17a78@gjlay.de>
2017-04-19 14:43 GMT+04:00 Georg-Johann Lay <avr@gjlay.de>:
> This PR is about an incorrect warning for variables in progmem
> without initializer. If the variable is just an alias like in
> and with -fmerge-all-constants
>
> const __flash char string1[] = "same string";
> const __flash char string2[] = "same string";
>
> this will result in an incorrect
>
> warning: uninitialized variable 'string2' put into program memory area
> [-Wuninitialized]
>
> Hence, this patch tests whether the decl is just an alias.
>
> Ok to apply?
>
> Johann
>
> 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.
>
Please apply.