public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/2] [MSP430] Fix issues handling .persistent attribute (PR 78818)
@ 2017-05-17 15:40 Jozef Lawrynowicz
  0 siblings, 0 replies; only message in thread
From: Jozef Lawrynowicz @ 2017-05-17 15:40 UTC (permalink / raw)
  To: gcc-patches

The MSP430 target supports an attribute "persistent" that can be set
on variables to indicate that they should be placed in a special
section ".persistent", which will not be re-initialized on reset.

As reported in PR78818
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78818), GCC does not
place variables with the persistent attribute in the .persistent
section if:
1) If -fdata-sections is used.
2) If -mdata-region={lower,upper,either} is used.
3) They are static and initialized to 0 (or uninitialized).

The first of the two following patch fixes these issues by always
setting the section of a variable with the .persistent attribute to
.persistent.

The second patch adds a warning if the persistent attribute is used on
an automatic variable, to warn that this will have no effect.

The patches passed regression testing with "-mcpu=msp430x/-mlarge" for
msp430-elf on the gcc-6-branch (r247086). Trunk doesn't build with C++
support for msp430-elf which is why gcc-6-branch was used.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-17 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17 15:40 [PATCH 0/2] [MSP430] Fix issues handling .persistent attribute (PR 78818) Jozef Lawrynowicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).