summaryrefslogtreecommitdiff
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
parenta741358d2ef4498e2c72c96fe5a45a333478489f (diff)
downloadgcc-0835eab695dc77cf92631c49c7ead7341df97c83.tar.gz
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
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/ChangeLog.graphite14
-rw-r--r--gcc/graphite-dependences.c24
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-7.c2
8 files changed, 52 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 60a0cc8114b..b7888b897e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2009-08-12 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.
+
2009-08-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (scop_do_strip_mine): Call store_scattering.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 38b22e9dc11..bb1d3ad1b7e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,17 @@
+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.
+
2009-08-05 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (scop_do_strip_mine): Call store_scattering.
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;
}
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-1.c b/gcc/testsuite/gcc.dg/graphite/interchange-1.c
index 011d98e2cfc..3d3da117d17 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-1.c
@@ -16,5 +16,5 @@ int foo(int N, int *res)
*res = sum + N;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-2.c b/gcc/testsuite/gcc.dg/graphite/interchange-2.c
index 5a64f9a6f47..4c9ed5ba800 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-2.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-2.c
@@ -20,5 +20,5 @@ int foo(int N, int *res)
*res = sum + N;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-3.c b/gcc/testsuite/gcc.dg/graphite/interchange-3.c
index d081d9e33d5..bd3dde671a2 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-3.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-3.c
@@ -15,5 +15,5 @@ int foo(int N, int *res)
*res = sum + N;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-4.c b/gcc/testsuite/gcc.dg/graphite/interchange-4.c
index 52fc1709dd1..d7af311ff9b 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-4.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-4.c
@@ -14,5 +14,5 @@ int foo(int N, int *res)
*res = sum + N;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-7.c b/gcc/testsuite/gcc.dg/graphite/interchange-7.c
index 7627830586a..7128fa32073 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-7.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-7.c
@@ -10,5 +10,5 @@ double foo(double *a)
return r;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */