OSDN Git Service

2011-09-27 Sriraman Tallam <tmsriram@google.com>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop-im.c
index 3a5608e..cb52791 100644 (file)
@@ -1251,11 +1251,9 @@ move_computations_stmt (struct dom_walk_data *dw_data,
          gcc_assert (arg0 && arg1);
          t = build2 (gimple_cond_code (cond), boolean_type_node,
                      gimple_cond_lhs (cond), gimple_cond_rhs (cond));
-         t = build3 (COND_EXPR, TREE_TYPE (gimple_phi_result (stmt)),
-                     t, arg0, arg1);
-         new_stmt = gimple_build_assign_with_ops (COND_EXPR,
-                                                  gimple_phi_result (stmt),
-                                                  t, NULL_TREE);
+         new_stmt = gimple_build_assign_with_ops3 (COND_EXPR,
+                                                   gimple_phi_result (stmt),
+                                                   t, arg0, arg1);
          SSA_NAME_DEF_STMT (gimple_phi_result (stmt)) = new_stmt;
          *((unsigned int *)(dw_data->global_data)) |= TODO_cleanup_cfg;
        }
@@ -1835,33 +1833,6 @@ analyze_memory_references (void)
   create_vop_ref_mapping ();
 }
 
-/* Returns true if a region of size SIZE1 at position 0 and a region of
-   size SIZE2 at position DIFF cannot overlap.  */
-
-static bool
-cannot_overlap_p (aff_tree *diff, double_int size1, double_int size2)
-{
-  double_int d, bound;
-
-  /* Unless the difference is a constant, we fail.  */
-  if (diff->n != 0)
-    return false;
-
-  d = diff->offset;
-  if (double_int_negative_p (d))
-    {
-      /* The second object is before the first one, we succeed if the last
-        element of the second object is before the start of the first one.  */
-      bound = double_int_add (d, double_int_add (size2, double_int_minus_one));
-      return double_int_negative_p (bound);
-    }
-  else
-    {
-      /* We succeed if the second object starts after the first one ends.  */
-      return double_int_scmp (size1, d) <= 0;
-    }
-}
-
 /* Returns true if MEM1 and MEM2 may alias.  TTAE_CACHE is used as a cache in
    tree_to_aff_combination_expand.  */
 
@@ -1890,7 +1861,7 @@ mem_refs_may_alias_p (tree mem1, tree mem2, struct pointer_map_t **ttae_cache)
   aff_combination_scale (&off1, double_int_minus_one);
   aff_combination_add (&off2, &off1);
 
-  if (cannot_overlap_p (&off2, size1, size2))
+  if (aff_comb_cannot_overlap_p (&off2, size1, size2))
     return false;
 
   return true;