@@ -2241,12 +2241,26 @@ vect_create_cond_for_alias_checks (loop_
tree seg_a_min = addr_base_a;
tree seg_a_max = fold_build_pointer_plus (addr_base_a, segment_length_a);
if (tree_int_cst_compare (DR_STEP (dr_a.dr), size_zero_node) < 0)
- seg_a_min = seg_a_max, seg_a_max = addr_base_a;
+ {
+ seg_a_min =
+ fold_build_pointer_plus (seg_a_max,
+ TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr_a.dr))));
+ seg_a_max =
+ fold_build_pointer_plus (addr_base_a,
+ TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr_a.dr))));
+ }
Too long lines, can you create a temporary tree var for TYPE_SIZE_UNIT (...); value?
Can you add a comment why you do this?
Perhaps better would be to put this test into gcc.dg/vect/pr59651.c
(with the required /* { dg-final { cleanup-tree-dump "vect" } } */ ),
so that it is also tested say on i686-linux with -msse2 etc.
Or duplicate between those two places (the body of the test can be
included in one of those two from the other place using relative path).
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+