https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91403
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- OK, so I have a patch to fix the recursion depth in SCEV analysis but then we hit the next one in SLSR, in my case because with -O0 there's no tailcall performed but even with -O2 we don't tailcall it. #8 0x0000000001fbb1d7 in replace_unconditional_candidate (c=0x200a1b60) at /space/rguenther/src/svn/trunk2/gcc/gimple-ssa-strength-reduction.c:2223 #9 0x0000000001fbc47a in replace_uncond_cands_and_profitable_phis ( c=0x200a1b60) at /space/rguenther/src/svn/trunk2/gcc/gimple-ssa-strength-reduction.c:2625 #10 0x0000000001fbc4bc in replace_uncond_cands_and_profitable_phis ( c=0x200a1ae0) at /space/rguenther/src/svn/trunk2/gcc/gimple-ssa-strength-reduction.c:2631 ... #599120 0x0000000001fbc4bc in replace_uncond_cands_and_profitable_phis ( c=0x33ba1b0) at /space/rguenther/src/svn/trunk2/gcc/gimple-ssa-strength-reduction.c:2631 2631 replace_uncond_cands_and_profitable_phis (lookup_cand (c->dependent)); given the structure a worklist would be necessary to fix things there.