tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Tighten overlap check.
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 13 Jul 2011 11:17:00 +0000 (11:17 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 13 Jul 2011 11:17:00 +0000 (11:17 +0000)
gcc/
* tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Tighten
overlap check.

From-SVN: r176229

gcc/ChangeLog
gcc/tree-vect-loop-manip.c

index db549522ee70f8fa4274514508d66526ba2a3275..cddbb717107c7db2f41d714a60c500671ca3d187 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-13  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): Tighten
+       overlap check.
+
 2011-07-13  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * tree.h (categorize_ctor_elements): Remove comment.  Fix long line.
index a120fb153aa468c0342203e2781ec6ee72846be5..b8d67804f77ecda6ea6d6c56d511c9aea5a01fd3 100644 (file)
@@ -2409,13 +2409,13 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
   tree part_cond_expr, length_factor;
 
   /* Create expression
-     ((store_ptr_0 + store_segment_length_0) < load_ptr_0)
-     || (load_ptr_0 + load_segment_length_0) < store_ptr_0))
+     ((store_ptr_0 + store_segment_length_0) <= load_ptr_0)
+     || (load_ptr_0 + load_segment_length_0) <= store_ptr_0))
      &&
      ...
      &&
-     ((store_ptr_n + store_segment_length_n) < load_ptr_n)
-     || (load_ptr_n + load_segment_length_n) < store_ptr_n))  */
+     ((store_ptr_n + store_segment_length_n) <= load_ptr_n)
+     || (load_ptr_n + load_segment_length_n) <= store_ptr_n))  */
 
   if (VEC_empty (ddr_p, may_alias_ddrs))
     return;
@@ -2484,8 +2484,8 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
 
       part_cond_expr =
        fold_build2 (TRUTH_OR_EXPR, boolean_type_node,
-         fold_build2 (LT_EXPR, boolean_type_node, seg_a_max, seg_b_min),
-         fold_build2 (LT_EXPR, boolean_type_node, seg_b_max, seg_a_min));
+         fold_build2 (LE_EXPR, boolean_type_node, seg_a_max, seg_b_min),
+         fold_build2 (LE_EXPR, boolean_type_node, seg_b_max, seg_a_min));
 
       if (*cond_expr)
        *cond_expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,