Created attachment 31387 [details] isr.c: The C source Following source will throw a warning if compiled, e.g., $ avr-gcc isr.c -mmcu=atmega8 -flto #define __INTR_ATTRS used, externally_visible #define ISR(vector,...) \ void vector (void) __attribute__ ((signal,__INTR_ATTRS)) __VA_ARGS__; \ void vector (void) #define ADC_vect __vector_14 ISR (ADC_vect) { } int main() { return 0; } The defines are copy-pased from AVR-Libc and are the most common way to define interrupt service routines: Use ISR() with a isr vector name. The warning is: In function '__vector_14': isr.c:10:1: warning: '_vector_14' appears to be a misspelled signal handler [enabled by default] ISR (ADC_vect) ^
Created attachment 31898 [details] pr59396.diff: Tentative patch for avr.c PR target/59396 * config/avr/avr.c (avr_set_current_function): If the first char of the function name is skipped, make sure it is actually '*'.
http://gcc.gnu.org/ml/gcc-patches/2013-12/msg00529.html Issue will occur since r200901 (trunk), r200902 (4.8.2) , r200903 (4.7.4).
Is there a simple workaround until this is fixed?
(In reply to Martin Nowak from comment #3) > Is there a simple workaround until this is fixed? None that I know of, at least if you don't want to change the sources. As the patch above has not been approved, it's unlikely this will ever get fixed...
(In reply to Georg-Johann Lay from comment #4) > As the patch above has not been approved, it's unlikely this will ever get > fixed... This should have a high priority, it makes LTO completely unusable on AVR.
(In reply to Martin Nowak from comment #5) > (In reply to Georg-Johann Lay from comment #4) > > As the patch above has not been approved, it's unlikely this will ever get > > fixed... > > This should have a high priority, it makes LTO completely unusable on AVR. Isn't it just a warning?
(In reply to Martin Nowak from comment #5) > This should have a high priority, it makes LTO completely unusable on AVR. I've been building with LTO for AVR without issue. The warning is purely cosmetic. If you're worried about not being able to build with -Werror (since this can't be suppressed), you could split your compile and link steps into separate commands: $ avr-gcc -Wall -Werror -mmcu=atmega8 -flto -c isr.c -o isr.o $ avr-gcc -mmcu=atmega8 -flto isr.o -o isr In function '__vector_14': isr.c:10:1: warning: '_vector_14' appears to be a misspelled signal handler [enabled by default] ISR (ADC_vect) ^ You could even do something fancy by piping the linker output to sed/grep/awk to filter out the bogus warning. Not sure if this is relevant, but the warning only comes up during linking, while any actually misspelled handlers will come up during compile. To show this even better, misspell ADC_vect in the initial example. You actually get the warning twice: isr.c: In function 'AD_vect': isr.c:10:6: warning: 'AD_vect' appears to be a misspelled signal handler [enabled by default] ISR (AD_vect) ^ isr.c:5:10: note: in definition of macro 'ISR' void vector (void) ^ In function 'AD_vect': isr.c:10:1: warning: 'D_vect' appears to be a misspelled signal handler [enabled by default] ISR (AD_vect) ^
(In reply to Martin Nowak from comment #5) > (In reply to Georg-Johann Lay from comment #4) > > As the patch above has not been approved, it's unlikely this will ever get > > fixed... > > This should have a high priority, it makes LTO completely unusable on AVR. avr itself is an architecture that hat not a high priority in the GCC project, thus all avr issues are P4 or P5. And this is just a warning that occurs during the LTO run. Try to add -w to the lto1 run, i.e. to your link step.
Author: gjl Date: Fri Mar 14 09:27:19 2014 New Revision: 208562 URL: http://gcc.gnu.org/viewcvs?rev=208562&root=gcc&view=rev Log: PR target/59396 * config/avr/avr.c (avr_set_current_function): Pass function name through default_strip_name_encoding before sanity checking instead of skipping the first char of the assembler name. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr.c
Author: gjl Date: Fri Mar 14 09:41:51 2014 New Revision: 208564 URL: http://gcc.gnu.org/viewcvs?rev=208564&root=gcc&view=rev Log: Backport from 2014-03-14 trunk r208562. PR target/59396 * config/avr/avr.c (avr_set_current_function): Pass function name through default_strip_name_encoding before sanity checking instead of skipping the first char of the assembler name. Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/config/avr/avr.c
Author: gjl Date: Fri Mar 14 09:52:07 2014 New Revision: 208565 URL: http://gcc.gnu.org/viewcvs?rev=208565&root=gcc&view=rev Log: Backport from 2014-03-14 trunk r208562. PR target/59396 * config/avr/avr.c (avr_set_current_function): Pass function name through default_strip_name_encoding before sanity checking instead of skipping the first char of the assembler name. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/avr/avr.c
Fixed in 4.8.3.