https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
--- Comment #13 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > Sure, that works for me. OK, something like this is apparently sufficient: =================================================================== --- cgraphunit.c (revision 259205) +++ cgraphunit.c (working copy) @@ -2700,7 +2700,14 @@ symbol_table::finalize_compilation_unit if (!in_lto_p && g->have_offload) flag_generate_offload = 1; - if (!seen_error ()) + /* FIXME: Disable debug info generation during the LGEN phase of LTO for + PE-COFF targets because the copy_lto_debug_sections operation of the + simple object support in libiberty is not implemented yet. */ + enum debug_info_levels saved_debug_info_level = debug_info_level; + if (TARGET_PECOFF && (flag_generate_lto || flag_generate_offload)) + debug_info_level = DINFO_LEVEL_NONE; + + if (debug_info_level > DINFO_LEVEL_NONE && !seen_error ()) { /* Emit early debug for reachable functions, and by consequence, locally scoped symbols. */ @@ -2716,6 +2723,8 @@ symbol_table::finalize_compilation_unit /* Finally drive the pass manager. */ compile (); + debug_info_level = saved_debug_info_level; + timevar_pop (TV_CGRAPH); }