OSDN Git Service

2004-05-10 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 May 2004 22:28:50 +0000 (22:28 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 May 2004 22:28:50 +0000 (22:28 +0000)
        * gcse.c (eliminate_partially_redundant_loads): Instead of returning early,
        goto a cleanup label.  After the cleanup, free the allocated memory.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81682 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcse.c

index 59ac6a1..63345cb 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-10  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * gcse.c (eliminate_partially_redundant_loads): Instead of returning early,
+       goto a cleanup label.  After the cleanup, free the allocated memory.
+
 2004-05-10  Ziemowit Laski  <zlaski@apple.com>
 
        * config/rs6000/altivec.h (vec_sld): Add overloads for
index 48bc1f2..19710d2 100644 (file)
@@ -8401,14 +8401,14 @@ eliminate_partially_redundant_loads (basic_block bb, rtx insn,
 
   if (npred_ok == 0    /* No load can be replaced by copy.  */
       || (optimize_size && npred_ok > 1)) /* Prevent exploding the code.  */
-    return;
+    goto cleanup;
 
   /* Check if it's worth applying the partial redundancy elimination.  */
   if (ok_count < GCSE_AFTER_RELOAD_PARTIAL_FRACTION * not_ok_count)
-    return;
+    goto cleanup;
 
   if (ok_count < GCSE_AFTER_RELOAD_CRITICAL_FRACTION * critical_count)
-    return;
+    goto cleanup;
 
   /* Generate moves to the loaded register from where
      the memory is available.  */
@@ -8461,6 +8461,22 @@ eliminate_partially_redundant_loads (basic_block bb, rtx insn,
     delete_insn (insn);
   else
     a_occr->deleted_p = 1;
+  
+cleanup:
+
+  while (unavail_occrs)
+    {
+      struct unoccr *temp = unavail_occrs->next;
+      free (unavail_occrs);
+      unavail_occrs = temp;
+    }
+
+  while (avail_occrs)
+    {
+      struct unoccr *temp = avail_occrs->next;
+      free (avail_occrs);
+      avail_occrs = temp;
+    }
 }
 
 /* Performing the redundancy elimination as described before.  */