From 248c10bf822b18d9e728e6b92391b17f5c9fa75f Mon Sep 17 00:00:00 2001 From: gjl Date: Thu, 11 Jul 2013 08:41:13 +0000 Subject: [PATCH] gcc/ PR target/57631 * config/avr/avr.c (avr_set_current_function): Sanity-check signal name seen by assembler/linker rather if available. gcc/testsuite/ PR target/57631 * gcc.target/avr/torture/pr57631.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200901 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/avr/avr.c | 7 ++++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/avr/torture/pr57631.c | 17 +++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/avr/torture/pr57631.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f6c55a..298fc1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-07-11 Georg-Johann Lay + + PR target/57631 + * config/avr/avr.c (avr_set_current_function): Sanity-check signal + name seen by assembler/linker rather if available. + 2013-07-11 Andreas Schwab * config/aarch64/aarch64-linux.h (CPP_SPEC): Define. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 8a602a4..f8a43e5 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -584,7 +584,12 @@ avr_set_current_function (tree decl) { tree args = TYPE_ARG_TYPES (TREE_TYPE (decl)); tree ret = TREE_TYPE (TREE_TYPE (decl)); - const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); + const char *name; + + name = DECL_ASSEMBLER_NAME_SET_P (decl) + /* Remove the leading '*' added in set_user_assembler_name. */ + ? 1 + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) + : IDENTIFIER_POINTER (DECL_NAME (decl)); /* Silently ignore 'signal' if 'interrupt' is present. AVR-LibC startet using this when it switched from SIGNAL and INTERRUPT to ISR. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d14d49c..7d5558d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-07-11 Georg-Johann Lay + + PR target/57631 + * gcc.target/avr/torture/pr57631.c: New test. + 2013-07-10 Paolo Carlini PR c++/57827 diff --git a/gcc/testsuite/gcc.target/avr/torture/pr57631.c b/gcc/testsuite/gcc.target/avr/torture/pr57631.c new file mode 100644 index 0000000..ecefbfc --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/pr57631.c @@ -0,0 +1,17 @@ +/* PR target/57631 */ +/* { dg-do compile } */ + +void __attribute__((signal)) func1 (void) __asm ("__vector1"); +void func1 (void) +{ +} + +void __attribute__((signal)) func2 (void) __asm ("__vecto1"); +void func2 (void) /* { dg-warning "misspelled signal handler" } */ +{ +} + +void __attribute__((signal)) __vector_3 (void) __asm ("__vecto1"); +void __vector_3 (void) /* { dg-warning "misspelled signal handler" } */ +{ +} -- 2.7.4