+++ This bug was initially created as a clone of Bug #31331 +++ On a Mac(Tiger) compilation of a TinyOS standard example application "Blink" does not compile. Please mail me if important information is missing. As I cannot access the MAC I cannot provide the C file created by the Nesc Compiler. make micaz sh: line 1: sha1sum: command not found sh: line 1: sha1sum: command not found mkdir -p build/micaz compiling BlinkAppC to a micaz binary ncc -o build/micaz/main.exe -Os -fnesc-separator=\never1096WritE -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb --param max-inline-insns-single=100000 -I/sw/include/python2.5/ -DIDENT_PROGRAM_NAME=\"BlinkAppC\" -DIDENT_USER_ID=\"admin\" -DIDENT_HOSTNAME=\"macbook-zina.in\" -DIDENT_USER_HASH=0L -DIDENT_UNIX_TIME=0x474aa64cL -DIDENT_UID_HASH=0L -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm /sw/tinyos-2.x/tinyos-2.x/tos/chips/atm128/timer/HplAtm128Timer0AsyncP.nc:178: internal compiler error: in start_function, at c-decl.c:6177 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. make: *** [exe0] Error 1 The NesC Compiler involved is: nescc: 1.2.9 gcc -_fnesc-gcc=gcc -specs=/opt/tinyostools//lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/opt/tinyostools//lib/ncc -v -DNESC=129 Using built-in specs. Reading specs from /opt/tinyostools//lib/ncc/tdspecs Target: i386-apple-darwin8.10.1 Configured with: ../gcc-4.2.2/configure --prefix=/opt/local --enable-languages=c,c++,java,objc,obj-c++,fortran --libdir=/opt/local/lib/gcc42 --includedir=/opt/local/include/gcc42 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --with-local-prefix=/opt/local --with-system-zlib --disable-nls --disable-multilib --program-suffix=-mp-4.2 --with-gxx-include-dir=/opt/local/include/gcc42/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local Thread model: posix gcc version 4.2.2 avr-gcc -v produces: Using built-in specs. Target: avr Configured with: ../configure --target=avr --prefix=/opt/tinyostools/ --disable-nls --enable-languages=c --disable-libsp : (reconfigured) ../configure --target=avr --prefix=/opt/tinyostools/ --disable-nls --enable-languages=c --disable-libssp Thread model: single gcc version 4.2.2
Can you attach the preprocessed source?
The subject line of this bug is the same subject as bug #31331, which is fixed. Without having the preprocessed source it is difficult to determine if this bug is a duplicate.
Some bugs appear to re-appear. :-( While I get __attribute__((naked)) int main(void) { // ... return 42; } to compile with the current compiler, the following piece of code: __attribute__((signal, naked)) void __vector_42(void) { static unsigned char x; x++; } still triggers the ICE: % avr-gcc -mmcu=attiny2313 -S foo.c foo.c:3: internal compiler error: in start_function, at c-decl.c:6177
(In reply to comment #3) > __attribute__((signal, naked)) > void __vector_42(void) > { > static unsigned char x; > > x++; > } > > still triggers the ICE: However, if there is a function prototype, and the attributes are placed on the prototype, there is no bug: __attribute__((signal, naked)) void __vector_42(void); void __vector_42(void) { static unsigned char x; x++; } Is it really a bug?
If there is an ICE, there is a bug.
*** Bug 38954 has been marked as a duplicate of this bug. ***
*** Bug 39307 has been marked as a duplicate of this bug. ***
Sorry for the dup. This bug prevents compilation of almost all TinyOS apps using 4.3.3! Is there a workaround?
(In reply to comment #8) > Sorry for the dup. > > This bug prevents compilation of almost all TinyOS apps using 4.3.3! Is there > a workaround? > See comment #4 of this bug.
Created attachment 17370 [details] patch for bug 34299 DECL_ASSEMBLER_NAME has a side effect of setting assembler_name for functions if that attribute is missing, which causes the assertion failure in c-decl.c. Change it to less harmful DECL_NAME.
Subject: Re: [avr] ICE on function attribute syntax for main() Great! John jxyang at cs dot utah dot edu wrote: > ------- Comment #10 from jxyang at cs dot utah dot edu 2009-02-26 23:24 ------- > Created an attachment (id=17370) > --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17370&action=view) > patch for bug 34299 > > DECL_ASSEMBLER_NAME has a side effect of setting assembler_name for functions > if that attribute is missing, which causes the assertion failure in c-decl.c. > > Change it to less harmful DECL_NAME. > >
2007-04-05 Anatoly Sokolov <aesok@post.ru> PR target/25448 * config/avr/avr.c (avr_handle_fndecl_attribute): Use the DECL_ASSEMBLER_NAME, not the DECL_NAME.
*** Bug 38558 has been marked as a duplicate of this bug. ***
Subject: Bug 34299 Author: aesok Date: Sun Mar 15 13:09:44 2009 New Revision: 144870 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144870 Log: PR target/34299 * config/avr/avr.c (avr_handle_fndecl_attribute): Move code for generate a warning if the function name does not begin with "__vector" and the function has either the 'signal' or 'interrupt' attribute, from here to ... (avr_declare_function_name): ...here. New function. * config/avr/avr.h (ASM_DECLARE_FUNCTION_NAME): Redefine. * config/avr/avr-protos.h (avr_declare_function_name): Declare. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr-protos.h trunk/gcc/config/avr/avr.c trunk/gcc/config/avr/avr.h
Fixed.