http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994
--- Comment #8 from Anitha Boyapati <anitha.boyapati at atmel dot com> 2011-02-16 08:20:03 UTC --- Created attachment 23360 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23360 Initial fix that emits the output shown in comment 5 (In reply to comment #7) > (In reply to comment #6) > > The reason for ICE is that POST_DEC is not handled in > > dwarf2out_frame_debug_expr(). Fixing that issue will enable the compiler to > > generate the call-stack debug info. > This is handled by properly defining INCOMING_FRAME_SP_OFFSET. > You don't need a POST_DEC in the INCOMING_RETURN_ADDR_RTX definition. > C.f. the i386 versions of these, which set up the exact same sort of > on-stack return address. Going by the internals document, INCOMING_FRAME_SP_OFFSET is already defined but it is not used anywhere (in my patch). Looking at i386, I understand that the return address is stored on the stack much in the same way. However, what I dont understand is the requirement for cfa initialization in prologue expansion. This is something not handled in AVR. > You don't need a POST_DEC in the INCOMING_RETURN_ADDR_RTX definition. INCOMING_RETURN_ADDR_RTX per se is not using POST_DEC. But once they are defined to some values, during the libgcc build, an ICE is hit in dwarf2out_frame_debug_expr(). If POST_DEC mode is defined, ICE disappears. I am yet to understand the relation between the POST_DEC and ICE and why it appears when only CFI is being emitted. Attaching the patch.