diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2018-08-24 11:28:40 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2018-08-24 04:28:40 -0700 |
commit | 1ade64c9d8cd37c8db0a07383189f1719c7164da (patch) | |
tree | ecb04543e60bce1503be9cdf83a6e31013c80e0d | |
parent | e144a2b3066ecad2a7c934b1cd437d2afad0018f (diff) | |
download | gcc-1ade64c9d8cd37c8db0a07383189f1719c7164da.zip gcc-1ade64c9d8cd37c8db0a07383189f1719c7164da.tar.gz gcc-1ade64c9d8cd37c8db0a07383189f1719c7164da.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr79342.c | 18 |
4 files changed, 35 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e95f409..72f4575 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-08-24 H.J. Lu <hongjiu.lu@intel.com> + + 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 <rguenther@suse.de> * cfg.h (struct control_flow_graph): Add edge_flags_allocated and diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 91af4e8..77317ed 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 e83279f..813676b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-24 H.J. Lu <hongjiu.lu@intel.com> + + PR debug/79342 + * gcc.dg/pr79342.: New test. + 2018-08-23 Martin Sebor <msebor@redhat.com> 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 0000000..958de55 --- /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(); +} |