re PR lto/83719 (ICE (segfault) in hash_table<indirect_string_hasher, xcallocator...
authorRichard Biener <rguenther@suse.de>
Mon, 8 Jan 2018 13:13:48 +0000 (13:13 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Jan 2018 13:13:48 +0000 (13:13 +0000)
2018-01-08  Richard Biener  <rguenther@suse.de>

PR lto/83719
* dwarf2out.c (output_indirect_strings): Handle empty
skeleton_debug_str_hash.
(dwarf2out_early_finish): Index strings for -gsplit-dwarf.

* gcc.dg/lto/pr83719_0.c: New testcase.

From-SVN: r256338

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr83719_0.c [new file with mode: 0644]

index b176f6ee0c33d4e1b5d380e76dfd3b7d4ec6471d..0c9d6947d68a8df89592cc41a9800bb0fb479ba0 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-08  Richard Biener  <rguenther@suse.de>
+
+       PR lto/83719
+       * dwarf2out.c (output_indirect_strings): Handle empty
+       skeleton_debug_str_hash.
+       (dwarf2out_early_finish): Index strings for -gsplit-dwarf.
+
 2018-01-08  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * config/arc/arc.c (TARGET_TRAMPOLINE_ADJUST_ADDRESS): Delete.
index ae91c2d750bd773113c45f1dcdb4c2462a389463..a34b294106c42e54c1196e60c5a4e95b1a358d93 100644 (file)
@@ -27795,8 +27795,9 @@ output_indirect_strings (void)
       unsigned int offset = 0;
       unsigned int cur_idx = 0;
 
-      skeleton_debug_str_hash->traverse<enum dwarf_form,
-                                       output_indirect_string> (DW_FORM_strp);
+      if (skeleton_debug_str_hash)
+        skeleton_debug_str_hash->traverse<enum dwarf_form,
+                                         output_indirect_string> (DW_FORM_strp);
 
       switch_to_section (debug_str_offsets_section);
       debug_str_hash->traverse_noresize
@@ -30819,6 +30820,12 @@ dwarf2out_early_finish (const char *filename)
 
   save_macinfo_strings ();
 
+  if (dwarf_split_debug_info)
+    {
+      unsigned int index = 0;
+      debug_str_hash->traverse_noresize<unsigned int *, index_string> (&index);
+    }
+
   /* Output all of the compilation units.  We put the main one last so that
      the offsets are available to output_pubnames.  */
   for (limbo_die_node *node = limbo_die_list; node; node = node->next)
index 04eecf8c1ad746ab5cbbed234d0d3fcb14ddd635..ccc94d1b2a699542cc68dcba4fec8faa7e22cf95 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-08  Richard Biener  <rguenther@suse.de>
+
+       PR lto/83719
+       * gcc.dg/lto/pr83719_0.c: New testcase.
+
 2018-01-08  Tom de Vries  <tom@codesourcery.com>
 
        * gcc.dg/graphite/interchange-7.c: Add dg-require-stack-size.
diff --git a/gcc/testsuite/gcc.dg/lto/pr83719_0.c b/gcc/testsuite/gcc.dg/lto/pr83719_0.c
new file mode 100644 (file)
index 0000000..6d5c16d
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options { { -flto -g -gsplit-dwarf } } } */
+
+/* Empty.  */