Message ID | 6d51c0e4-3c0c-6d9b-78a0-241078c19a87@somniumtech.com |
---|---|
State | New |
Headers | show |
Hi Jozef,
> Ok for trunk and gcc-7-branch?
Approved - please apply (to both).
Cheers
Nick
On 13/06/2017 16:54, Nick Clifton wrote: > Hi Jozef, > >> Ok for trunk and gcc-7-branch? > > Approved - please apply (to both). > > Cheers > Nick > > Sorry, didn't mention in that last post that I don't have write access, could someone please apply this for me. Thanks, Jozef
Hi Jozef, > Sorry, didn't mention in that last post that I don't have write access, > could someone please apply this for me. Applied. Sorry about the delay (again). Cheers Nick
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index dd53dea..cdd765b 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -1995,8 +1995,10 @@ msp430_data_attr (tree * node, if (TREE_CODE (* node) != VAR_DECL) message = "%qE attribute only applies to variables"; - if (DECL_SECTION_NAME (* node)) - message = "%qE attribute cannot be applied to variables with specific sections"; + /* Check that it's possible for the variable to have a section. */ + if ((TREE_STATIC (* node) || DECL_EXTERNAL (* node) || in_lto_p) + && DECL_SECTION_NAME (* node)) + message = "%qE attribute cannot be applied to variables with specific sections"; /* If this var is thought to be common, then change this. Common variables are assigned to sections before the backend has a chance to process them. */