This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][GRAPHITE] Fix ISL memory management issue
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: sebpop at gmail dot com
- Date: Tue, 17 Oct 2017 15:55:37 +0200 (CEST)
- Subject: [PATCH][GRAPHITE] Fix ISL memory management issue
- Authentication-results: sourceware.org; auth=none
The isl_union_map operations always take the existing map and return
a new one but scop_get_reads_and_writes tries to operate on its
parameters in-place. This fails once a re-allocation happens leading
to "interesting" issues (like random segfaults with
-fdump-tree-graphite-details on larger testcases).
Fixed as follows.
Committed as obvious.
Richard.
2017-10-17 Richard Biener <rguenther@suse.de>
* graphite-dependences.c (scop_get_reads_and_writes): Change
output parameters to references.
Index: gcc/graphite-dependences.c
===================================================================
--- gcc/graphite-dependences.c (revision 253811)
+++ gcc/graphite-dependences.c (working copy)
@@ -67,9 +67,9 @@ add_pdr_constraints (poly_dr_p pdr, poly
reads are returned in READS and writes in MUST_WRITES and MAY_WRITES. */
static void
-scop_get_reads_and_writes (scop_p scop, isl_union_map *reads,
- isl_union_map *must_writes,
- isl_union_map *may_writes)
+scop_get_reads_and_writes (scop_p scop, isl_union_map *&reads,
+ isl_union_map *&must_writes,
+ isl_union_map *&may_writes)
{
int i, j;
poly_bb_p pbb;