This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR54629


This patch from Jakub should fix issues with my previous patch.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2012-09-20  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/54629
	* tree-loop-distribution.c (classify_partition): Free loop nest only
	after freeing ddr.  Free ddr and loop nest also if successful.

--- gcc/tree-loop-distribution.c.jj	2012-09-20 09:22:02.000000000 +0200
+++ gcc/tree-loop-distribution.c	2012-09-20 09:35:05.953016313 +0200
@@ -1019,10 +1019,10 @@ classify_partition (loop_p loop, struct
       ddr = initialize_data_dependence_relation (single_load, single_store,
 						 loops);
       compute_affine_dependence (ddr, loop);
-      VEC_free (loop_p, heap, loops);
       if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
 	{
 	  free_dependence_relation (ddr);
+	  VEC_free (loop_p, heap, loops);
 	  return;
 	}
       if (DDR_ARE_DEPENDENT (ddr) != chrec_known)
@@ -1030,6 +1030,7 @@ classify_partition (loop_p loop, struct
 	  if (DDR_NUM_DIST_VECTS (ddr) == 0)
 	    {
 	      free_dependence_relation (ddr);
+	      VEC_free (loop_p, heap, loops);
 	      return;
 	    }
 	  lambda_vector dist_v;
@@ -1040,10 +1041,13 @@ classify_partition (loop_p loop, struct
 	      if (dist > 0 && !DDR_REVERSED_P (ddr))
 		{
 		  free_dependence_relation (ddr);
+		  VEC_free (loop_p, heap, loops);
 		  return;
 		}
 	    }
 	}
+      free_dependence_relation (ddr);
+      VEC_free (loop_p, heap, loops);
       partition->kind = PKIND_MEMCPY;
       partition->main_dr = single_store;
       partition->secondary_dr = single_load;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]