aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-22 10:58:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-22 10:58:23 +0100
commit9a6585859fa1c126523b5b02857aaabc8dc43c1e (patch)
tree96f1dedb51947fe972d20b1e5bca340db928cc96 /gcc
parent4293cd6ed8dfd9f0eef8287e72372c55796f50da (diff)
downloadgcc-9a6585859fa1c126523b5b02857aaabc8dc43c1e.zip
gcc-9a6585859fa1c126523b5b02857aaabc8dc43c1e.tar.gz
gcc-9a6585859fa1c126523b5b02857aaabc8dc43c1e.tar.bz2
re PR tree-optimization/88044 (gfortran.dg/transfer_intrinsic_3.f90 hangs after r266171)
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. From-SVN: r268143
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-loop-niter.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 64f920e..feda772 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-01-22 Jakub Jelinek <jakub@redhat.com>
+ 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 622d18a..470b6a2 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;