Skip to content

Commit 3f98450

Browse files
author
nickc
committed
PR target/80993
* gcc/config/msp430/msp430.c (msp430_attr): Mark interrupt handlers as used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251410 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent 98a6abc commit 3f98450

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

gcc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-08-29 Jozef Lawrynowicz <[email protected]>
2+
3+
PR target/80993
4+
* gcc/config/msp430/msp430.c (msp430_attr): Mark interrupt
5+
handlers as used.
6+
17
2017-08-29 Richard Biener <[email protected]>
28

39
* dwarf2out.c (add_dwarf_attr): When checking is enabled verify

gcc/config/msp430/msp430.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,10 @@ msp430_attr (tree * node,
19041904

19051905
if (! TREE_PUBLIC (* node))
19061906
message = "interrupt handlers cannot be static";
1907+
1908+
/* Ensure interrupt handlers never get optimised out. */
1909+
TREE_USED (* node) = 1;
1910+
DECL_PRESERVE_P (* node) = 1;
19071911
}
19081912
else if (TREE_NAME_EQ (name, ATTR_REENT))
19091913
{
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* { dg-do link } */
2+
/* { dg-options "--save-temps -msim -flto -Os" } */
3+
/* { dg-final { scan-file "pr80993.exe.ltrans0.s" no_ref_handler } } */
4+
5+
void __attribute__((interrupt)) no_ref_handler (void)
6+
{
7+
while (1);
8+
}
9+
10+
int main (void)
11+
{
12+
return 0;
13+
}

0 commit comments

Comments
 (0)