From: H.J. Lu Date: Fri, 24 Aug 2018 11:28:40 +0000 (+0000) Subject: DWARF: Call set_indirect_string on DW_MACINFO_start_file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ade64c9d8cd37c8db0a07383189f1719c7164da;p=gcc.git DWARF: Call set_indirect_string on DW_MACINFO_start_file Since -gsplit-dwarf -g3 will output filename as indirect string, call set_indirect_string on DW_MACINFO_start_file for -gsplit-dwarf -g3. gcc/ PR debug/79342 * dwarf2out.c (save_macinfo_strings): Call set_indirect_string on DW_MACINFO_start_file for -gsplit-dwarf -g3. gcc/testsuite/ PR debug/79342 * gcc.dg/pr79342.: New test. From-SVN: r263831 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e95f409da7e..72f45754390 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-24 H.J. Lu + + PR debug/79342 + * dwarf2out.c (save_macinfo_strings): Call set_indirect_string + on DW_MACINFO_start_file for -gsplit-dwarf -g3. + 2018-08-24 Richard Biener * cfg.h (struct control_flow_graph): Add edge_flags_allocated and diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 91af4e8fc4e..77317ed2575 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -28287,6 +28287,12 @@ save_macinfo_strings (void) && (debug_str_section->common.flags & SECTION_MERGE) != 0) set_indirect_string (find_AT_string (ref->info)); break; + case DW_MACINFO_start_file: + /* -gsplit-dwarf -g3 will also output filename as indirect + string. */ + if (!dwarf_split_debug_info) + break; + /* Fall through. */ case DW_MACRO_define_strp: case DW_MACRO_undef_strp: set_indirect_string (find_AT_string (ref->info)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e83279f7f9b..813676b7c5f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-24 H.J. Lu + + PR debug/79342 + * gcc.dg/pr79342.: New test. + 2018-08-23 Martin Sebor PR tree-optimization/87072 diff --git a/gcc/testsuite/gcc.dg/pr79342.c b/gcc/testsuite/gcc.dg/pr79342.c new file mode 100644 index 00000000000..958de55d09b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr79342.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -gsplit-dwarf -g3" } */ +/* { dg-additional-options "-march=skylake -mrtm -mabm" { target x86_64-*-* i?86-*-* } } */ + +int a; +void b(void); + +void e(int *); +int f(void); + +void +c(void) +{ + int d; + e(&d); + if (f()) + b(); +}