https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102542
--- Comment #7 from Aldy Hernandez <aldyh at redhat dot com> --- On Fri, Oct 1, 2021 at 1:46 PM rguenth at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> wrote: > > Could I inconvenience you to tweak this function with your insight? It's a > > tiny function, and it seems you're much more qualified to add the > > restriction code. If not, I'm sure I can stumble around it and send it for > > review. > > Something like > > diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c > index dcabfdb30d2..b1b77e91176 100644 Thanks so much for this. I will test it, and incorporate it with some ideas Jeff had suggested. Then I'll post it upstream for review/discussion. BTW, it seems that the code restricting paths should actually live in the loop world...since it's the loop experts who know what is allowed and what is problematic ;-).