re PR middle-end/54146 (Very slow compile with attribute((flatten)))
[gcc.git] / gcc / tree-ssa-loop-niter.c
index 4c67c26faf3eb67b618ef065992a72b4d91cab07..38b47b0b656a6cb39f043909ad400fe9b47a2bc9 100644 (file)
@@ -2286,7 +2286,10 @@ find_loop_niter_by_eval (struct loop *loop, edge *exit)
   /* Loops with multiple exits are expensive to handle and less important.  */
   if (!flag_expensive_optimizations
       && VEC_length (edge, exits) > 1)
-    return chrec_dont_know;
+    {
+      VEC_free (edge, heap, exits);
+      return chrec_dont_know;
+    }
 
   FOR_EACH_VEC_ELT (edge, exits, i, ex)
     {