From: Richard Biener Date: Thu, 12 Apr 2018 12:27:14 +0000 (+0000) Subject: re PR lto/85371 (Compiling code with -g -flto gives an ICE on darwin after revision... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1566f8942f107774fbe0d41cc5de641175043e7;p=gcc.git re PR lto/85371 (Compiling code with -g -flto gives an ICE on darwin after revision r259317) 2018-04-12 Richard Biener PR lto/85371 * dwarf2out.c (init_sections_and_labels): Use debug_line_section[_label] for the early LTO debug to properly generate references to it during DIE emission. Do not re-use that for the skeleton for split-dwarf. (dwarf2out_early_finish): Likewise. From-SVN: r259345 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 487d4017020..c36052dce55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-04-12 Richard Biener + + PR lto/85371 + * dwarf2out.c (init_sections_and_labels): Use debug_line_section[_label] + for the early LTO debug to properly generate references to it + during DIE emission. Do not re-use that for the skeleton for + split-dwarf. + (dwarf2out_early_finish): Likewise. + 2018-04-12 Jakub Jelinek PR target/85328 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 3e98bc46360..f52ec45ec73 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -28405,14 +28405,6 @@ init_sections_and_labels (bool early_lto_debug) debug_macinfo_section = get_section (debug_macinfo_section_name, SECTION_DEBUG | SECTION_EXCLUDE, NULL); - /* For macro info we have to refer to a debug_line section, so - similar to split-dwarf emit a skeleton one for early debug. */ - debug_skeleton_line_section - = get_section (DEBUG_LTO_LINE_SECTION, - SECTION_DEBUG | SECTION_EXCLUDE, NULL); - ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label, - DEBUG_SKELETON_LINE_SECTION_LABEL, - generation); } else { @@ -28459,6 +28451,13 @@ init_sections_and_labels (bool early_lto_debug) SECTION_DEBUG | SECTION_EXCLUDE, NULL); } + /* For macro info and the file table we have to refer to a + debug_line section. */ + debug_line_section = get_section (DEBUG_LTO_LINE_SECTION, + SECTION_DEBUG | SECTION_EXCLUDE, NULL); + ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, + DEBUG_LINE_SECTION_LABEL, generation); + debug_str_section = get_section (DEBUG_LTO_STR_SECTION, DEBUG_STR_SECTION_FLAGS | SECTION_EXCLUDE, NULL); @@ -31845,7 +31844,7 @@ dwarf2out_early_finish (const char *filename) /* AIX Assembler inserts the length, so adjust the reference to match the offset expected by debuggers. */ - strcpy (dl_section_ref, debug_skeleton_line_section_label); + strcpy (dl_section_ref, debug_line_section_label); if (XCOFF_DEBUGGING_INFO) strcat (dl_section_ref, DWARF_INITIAL_LENGTH_SIZE_STR); @@ -31918,7 +31917,7 @@ dwarf2out_early_finish (const char *filename) switch_to_section (debug_macinfo_section); ASM_OUTPUT_LABEL (asm_out_file, macinfo_section_label); - output_macinfo (debug_skeleton_line_section_label, true); + output_macinfo (debug_line_section_label, true); dw2_asm_output_data (1, 0, "End compilation unit"); if (flag_fat_lto_objects) @@ -31929,8 +31928,8 @@ dwarf2out_early_finish (const char *filename) } /* Emit a skeleton debug_line section. */ - switch_to_section (debug_skeleton_line_section); - ASM_OUTPUT_LABEL (asm_out_file, debug_skeleton_line_section_label); + switch_to_section (debug_line_section); + ASM_OUTPUT_LABEL (asm_out_file, debug_line_section_label); output_line_info (true); /* If we emitted any indirect strings, output the string table too. */