PR tree-optimization/69719
* tree-vect-data-refs.c (vect_prune_runtime_alias_test_list):
Properly use absolute of the difference of the two offsets to
compare or adjust the segment length.
* gcc.dg/torture/pr69719.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233212
138bc75d-0d04-0410-961f-
82ee72b054a4
+2016-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69719
+ * tree-vect-data-refs.c (vect_prune_runtime_alias_test_list):
+ Properly use absolute of the difference of the two offsets to
+ compare or adjust the segment length.
+
2016-02-08 Richard Biener <rguenther@suse.de>
Jeff Law <law@redhat.com>
+2016-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69719
+ * gcc.dg/torture/pr69719.c: New testcase.
+
2016-02-08 Richard Biener <rguenther@suse.de>
Jeff Law <law@redhat.com>
--- /dev/null
+/* { dg-do run } */
+
+int b, c = 1, e, f;
+int a[6][5] = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 0} };
+
+void __attribute__((noinline))
+fn1 ()
+{
+ int d;
+ for (b = 0; b < 5; b++)
+ for (d = 4; d; d--)
+ a[c + 1][b] = a[d + 1][d];
+}
+
+int
+main ()
+{
+ fn1 ();
+
+ if (a[2][1] != 0)
+ __builtin_abort ();
+
+ return 0;
+}
|| !tree_fits_shwi_p (dr_a2->offset))
continue;
- HOST_WIDE_INT diff = (tree_to_shwi (dr_a2->offset)
- - tree_to_shwi (dr_a1->offset));
+ unsigned HOST_WIDE_INT diff
+ = absu_hwi (tree_to_shwi (dr_a2->offset)
+ - tree_to_shwi (dr_a1->offset));
/* Now we check if the following condition is satisfied:
*/
- HOST_WIDE_INT min_seg_len_b = (tree_fits_shwi_p (dr_b1->seg_len)
- ? tree_to_shwi (dr_b1->seg_len)
- : vect_factor);
+ unsigned HOST_WIDE_INT min_seg_len_b
+ = (tree_fits_uhwi_p (dr_b1->seg_len)
+ ? tree_to_uhwi (dr_b1->seg_len)
+ : vect_factor);
if (diff <= min_seg_len_b
- || (tree_fits_shwi_p (dr_a1->seg_len)
- && diff - tree_to_shwi (dr_a1->seg_len) < min_seg_len_b))
+ || (tree_fits_uhwi_p (dr_a1->seg_len)
+ && diff - tree_to_uhwi (dr_a1->seg_len) < min_seg_len_b))
{
if (dump_enabled_p ())
{