From 39d7b91232de7df496918407fab545a797ebe79b Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 7 Dec 2012 17:51:13 +0100 Subject: 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 Signed-off-by: Sven Verdoolaege --- isl_space.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'isl_space.c') 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); -- cgit v1.2.3