On 9/28/2021 7:53 AM, Aldy Hernandez wrote:
On 9/28/21 3:47 PM, Jeff Law wrote:
On 9/28/2021 3:45 AM, Aldy Hernandez wrote:
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.
OK?
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.
OK.
Note we've got massive failures in the tester starting sometime
yesterday and I suspect all the threader work. So I'm going to
slow down on reviews of that code as we stabilize stuff.
Fair enough. Let's knock those out then.
So I'm really wondering if these were caused by that patch you'd sent me
privately for the visium issue. Right now we're regressing in a few
places, but it's not bad.
visium & bfin are the only embedded targets failing.
visium fails:
Tests that now fail, but worked before (9 tests):
visium-sim: gcc.c-torture/execute/960218-1.c -Os (test for excess errors)
visium-sim: gcc.c-torture/execute/961125-1.c -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions (test for
excess errors)
visium-sim: gcc.c-torture/execute/961125-1.c -O3 -g (test for excess
errors)
visium-sim: gcc.c-torture/execute/pending-4.c -O1 (test for excess
errors)
visium-sim: gcc.c-torture/execute/pr58209.c -O2 (test for excess errors)
visium-sim: gcc.c-torture/execute/pr58209.c -O2 -flto
-fno-use-linker-plugin -flto-partition=none (test for excess errors)
visium-sim: gcc.c-torture/execute/pr58209.c -O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects (test for excess errors)
visium-sim: gcc.c-torture/execute/pr58209.c -O3 -g (test for excess
errors)
visium-sim: gcc.c-torture/execute/pr68911.c -O1 (test for excess errors)
We've already discussed 960218-1 a bit. I wouldn't be surprised if
they're all the same problem in the end. These started with:
commit 4a960d548b7d7d942f316c5295f6d849b74214f5 (HEAD, refs/bisect/bad)
Author: Aldy Hernandez <al...@redhat.com>
Date: Thu Sep 23 10:59:24 2021 +0200
Avoid invalid loop transformations in jump threading registry.