On 9/28/2021 10:09 AM, Aldy Hernandez wrote:
I really don't know what to do here. This is a bit of whack-o-mole. The IL is sufficiently different for various architectures that any tweak can cause the number of jump threads to vary. For the pr7745-2.c testcase, we have less threading candidates because 2 of them now cross loop boundaries. Interestingly, this test matches "Jumps threaded", not threads registered, so the block copier can drop threads at copying time adding further confusion. For example, we can register N threads, but the old copier can cancel N-M threads while updating the CFG for a variety of different reasons (removed edges, threading through loop exits, etc). This makes the "Registering jump threads" not to match the total number of threads this test checks for with "Jumps threaded". The pr66752-3.c test OTOH, is just a matter of thread4 eliminating the "if". I had erroneously thought it would always be eliminated by thread3, but we really don't care where it gets cleaned up. All we know is that DCE can't depend on the early threaders doing this work, because it may cross loop boundaries. I've chosen thread4 arbitrarily, but we could just as easily pick the ".optimized" dump. Sorry, I'm really at my wits end here. I don't see any clean path forward, except rewrite these tests as gimple IL. They're close to useless as they sit. OK? gcc/testsuite/ChangeLog: PR testsuite/102501 * gcc.dg/tree-ssa/pr66752-3.c: Adjust. * gcc.dg/tree-ssa/pr77445-2.c: Adjust.
Note these were two of the consistent failures on other targets as well. Jeff