On Mon, Nov 27, 2017 at 01:36:12PM -0800, Jim Wilson wrote: > 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.
Thanks. > > @@ -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 Will fix. > 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. We try hard not to change code generation based on -g* flags, this would be against that. > 2) In the x86 port, #undef DBX_DEBUGGING_INFO so you can't generate it > anymore and hence won't test it anymore. If we deprecate it now, guess that is the way to go for GCC 9. > 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. Well, we already had -fno-reorder-blocks-and-partition in the only test in */debug/* where it FAILed. Not testing doesn't mean the problem doesn't exist and the fails to assemble problem means it can be severe for anyone who enables -gstabs*. With the changes, even if the debugging experience in the cold parts of the function might not be that good (e.g. due to the weird function names etc.), at least debugging in the hot parts will work as before without hot/cold partitioning. Jakub