aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-unswitch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-unswitch.cc')
-rw-r--r--gcc/tree-ssa-loop-unswitch.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-unswitch.cc b/gcc/tree-ssa-loop-unswitch.cc
index e8c9bd6..df7a201 100644
--- a/gcc/tree-ssa-loop-unswitch.cc
+++ b/gcc/tree-ssa-loop-unswitch.cc
@@ -263,8 +263,10 @@ init_loop_unswitch_info (class loop *&loop, unswitch_predicate *&hottest,
/* Unswitch only nests with no sibling loops. */
class loop *outer_loop = loop;
+ unsigned max_depth = param_max_unswitch_depth;
while (loop_outer (outer_loop)->num != 0
- && !loop_outer (outer_loop)->inner->next)
+ && !loop_outer (outer_loop)->inner->next
+ && --max_depth != 0)
outer_loop = loop_outer (outer_loop);
hottest = NULL;
hottest_bb = NULL;