diff mbox series

[GRAPHITE] Fix ISL memory management issue

Message ID alpine.LSU.2.20.1710171554030.5588@zhemvz.fhfr.qr
State New
Headers show
Series [GRAPHITE] Fix ISL memory management issue | expand

Commit Message

Richard Biener Oct. 17, 2017, 1:55 p.m. UTC
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.
diff mbox series

Patch

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;