This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)
- From: Martin Sebor <msebor at gmail dot com>
- To: Jozef Lawrynowicz <jozef dot l at somniumtech dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 May 2017 09:46:41 -0600
- Subject: Re: [PATCH 2/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)
- Authentication-results: sourceware.org; auth=none
- References: <CAG7Dreagw3nVE9w8Wa=CerM0xcC1UT8xSQb_GfSVe03aBGpjrA@mail.gmail.com>
On 05/17/2017 09:45 AM, Jozef Lawrynowicz wrote:
Add warning to back end and add test.
Patch is attached.
If the patch is acceptable, I would appreciate if someone could commit
it for me as I do not have write access.
2017-05-XX Jozef Lawrynowicz <jozef.l@somniumtech.com>
gcc/
PR target/78818
* config/msp430/msp430.c (msp430_unique_section): Warn if .persistent
attribute is used on an automatic variable.
+ if (!message && TREE_NAME_EQ (name, ATTR_PERSIST) && !TREE_STATIC (*
node)
+ && !TREE_PUBLIC (* node) && !DECL_EXTERNAL (* node))
+ message = "%qE attribute has no effect on automatic variables";
In code like this (both existing and new) where the format string
is being assigned to a pointer that is then passed to one of the
diagnostic functions, I believe the string literal needs to wrapped
in G_() so that it can be translated.
Martin