On 11/24/2017 01:53 PM, Jakub Jelinek wrote:
Could anybody from the debugger folks test it a little bit (say gdb
testsuite if it has any -O2 -gstabs/-O2 -gstabs+ tests)?

The gdb testsuite just uses "-g" by default. It doesn't have any tests with optimization by default, though this can be done. I tried it. I modified an x86_64-linux toolchain to emit stabs by default, and used it on the gdb testsuite. I get about 40k passes, the same number with or without your patch. When I try adding -O2, I get about 28k passes, and there are about 26 more with your patch than without. I do see a few assembler errors without the patch, and none with.

@@ -3664,6 +3724,26 @@ dbx_output_rbrac (const char *label,
      dbxout_stab_value_label (label);
  }
+/* Return true is at least one block among BLOCK, its children or siblings

is -> if

Otherwise this looks OK to me, though I think you went to more trouble than necessary. I can think of 3 simpler ways to fix this. 1) In opts.c, check for DBX_DEBUG and -freorder-blocks-and-partition and disable the optimization. 2) In the x86 port, #undef DBX_DEBUGGING_INFO so you can't generate it anymore and hence won't test it anymore. 3) In the testsuite, drop stabs from the debug torture list. And maybe add dwarf-5 at the same time, as we really should be testing that.

Jim

Reply via email to