aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKonrad Trifunovic <konrad.trifunovic@gmail.com>2009-08-12 14:24:01 +0000
committerSebastian Pop <spop@gcc.gnu.org>2009-08-12 14:24:01 +0000
commit7491e5f00c515b69ad34ba3e41175e2017825f61 (patch)
treeed06f135bd5e97a946d4aeb926c98a52cf624f7e /gcc
parentf4648ed13904dcf3fc8af24896055843b46b2d96 (diff)
downloadgcc-7491e5f00c515b69ad34ba3e41175e2017825f61.zip
gcc-7491e5f00c515b69ad34ba3e41175e2017825f61.tar.gz
gcc-7491e5f00c515b69ad34ba3e41175e2017825f61.tar.bz2
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. Co-Authored-By: Sebastian Pop <sebastian.pop@amd.com> From-SVN: r150687
Diffstat (limited to 'gcc')
-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 60a0cc81..b7888b8 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 38b22e9..bb1d3ad 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 ed2f92e..1c29b18 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 011d98e..3d3da11 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 5a64f9a..4c9ed5b 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 d081d9e..bd3dde6 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 52fc170..d7af311 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 7627830..7128fa3 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" } } */