re PR tree-optimization/77724 (bootstrap-O3 broken: ICE: in tree_to_uhwi, at tree.c:7330)
Fix PR tree-optimization/77724 2016-09-27 Robin Dapp <rdapp@linux.vnet.ibm.com> PR tree-optimization/77724 * tree-vect-loop-manip.c (create_intersect_range_checks_index): Add tree_fits_shwi_p check. From-SVN: r240565
This commit is contained in:
parent
c03049b614
commit
1f56389164
|
@ -1,3 +1,9 @@
|
||||||
|
2016-09-27 Robin Dapp <rdapp@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
PR tree-optimization/77724
|
||||||
|
* tree-vect-loop-manip.c (create_intersect_range_checks_index):
|
||||||
|
Add tree_fits_shwi_p check.
|
||||||
|
|
||||||
2016-09-27 Jakub Jelinek <jakub@redhat.com>
|
2016-09-27 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* auto-inc-dec.c (try_merge): Remove break after return.
|
* auto-inc-dec.c (try_merge): Remove break after return.
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
|
||||||
|
int a[81];
|
||||||
|
int b, c;
|
||||||
|
|
||||||
|
void
|
||||||
|
fn1()
|
||||||
|
{
|
||||||
|
int d = b;
|
||||||
|
for (; c; --c)
|
||||||
|
a[c + d] = a[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))
|
if (!tree_fits_uhwi_p (dr_a.seg_len) || !tree_fits_uhwi_p (dr_b.seg_len))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!tree_fits_shwi_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))
|
if (!operand_equal_p (DR_BASE_OBJECT (dr_a.dr), DR_BASE_OBJECT (dr_b.dr), 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -2310,9 +2313,8 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
|
||||||
gcc_assert (TREE_CODE (DR_STEP (dr_a.dr)) == INTEGER_CST);
|
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;
|
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));
|
unsigned HOST_WIDE_INT abs_step
|
||||||
if (neg_step)
|
= absu_hwi (tree_to_shwi (DR_STEP (dr_a.dr)));
|
||||||
abs_step = -abs_step;
|
|
||||||
|
|
||||||
unsigned HOST_WIDE_INT seg_len1 = tree_to_uhwi (dr_a.seg_len);
|
unsigned HOST_WIDE_INT seg_len1 = tree_to_uhwi (dr_a.seg_len);
|
||||||
unsigned HOST_WIDE_INT seg_len2 = tree_to_uhwi (dr_b.seg_len);
|
unsigned HOST_WIDE_INT seg_len2 = tree_to_uhwi (dr_b.seg_len);
|
||||||
|
@ -2331,7 +2333,7 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
|
||||||
{
|
{
|
||||||
tree access1 = DR_ACCESS_FN (dr_a.dr, i);
|
tree access1 = DR_ACCESS_FN (dr_a.dr, i);
|
||||||
tree access2 = DR_ACCESS_FN (dr_b.dr, i);
|
tree access2 = DR_ACCESS_FN (dr_b.dr, i);
|
||||||
/* Two index must be the same if they are not scev, or not scev wrto
|
/* Two indices must be the same if they are not scev, or not scev wrto
|
||||||
current loop being vecorized. */
|
current loop being vecorized. */
|
||||||
if (TREE_CODE (access1) != POLYNOMIAL_CHREC
|
if (TREE_CODE (access1) != POLYNOMIAL_CHREC
|
||||||
|| TREE_CODE (access2) != POLYNOMIAL_CHREC
|
|| TREE_CODE (access2) != POLYNOMIAL_CHREC
|
||||||
|
@ -2343,7 +2345,7 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* Two index must have the same step. */
|
/* The two indices must have the same step. */
|
||||||
if (!operand_equal_p (CHREC_RIGHT (access1), CHREC_RIGHT (access2), 0))
|
if (!operand_equal_p (CHREC_RIGHT (access1), CHREC_RIGHT (access2), 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue