OSDN Git Service

2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-predcom.c
index 85cfbd6..54e0b7f 100644 (file)
@@ -877,7 +877,12 @@ filter_suitable_components (struct loop *loop, struct component *comps)
        comp = &act->next;
       else
        {
+         dref ref;
+         unsigned i;
+
          *comp = act->next;
+         for (i = 0; VEC_iterate (dref, act->refs, i, ref); i++)
+           free (ref);
          release_component (act);
        }
     }
@@ -920,7 +925,10 @@ add_ref_to_chain (chain_p chain, dref ref)
   gcc_assert (double_int_scmp (root->offset, ref->offset) <= 0);
   dist = double_int_add (ref->offset, double_int_neg (root->offset));
   if (double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE), dist) <= 0)
-    return;
+    {
+      free (ref);
+      return;
+    }
   gcc_assert (double_int_fits_in_uhwi_p (dist));
 
   VEC_safe_push (dref, heap, chain->refs, ref);
@@ -1018,9 +1026,6 @@ valid_initializer_p (struct data_reference *ref,
   aff_tree diff, base, step;
   double_int off;
 
-  if (!DR_BASE_ADDRESS (ref))
-    return false;
-
   /* Both REF and ROOT must be accessing the same object.  */
   if (!operand_equal_p (DR_BASE_ADDRESS (ref), DR_BASE_ADDRESS (root), 0))
     return false;
@@ -1107,7 +1112,8 @@ find_looparound_phi (struct loop *loop, dref ref, dref root)
   memset (&init_dr, 0, sizeof (struct data_reference));
   DR_REF (&init_dr) = init_ref;
   DR_STMT (&init_dr) = phi;
-  dr_analyze_innermost (&init_dr);
+  if (!dr_analyze_innermost (&init_dr))
+    return NULL;
 
   if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref))
     return NULL;