re PR tree-optimization/70614 (GCC gets stuck with -O)
authorRichard Biener <rguenther@suse.de>
Thu, 14 Apr 2016 13:21:40 +0000 (13:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 14 Apr 2016 13:21:40 +0000 (13:21 +0000)
2016-04-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/70614
* tree-scalar-evolution.c (analyze_evolution_in_loop): Terminate
loop if the evolution dropped to chrec_dont_know.
(interpret_condition_phi): Likewise.

From-SVN: r234972

gcc/ChangeLog
gcc/tree-scalar-evolution.c

index 495716c90eb8f2ef82fa4ae8dcf76f6c648032d3..19575f0fc79d0ff02ed427e4e23b62e0e98d0eac 100644 (file)
@@ -1,3 +1,10 @@
+2016-04-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/70614
+       * tree-scalar-evolution.c (analyze_evolution_in_loop): Terminate
+       loop if the evolution dropped to chrec_dont_know.
+       (interpret_condition_phi): Likewise.
+
 2016-04-14  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/70623
index fdd5da0589a86c0405db79655a205f08f9cbe801..88a0eaaa82d0a0ef219b8250fd0e0ce83367cf56 100644 (file)
@@ -1510,6 +1510,9 @@ analyze_evolution_in_loop (gphi *loop_phi_node,
       /* When there are multiple back edges of the loop (which in fact never
         happens currently, but nevertheless), merge their evolutions.  */
       evolution_function = chrec_merge (evolution_function, ev_fn);
+
+      if (evolution_function == chrec_dont_know)
+       break;
     }
 
   if (dump_file && (dump_flags & TDF_SCEV))
@@ -1687,6 +1690,8 @@ interpret_condition_phi (struct loop *loop, gphi *condition_phi)
        (loop, PHI_ARG_DEF (condition_phi, i));
 
       res = chrec_merge (res, branch_chrec);
+      if (res == chrec_dont_know)
+       break;
     }
 
   return res;