aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-01-08 13:13:48 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-01-08 13:13:48 +0000
commit131a0e78b01cf4a280d0ad861e75ef35eb050d29 (patch)
treee5595f68928e3529c93f816e4f49aa7c96cc5656 /gcc/dwarf2out.c
parent4135a21f4dc1b490446722a40ce113a0f7a28305 (diff)
downloadgcc-131a0e78b01cf4a280d0ad861e75ef35eb050d29.zip
gcc-131a0e78b01cf4a280d0ad861e75ef35eb050d29.tar.gz
gcc-131a0e78b01cf4a280d0ad861e75ef35eb050d29.tar.bz2
re PR lto/83719 (ICE (segfault) in hash_table<indirect_string_hasher, xcallocator>::elements())
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ae91c2d..a34b294 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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)