re PR lto/85371 (Compiling code with -g -flto gives an ICE on darwin after revision...
authorRichard Biener <rguenther@suse.de>
Thu, 12 Apr 2018 12:27:14 +0000 (12:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 12 Apr 2018 12:27:14 +0000 (12:27 +0000)
2018-04-12  Richard Biener  <rguenther@suse.de>

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

gcc/ChangeLog
gcc/dwarf2out.c

index 487d40170204ed08395b164a7a75d0d0fa1e60b5..c36052dce55c0b4d1e988a1577c41d4d3a02ac44 100644 (file)
@@ -1,3 +1,12 @@
+2018-04-12  Richard Biener  <rguenther@suse.de>
+
+       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  <jakub@redhat.com>
 
        PR target/85328
index 3e98bc46360cf38fd98823cae6af79104c8b4ed1..f52ec45ec73636271c26bffd2e344882aa7b5d09 100644 (file)
@@ -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.  */