summaryrefslogtreecommitdiff
path: root/gcc/dbgcnt.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-09-28 10:19:57 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-09-28 15:55:29 +0200
commit0400ca17f361dcc7f8230bb69a25de22497c73c3 (patch)
treedadf3aba2e6cba61fe314f08a043ce7d735005ed /gcc/dbgcnt.h
parent1f0a57bd54aed558e0167016dd980177f88f8480 (diff)
downloadgcc-0400ca17f361dcc7f8230bb69a25de22497c73c3.tar.gz
Improve jump threading dump output.
In analyzing PR102511, it has become abundantly clear that we need better debugging aids for the jump threader solver. Currently debugging these issues is a nightmare if you're not intimately familiar with the code. This patch attempts to improve this. First, I'm enabling path solver dumps with TDF_THREADING. None of the available TDF_* flags are a good match, and using TDF_DETAILS would blow up the dump file, since both threaders continually call the solver to try out candidates. This will allow dumping path solver details without having to resort to hacking the source. I am also dumping the current registered_jump_thread dbg counter used by the registry, in the solver. That way narrowing down a problematic thread can then be examined by -fdump-*-threading and looking at the solver details surrounding the appropriate counter (which the dbgcnt also dumps to the dump file). You still need knowledge of the solver to debug these issues, but at least now it's not entirely opaque. Tested on x86-64 Linux. gcc/ChangeLog: * dbgcnt.c (dbg_cnt_counter): New. * dbgcnt.h (dbg_cnt_counter): New. * dumpfile.c (dump_options): Add entry for TDF_THREADING. * dumpfile.h (enum dump_flag): Add TDF_THREADING. * gimple-range-path.cc (DEBUG_SOLVER): Use TDF_THREADING. * tree-ssa-threadupdate.c (dump_jump_thread_path): Dump out debug counter.
Diffstat (limited to 'gcc/dbgcnt.h')
-rw-r--r--gcc/dbgcnt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/dbgcnt.h b/gcc/dbgcnt.h
index 17f2091f5a7..3c35dcc3e0a 100644
--- a/gcc/dbgcnt.h
+++ b/gcc/dbgcnt.h
@@ -33,6 +33,7 @@ enum debug_counter {
extern bool dbg_cnt_is_enabled (enum debug_counter index);
extern bool dbg_cnt (enum debug_counter index);
+extern unsigned dbg_cnt_counter (enum debug_counter index);
extern void dbg_cnt_process_opt (const char *arg);
extern void dbg_cnt_list_all_counters (void);