summaryrefslogtreecommitdiffstats
path: root/gcc/graphite-dependences.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 14:24:01 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 14:24:01 +0000
commit0835eab695dc77cf92631c49c7ead7341df97c83 (patch)
treeed06f135bd5e97a946d4aeb926c98a52cf624f7e /gcc/graphite-dependences.c
parenta741358d2ef4498e2c72c96fe5a45a333478489f (diff)
downloadppe42-gcc-0835eab695dc77cf92631c49c7ead7341df97c83.tar.gz
ppe42-gcc-0835eab695dc77cf92631c49c7ead7341df97c83.zip
Fix memory leak in DD XFAILs some interchange testcases.
2009-08-05 Konrad Trifunovic <konrad.trifunovic@gmail.com> Sebastian Pop <sebastian.pop@amd.com> * graphite-dependences.c (graphite_legal_transform_dr): Work on a copy of the dependence polyhedron. Free the temporary objects. (graphite_carried_dependence_level_k): Free unused objects before returning. * testsuite/gcc.dg/graphite/interchange-1.c: XFAILed. * testsuite/gcc.dg/graphite/interchange-2.c: XFAILed. * testsuite/gcc.dg/graphite/interchange-3.c: XFAILed. * testsuite/gcc.dg/graphite/interchange-4.c: XFAILed. * testsuite/gcc.dg/graphite/interchange-7.c: XFAILed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-dependences.c')
-rw-r--r--gcc/graphite-dependences.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index ed2f92e2950..1c29b18bcc6 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -513,6 +513,17 @@ graphite_legal_transform_dr (poly_bb_p pbb1, poly_bb_p pbb2,
graphite_dim_t otdim2 = pbb_nb_scattering_orig (pbb2);
graphite_dim_t ttdim1 = pbb_nb_scattering_transform (pbb1);
graphite_dim_t ttdim2 = pbb_nb_scattering_transform (pbb2);
+ ppl_Pointset_Powerset_C_Polyhedron_t temp;
+ ppl_dimension_type pdim;
+ bool is_empty_p;
+
+ /* Copy the PO polyhedron into the TEMP, so it is not destroyed.
+ Keep in mind, that PO polyhedron might be restored from the cache
+ and should not be modified! */
+ ppl_Pointset_Powerset_C_Polyhedron_space_dimension (po, &pdim);
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (&temp,
+ pdim, 0);
+ ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (temp, po);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nloop carries dependency.\n");
@@ -520,14 +531,18 @@ graphite_legal_transform_dr (poly_bb_p pbb1, poly_bb_p pbb2,
false, false);
/* Extend PO and PT to have the same dimensions. */
- ppl_insert_dimensions_pointset (po, otdim1, ttdim1);
- ppl_insert_dimensions_pointset (po, otdim1 + ttdim1 + ddim1 + otdim2,
+ ppl_insert_dimensions_pointset (temp, otdim1, ttdim1);
+ ppl_insert_dimensions_pointset (temp, otdim1 + ttdim1 + ddim1 + otdim2,
ttdim2);
ppl_insert_dimensions_pointset (pt, 0, otdim1);
ppl_insert_dimensions_pointset (pt, otdim1 + ttdim1 + ddim1, otdim2);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (po, pt);
- return ppl_Pointset_Powerset_C_Polyhedron_is_empty (po);
+ ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (temp, pt);
+ is_empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (temp);
+
+ ppl_delete_Pointset_Powerset_C_Polyhedron (temp);
+ ppl_delete_Pointset_Powerset_C_Polyhedron (pt);
+ return is_empty_p;
}
}
@@ -674,7 +689,6 @@ graphite_carried_dependence_level_k (poly_dr_p pdr1, poly_dr_p pdr2,
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (eqpp, po);
empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (eqpp);
- ppl_delete_Pointset_Powerset_C_Polyhedron (po);
ppl_delete_Pointset_Powerset_C_Polyhedron (eqpp);
return !empty_p;
}
OpenPOWER on IntegriCloud