> Comments added.  Bootstrap and test, is it reasonable?

This introduces an ICE on s390x with a Fortran testcase, because
of an assertion failure in tree_to_uhwi (DR_STEP (dr_a.dr)) for
DR_STEP (dr_a.dr) = -8(OVF).

The attached patch fixes this by introducing an additional
tree_fits_uhwi_p().

ok to commit?

Regards
 Robin

--

gcc/ChangeLog:

2016-09-26  Robin Dapp  <rd...@linux.vnet.ibm.com>

        * tree-vect-loop-manip.c (create_intersect_range_checks_index):
        Add tree_fits_uhwi_p check.
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 8203040..8be0c17 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -2301,6 +2301,9 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
   if (!tree_fits_uhwi_p (dr_a.seg_len) || !tree_fits_uhwi_p (dr_b.seg_len))
     return false;
 
+  if (!tree_fits_uhwi_p (DR_STEP (dr_a.dr)))
+    return false;
+
   if (!operand_equal_p (DR_BASE_OBJECT (dr_a.dr), DR_BASE_OBJECT (dr_b.dr), 0))
     return false;
 
@@ -2310,6 +2313,7 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
   gcc_assert (TREE_CODE (DR_STEP (dr_a.dr)) == INTEGER_CST);
 
   bool neg_step = tree_int_cst_compare (DR_STEP (dr_a.dr), size_zero_node) < 0;
+
   unsigned HOST_WIDE_INT abs_step = tree_to_uhwi (DR_STEP (dr_a.dr));
   if (neg_step)
     abs_step = -abs_step;

Reply via email to