Fix problems with the MSP430 port's handling of persistent data.
authorJozef Lawrynowicz <jozef.l@somniumtech.com>
Thu, 15 Jun 2017 13:38:52 +0000 (13:38 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 15 Jun 2017 13:38:52 +0000 (13:38 +0000)
commit61f5d85294a6a2757a1ab870c6f335e092c0c83a
treec687e904fefd96cf91a4784dfa2a87fc8ed968e4
parent0948d23fffba754853cc93984e106d2aaf9a3897
Fix problems with the MSP430 port's handling of persistent data.

PR target/78818
gcc * config/msp430/msp430.c (msp430_data_attr): Check that it's possible
for a variable to have a section before checking if the section has a
name.
Set section to.persistent if persistent attribute is set.
Warn if .persistent attribute is used on an automatic variable.

tests * gcc.target/msp430/pr78818-real.c: New template for tests.
* gcc.target/msp430/pr78818-auto.c: New test.
* gcc.target/msp430/pr78818-data-region.c: New test.
* gcc.target/msp430/pr78818-data-sec.c: New test.
* gcc.target/msp430/pr78818-auto-warn.c: New test.

From-SVN: r249222
gcc/ChangeLog
gcc/config/msp430/msp430.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/msp430/pr78818-auto-warn.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/pr78818-auto.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/pr78818-data-region.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/pr78818-data-sec.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/pr78818-real.c [new file with mode: 0644]