summaryrefslogtreecommitdiff
path: root/isl_space.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2012-12-07 17:51:13 +0100
committerSven Verdoolaege <skimo@kotnet.org>2012-12-07 19:59:31 +0100
commit39d7b91232de7df496918407fab545a797ebe79b (patch)
treed362915aa502ec6a4c834f8b345daad9e6245088 /isl_space.c
parent8e48cf6c8c4b069a90f33f50a446bfe317e7618e (diff)
downloadisl-39d7b91232de7df496918407fab545a797ebe79b.tar.gz
isl-39d7b91232de7df496918407fab545a797ebe79b.tar.bz2
isl-39d7b91232de7df496918407fab545a797ebe79b.zip
isl_hash_dim: make result independent of endianness
The result computed by isl_hash_dim may affect the order of maps in a union map, which may in turn affect the result of AST generation. In particular, we would generate slightly different output depending on endianness, causing the tests to fail on big endian machines since the generated output is compared to output generated on a little endian machine. Instead of hashing in the dimensions of the space as integers, we now only hash in the least significant byte. This has some effect on the results of AST generation, but the output should now be the same on little endian and big endian. Reported-by: Richard Biener <rguenther@suse.de> Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_space.c')
-rw-r--r--isl_space.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/isl_space.c b/isl_space.c
index b0aca350..e6f957c4 100644
--- a/isl_space.c
+++ b/isl_space.c
@@ -1549,9 +1549,9 @@ static uint32_t isl_hash_dim(uint32_t hash, __isl_keep isl_space *dim)
if (!dim)
return hash;
- hash = isl_hash_builtin(hash, dim->nparam);
- hash = isl_hash_builtin(hash, dim->n_in);
- hash = isl_hash_builtin(hash, dim->n_out);
+ isl_hash_byte(hash, dim->nparam % 256);
+ isl_hash_byte(hash, dim->n_in % 256);
+ isl_hash_byte(hash, dim->n_out % 256);
for (i = 0; i < dim->nparam; ++i) {
id = get_id(dim, isl_dim_param, i);