From: Bin Cheng Date: Fri, 21 Aug 2015 10:09:48 +0000 (+0000) Subject: tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break loop if EXPR is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eff1e5afad295545d09985c705952242bc16c2ea;p=gcc.git tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break loop if EXPR is simplified to const value. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break loop if EXPR is simplified to const value. From-SVN: r227055 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c746e164363..cb1ed43dae7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-21 Bin Cheng + + * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Break + loop if EXPR is simplified to const value. + 2015-08-21 Yury Gribov * sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG, diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 4e9a2acb19d..39d68072240 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2083,6 +2083,10 @@ simplify_using_initial_conditions (struct loop *loop, tree expr) if (e->flags & EDGE_FALSE_VALUE) cond = invert_truthvalue (cond); expr = tree_simplify_using_condition (cond, expr); + /* Break if EXPR is simplified to const values. */ + if (expr && (integer_zerop (expr) || integer_nonzerop (expr))) + break; + ++cnt; }