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  <rguent...@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;

Reply via email to