https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94045
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Shall we punt in find_base_term for VALUEs if visited_vals.length () is larger than a new param with some reasonable default? Or do it only during var-tracking and not during alias analysis? With: --- gcc/alias.c.jj 2020-03-03 19:39:53.228598307 +0100 +++ gcc/alias.c 2020-03-05 12:13:13.772182997 +0100 @@ -2005,6 +2005,9 @@ find_base_term (rtx x, vec<std::pair<cse if (cselib_sp_based_value_p (val)) return static_reg_base_value[STACK_POINTER_REGNUM]; + if (visited_vals.length () > 2048) + return ret; + f = val->locs; /* Reset val->locs to avoid infinite recursion. */ if (f) the testcase compiles (x86_64 with those -m32 ... options) in 3m11s on i9-7960X.