re PR target/70713 (msp430 interrupt attribute prevents overriding weak symbols)

2016-09-13  Joe Seymour  <joe.s@somniumtech.com>

gcc/
PR target/70713
* config/msp430/msp430.c (msp430_start_function): Emit an error
if a function is both weak and specifies an interrupt number.

gcc/testsuite/
PR target/70713
* gcc.target/msp430/function-attributes-1.c: New test.
* gcc.target/msp430/function-attributes-2.c: New test.
* gcc.target/msp430/function-attributes-3.c: New test.

From-SVN: r240123
This commit is contained in:
Joe Seymour 2016-09-13 20:06:47 +00:00 committed by DJ Delorie
parent 8e14a10cab
commit a713b234ed
6 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-09-13 Joe Seymour <joe.s@somniumtech.com>
PR target/70713
* config/msp430/msp430.c (msp430_start_function): Emit an error
if a function is both weak and specifies an interrupt number.
2016-09-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/77454

View File

@ -2108,6 +2108,13 @@ msp430_start_function (FILE *file, const char *name, tree decl)
{
char buf[101];
/* Interrupt vector sections should be unique, but use of weak
functions implies multiple definitions. */
if (DECL_WEAK (decl))
{
error ("argument to interrupt attribute is unsupported for weak functions");
}
intr_vector = TREE_VALUE (intr_vector);
/* The interrupt attribute has a vector value. Turn this into a

View File

@ -1,3 +1,10 @@
2016-09-13 Joe Seymour <joe.s@somniumtech.com>
PR target/70713
* gcc.target/msp430/function-attributes-1.c: New test.
* gcc.target/msp430/function-attributes-2.c: New test.
* gcc.target/msp430/function-attributes-3.c: New test.
2016-09-13 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp0x/gen-attrs-61.C: New test.

View File

@ -0,0 +1,9 @@
void __attribute__((weak, interrupt))
weak_interrupt (void) {
}
void __attribute__((interrupt(11)))
interrupt_number (void) {
}
/* { dg-final { scan-assembler-times "__interrupt_vector_" 1 } } */

View File

@ -0,0 +1,3 @@
void __attribute__((weak, interrupt(10)))
weak_interrupt_number (void) {
} /* { dg-error "argument to interrupt attribute is unsupported for weak functions" } */

View File

@ -0,0 +1,3 @@
void __attribute__((interrupt("nmi"))) __attribute__((weak))
interrupt_name_weak (void) {
} /* { dg-error "argument to interrupt attribute is unsupported for weak functions" } */