https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70614
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- We already have --param scev-max-expr-complexity (and --param scev-max-expr-size) for this. But I have a simple fix for the testcase. Index: tree-scalar-evolution.c =================================================================== --- tree-scalar-evolution.c (revision 234970) +++ tree-scalar-evolution.c (working copy) @@ -1687,6 +1690,8 @@ interpret_condition_phi (struct loop *lo (loop, PHI_ARG_DEF (condition_phi, i)); res = chrec_merge (res, branch_chrec); + if (res == chrec_dont_know) + break; } return res; Improves the testcase to compile in 0.5s.