diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2018-06-06 11:49:20 +0000 |
---|---|---|
committer | Jozef Lawrynowicz <jozefl@gcc.gnu.org> | 2018-06-06 11:49:20 +0000 |
commit | d71488c017b4ebb932cf2b4a43656e1eda670b23 (patch) | |
tree | 462308a806f1c8964920dce9f4e931c9209bdc9e /gcc/config/msp430 | |
parent | 7db54ccd8a2b8a2c89f9cf38f716974aac27fa62 (diff) | |
download | gcc-d71488c017b4ebb932cf2b4a43656e1eda670b23.zip gcc-d71488c017b4ebb932cf2b4a43656e1eda670b23.tar.gz gcc-d71488c017b4ebb932cf2b4a43656e1eda670b23.tar.bz2 |
MSP430: Allow interrupt handlers to be static
* gcc/config/msp430/msp430.c (msp430_attr): Allow interrupt handlers
to be static and remove check on interrupt attribute name.
gcc/testsuite/gcc.target/msp430/
* function-attributes-4.c: New test.
* static-interrupts.c: New test.
From-SVN: r261229
Diffstat (limited to 'gcc/config/msp430')
-rw-r--r-- | gcc/config/msp430/msp430.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index 8c8e676..9051761 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -1878,11 +1878,9 @@ msp430_attr (tree * node, { gcc_assert (DECL_P (* node)); + /* Only the interrupt attribute takes an argument. */ if (args != NULL) { - /* Only the interrupt attribute takes an argument. */ - gcc_assert (TREE_NAME_EQ (name, ATTR_INTR)); - tree value = TREE_VALUE (args); switch (TREE_CODE (value)) @@ -1927,13 +1925,12 @@ msp430_attr (tree * node, if (TREE_CODE (TREE_TYPE (* node)) == FUNCTION_TYPE && ! VOID_TYPE_P (TREE_TYPE (TREE_TYPE (* node)))) message = "interrupt handlers must be void"; - - if (! TREE_PUBLIC (* node)) - message = "interrupt handlers cannot be static"; - - /* Ensure interrupt handlers never get optimised out. */ - TREE_USED (* node) = 1; - DECL_PRESERVE_P (* node) = 1; + else + { + /* Ensure interrupt handlers never get optimised out. */ + TREE_USED (* node) = 1; + DECL_PRESERVE_P (* node) = 1; + } } else if (TREE_NAME_EQ (name, ATTR_REENT)) { |