PR target/80993
* gcc/config/msp430/msp430.c (msp430_attr): Mark interrupt
handlers as used.
From-SVN: r251410
+2017-08-29 Jozef Lawrynowicz <jozef.l@somniumtech.com>
+
+ PR target/80993
+ * gcc/config/msp430/msp430.c (msp430_attr): Mark interrupt
+ handlers as used.
+
2017-08-29 Richard Biener <rguenther@suse.de>
* dwarf2out.c (add_dwarf_attr): When checking is enabled verify
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 if (TREE_NAME_EQ (name, ATTR_REENT))
{
--- /dev/null
+/* { dg-do link } */
+/* { dg-options "--save-temps -msim -flto -Os" } */
+/* { dg-final { scan-file "pr80993.exe.ltrans0.s" no_ref_handler } } */
+
+void __attribute__((interrupt)) no_ref_handler (void)
+{
+ while (1);
+}
+
+int main (void)
+{
+ return 0;
+}