===================================================================
@@ -674,7 +674,7 @@ try_unroll_loop_completely (struct loop
HOST_WIDE_INT maxiter,
location_t locus)
{
- unsigned HOST_WIDE_INT n_unroll = 0, ninsns, max_unroll, unr_insns;
+ unsigned HOST_WIDE_INT n_unroll = 0, ninsns, unr_insns;
gimple cond;
struct loop_size size;
bool n_unroll_found = false;
@@ -720,9 +720,14 @@ try_unroll_loop_completely (struct loop
if (!n_unroll_found)
return false;
- max_unroll = PARAM_VALUE (PARAM_MAX_COMPLETELY_PEEL_TIMES);
- if (n_unroll > max_unroll)
- return false;
+ if (n_unroll > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEEL_TIMES))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Not unrolling loop %d "
+ "(--param max-completely-peeled-times limit reached).\n",
+ loop->num);
+ return false;
+ }
if (!edge_to_cancel)
edge_to_cancel = loop_edge_to_cancel (loop);
Try_unroll_loop_completely logs a message for max-completely-peeled-insns: else if (unr_insns > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Not unrolling loop %d: " "(--param max-completely-peeled-insns limit reached).\n", loop->num); return false; } but not for max-completely-peeled-times: max_unroll = PARAM_VALUE (PARAM_MAX_COMPLETELY_PEEL_TIMES); if (n_unroll > max_unroll) return false; so the attached patch adds one. Tested on x86_64-suse-linux, applied on the mainline as obvious. 2014-11-15 Eric Botcazou <ebotcazou@adacore.com> * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Add log message for max-completely-peeled-insns limit.