dataflow analysis: don't depend on word size during sorting of sources
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 22 Apr 2011 16:12:17 +0000 (18:12 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 22 Apr 2011 16:12:47 +0000 (18:12 +0200)
The comparison routine would compute the difference between two
unsigned numbers, which would result in different signs depending
on the machine word size.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_flow.c

index 9a269b2..821d8ef 100644 (file)
@@ -188,7 +188,7 @@ static int access_sort_cmp(const void *p1, const void *p2)
 
        h1 = isl_map_get_hash(i1->source_map);
        h2 = isl_map_get_hash(i2->source_map);
-       return h1 - h2;
+       return h1 > h2 ? 1 : h1 < h2 ? -1 : 0;
 }
 
 /* Sort the must source accesses in order of increasing number of shared