PR debug/86459 - Fix -gsplit-dwarf -g3 gcc_assert
authorMark Wielaard <mark@klomp.org>
Tue, 10 Jul 2018 22:44:30 +0000 (22:44 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Tue, 10 Jul 2018 22:44:30 +0000 (22:44 +0000)
There was a typo in the output_macinfo_op gcc_assert.
The function is called dwarf_FORM, not dwarf_form.
Add the provided testcase from the bug to test -gsplit-dwarf -g3.

gcc/ChangeLog:

PR debug/86459
* dwarf2out.c (output_macinfo_op): Fix dwarf_FORM typo in gcc_assert.

gcc/testsuite/ChangeLog:

PR debug/86459
* gcc.dg/pr86459.c: New test.

From-SVN: r262545

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

index f8717804b2aee377ee6239edd4f121718ce9c855..a333a523b8e97fc0296742784e566ece4e214069 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-10  Mark Wielaard  <mark@klomp.org>
+
+       PR debug/86459
+       * dwarf2out.c (output_macinfo_op): Fix dwarf_FORM typo in gcc_assert.
+
 2018-07-10  Richard Biener  <rguenther@suse.de>
 
        * hash-map.h (hash_map::iterator::operator*): Return
index 95232177d838cad1ca05f5462ed582c25901e8cd..4640a22e14acb2efd6292aa512479df1cbf9bc49 100644 (file)
@@ -28066,7 +28066,7 @@ output_macinfo_op (macinfo_entry *ref)
       node = find_AT_string (ref->info);
       gcc_assert (node
                  && (node->form == DW_FORM_strp
-                     || node->form == dwarf_form (DW_FORM_strx)));
+                     || node->form == dwarf_FORM (DW_FORM_strx)));
       dw2_asm_output_data (1, ref->code,
                           ref->code == DW_MACRO_define_strp
                           ? "Define macro strp"
index 8d27cdb32067a6d5f33523a3cf8a518f3b6d38cc..fa1b01acadfb5cbd364080b599b9ddec4633ff61 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-10  Mark Wielaard  <mark@klomp.org>
+
+       PR debug/86459
+       * gcc.dg/pr86459.c: New test.
+
 2018-07-10  Martin Sebor  <msebor@redhat.com>
 
        PR testsuite/86461
diff --git a/gcc/testsuite/gcc.dg/pr86459.c b/gcc/testsuite/gcc.dg/pr86459.c
new file mode 100644 (file)
index 0000000..7856a37
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -fno-var-tracking-assignments -gsplit-dwarf -g3" } */
+
+/* Same as pr86064.c but compiled with -g3 it showed an issue in
+   output_macinfo_op because of a typo in an assert.  */
+
+int a;
+__attribute__((__cold__)) void b();
+
+void e(int *);
+int f();
+
+void c() {
+  int d;
+  e(&d);
+  a = d;
+  if (f())
+    b();
+}