This prevents a null dereference error when outputing debug information
following an early exit from number_of_iterations_exit_assumptions.
gcc/ChangeLog:
* tree-ssa-loop-niter.cc (number_of_iterations_exit_assumptions):
Move at_stmt assignment.
if (!stmt)
return false;
+ if (at_stmt)
+ *at_stmt = stmt;
+
/* We want the condition for staying inside loop. */
code = gimple_cond_code (stmt);
if (exit->flags & EDGE_TRUE_VALUE)
if (TREE_CODE (niter->niter) == INTEGER_CST)
niter->max = wi::to_widest (niter->niter);
- if (at_stmt)
- *at_stmt = stmt;
-
return (!integer_zerop (niter->assumptions));
}