Hello, I am doing a preliminary analysis for supporting call frame debugging information in avr. (gcc bug 17994). When I build, I am facing ICE in dwarf2out. Obviously the code goes to gcc_unreachable() in the big function: dwarf2out_frame_debug_expr(). Before I proceed further, I would like to know if the call-stack information presented is correct.
I am posting little about the design, patch and error. Version of gcc I am using is 4.4.3 (that got released with AVR Toolchain 3.0.0) Little about design: As per gcc internals, INCOMING_RETURN_ADDR_RTX should defined. Since AVR does not have link register, the resulting address should be obtained from stack top. I define INCOMING_RETURN_ADDR_RTX to avr_incoming_return_addr_rtx() in avr.h which inturn is defined in avr.c as follows: + +/*Call stack information. Implements INCOMING_RETURN_ADDR_RTX + + +-------------------------------+ <--- Frame Pointer(FP) for this frame + | local variables | + |-------------------------------| + |caller frame's frame pointer | + |-------------------------------| + | Return address | + +-------------------------------+ + +*/ + +rtx +avr_incoming_return_addr_rtx (void) +{ + /* Compute return address which is stored on the stack. + Current stack pointer at the begining of frame, before the prologue + execution holds the return address. So our job is done if we get + the stack pointer register value which inturn points to return address + */ + return gen_rtx_MEM (HImode, stack_pointer_rtx); +} + + ICE Error: <snip> ... -g -O2 -mmcu=avr25 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -isystem ./include -DDF=SF -Dinhibit_libc -mcall-prologues -Os -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc -I../../../../libgcc/../include -o _mulvhi3.o -MT _mulvhi3.o -MD -MP -MF _mulvhi3.dep -DL_mulvsi3 -c ../../../../libgcc/../gcc/libgcc2.c \ -DLIBGCC2_UNITS_PER_WORD=2 ../../../../libgcc/../gcc/libgcc2.c: In function '__mulvhi3': ../../../../libgcc/../gcc/libgcc2.c:165: internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2out.c:2323 Please submit a full bug report, Thanks Anitha _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list