On Fri, Jul 30, 2021 at 8:24 PM Jeff Law <jeffreya...@gmail.com> wrote: > > > > On 7/30/2021 4:39 AM, Aldy Hernandez via Gcc-patches wrote: > > It occurs to me that I should not have disabled early jump threading in > > this test, as it may hide an actual defect. I have reverted my change > > and XFAILed the test instead. I have also opened a PR101690 to keep track > > of this problem. > > > > I have pushed this patch, but could benefit from someone with knowledge > > of loop-ch and/or RTL shrink wrapping to look at the PR, as here we have > > a valid jump thread that is causing loop_ch to drastically change the > > probabilities ultimately having us fail at shrink wrapping. > > > > Thanks. > > > > gcc/testsuite/ChangeLog: > > > > * gcc.dg/shrink-wrap-loop.c: Enable early jump threading. Mark as > > XFAIL. > Getting the profile data right with jump threading can be painful. See > the huge comment at the start of > tree-ssa-threadupdate.c::compute_path_counts.
*head explodes* > > The backwards threader uses a completely different copying/update > mechanism. It's probably not using compute_path_counts (and it's not > even clear if it could) and I suspect the copier/updater that is being > used for backwards threading doesn't handle those cases right. Ughhh ok. I wonder if this has something to do with gcc.dg/tree-prof/20050826-2.c which is failing for x86 32-bits. The test just makes sure there is no magic "Invalid sum" after compiling with -fprofile-use. Aldy