* gimple-ssa-evrp-analyze.c
authorJeff Law <law@redhat.com>
Tue, 28 Nov 2017 18:21:10 +0000 (11:21 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 28 Nov 2017 18:21:10 +0000 (11:21 -0700)
(evrp_range_analyzer::record_ranges_from_phis): Only use SCEV to
refine ranges if scev_initialized_p returns true.
* vr-values.c (vr_values::extract_range_from_phi_node): Likewise.

From-SVN: r255211

gcc/ChangeLog
gcc/gimple-ssa-evrp-analyze.c
gcc/vr-values.c

index ca6748592929ffaa8350b8b412c5d1b7ec13dd31..cc548d7d7e3faf2531e603eb9a62f6c936052166 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-28  Jeff Law  <law@redhat.com>
+
+       * gimple-ssa-evrp-analyze.c
+       (evrp_range_analyzer::record_ranges_from_phis): Only use SCEV to
+       refine ranges if scev_initialized_p returns true.
+       * vr-values.c (vr_values::extract_range_from_phi_node): Likewise.
+
 2017-11-28  Julia Koval  <julia.koval@intel.com>
 
        * config/i386/avx512vbmi2intrin.h (_mm512_shrdi_epi16,
index 6f225cb7d0b5e6c9418c3d9131f59463d8b13607..551b1d6b5295f5d95ac7d4f0ff3bd9f234e3ef65 100644 (file)
@@ -246,7 +246,8 @@ evrp_range_analyzer::record_ranges_from_phis (basic_block bb)
             to use VARYING for them.  But we can still resort to
             SCEV for loop header PHIs.  */
          struct loop *l;
-         if (interesting
+         if (scev_initialized_p ()
+             && interesting
              && (l = loop_containing_stmt (phi))
              && l->header == gimple_bb (phi))
          vr_values->adjust_range_with_scev (&vr_result, l, phi, lhs);
index 0150f59d53dc9f685bb4dba71f3ac4751e06bf02..9352e120d9d1772222d26378233e66bc32db9e22 100644 (file)
@@ -2935,7 +2935,8 @@ scev_check:
      scev_check can be reached from two paths, one is a fall through from above
      "varying" label, the other is direct goto from code block which tries to
      avoid infinite simulation.  */
-  if ((l = loop_containing_stmt (phi))
+  if (scev_initialized_p ()
+      && (l = loop_containing_stmt (phi))
       && l->header == gimple_bb (phi))
     adjust_range_with_scev (vr_result, l, phi, lhs);