http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56593
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-13 09:59:29 UTC --- (In reply to comment #8) > But if you strip that info away, you'll never get correct DWARF debug info for > the nested function, I believe you'll never get it whenever you put the nested > functions in a different partition from the containing function. Because the > nested function must be a child of the parent's DW_TAG_subprogram, if you have > it in different partition, it can't be. Well, I see no good reason to ship end emit both parent and child to every LTRANS unit where either one may be inlined / cloned. As Eric says debug info is quite useless with optimization for nested functions I'd rather strip the info than ICEing (or hacking around the ICE in dwarf2out.c). For LTO / early debug we'd want to emit debug for both together. I still envision sth like emitting a complete dwarf unit at compile-time for each TU, without debug info for the actual code, and ship references to those throughout WPA / LTRANS, where in LTRANS we only emit debug info for the actual code, refering to the abstract info emitted at compile-time. Not sure how those "references" can end up working - eventually we'd need to merge the dwarf trees at final link time for that, or eventually cross-dwarf section relocations are possible ...