aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@osandov.com>2023-09-13 23:41:22 -0700
committerRichard Biener <rguenther@suse.de>2023-09-20 08:02:56 +0200
commit80048aa13a6b55d2be485000840a4e1c8b57d8e7 (patch)
tree9b65ef496506b545980a57af0dd6101f170aec9a /gcc
parentd64631ff88f8510aa011a0b59500736fe70089e5 (diff)
downloadgcc-80048aa13a6b55d2be485000840a4e1c8b57d8e7.zip
gcc-80048aa13a6b55d2be485000840a4e1c8b57d8e7.tar.gz
gcc-80048aa13a6b55d2be485000840a4e1c8b57d8e7.tar.bz2
debug/111409 - don't generate COMDAT macro sections for split DWARF
Split DWARF files aren't processed by the linker, so DW_MACRO_import offsets aren't relocated and the .debug_macro.dwo sections aren't deduplicated and merged. There's no clear way for this to work for split DWARF, so disable it. gcc/ChangeLog: PR debug/111409 * dwarf2out.cc (output_macinfo): Don't call optimize_macinfo_range if dwarf_split_debug_info. gcc/testsuite/ChangeLog: PR debug/111409 * gcc.dg/pr111409.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/dwarf2out.cc1
-rw-r--r--gcc/testsuite/gcc.dg/pr111409.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index c4a935d..f60a065 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -29247,6 +29247,7 @@ output_macinfo (const char *debug_line_label, bool early_lto_debug)
case DW_MACINFO_define:
case DW_MACINFO_undef:
if ((!dwarf_strict || dwarf_version >= 5)
+ && !dwarf_split_debug_info
&& HAVE_COMDAT_GROUP
&& vec_safe_length (files) != 1
&& i > 0
diff --git a/gcc/testsuite/gcc.dg/pr111409.c b/gcc/testsuite/gcc.dg/pr111409.c
new file mode 100644
index 0000000..1a79d81
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr111409.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
+/* { dg-options "-gsplit-dwarf -g3 -dA" } */
+/* { dg-final { scan-assembler-times {.section\s+.debug_macro} 1 } } */
+/* { dg-final { scan-assembler-not {.byte\s+0x7\s*#\s*Import} } } */
+
+#define foo 1