summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/tree-ssa-loop-ivopts.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 5acf044161c..da04dd5ba0a 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -7947,6 +7947,9 @@ analyze_and_mark_doloop_use (struct ivopts_data *data)
if (!flag_branch_on_count_reg)
return;
+ if (data->current_loop->unroll == USHRT_MAX)
+ return;
+
if (!generic_predict_doloop_p (data))
return;