From: jakub Date: Tue, 22 Jan 2019 09:58:23 +0000 (+0000) Subject: PR tree-optimization/88044 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d92b55096267c339f6aab2678c50b31794570a58;p=thirdparty%2Fgcc.git PR tree-optimization/88044 * tree-ssa-loop-niter.c (number_of_iterations_cond): If condition is false in the first iteration, but !every_iteration, return false instead of true with niter->niter zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268143 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 64f920ece339..feda772ffc6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-01-22 Jakub Jelinek + PR tree-optimization/88044 + * tree-ssa-loop-niter.c (number_of_iterations_cond): If condition + is false in the first iteration, but !every_iteration, return false + instead of true with niter->niter zero. + PR rtl-optimization/88904 * cfgcleanup.c (thread_jump): Verify cond2 doesn't mention any nonequal registers before processing BB_END (b). diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 622d18abacb5..470b6a295be5 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1824,6 +1824,8 @@ number_of_iterations_cond (struct loop *loop, tree tem = fold_binary (code, boolean_type_node, iv0->base, iv1->base); if (tem && integer_zerop (tem)) { + if (!every_iteration) + return false; niter->niter = build_int_cst (unsigned_type_for (type), 0); niter->max = 0; return true;