From: Sven Verdoolaege Date: Tue, 16 Apr 2013 09:49:05 +0000 (+0200) Subject: isl_map_simplify.c: div_is_redundant: ignore coefficients of unknown divs X-Git-Tag: isl-0.12~14^2~18 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fisl.git;a=commitdiff_plain;h=524407531f5680152cef4704a067c97d07ac4f3d isl_map_simplify.c: div_is_redundant: ignore coefficients of unknown divs If a div is unknown, then its coefficients are undefined so we should not take them into account while checking if some other div is redundant. In rare cases, looking at those undefined coefficients could result in system dependent behavior. Reported-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- diff --git a/isl_map_simplify.c b/isl_map_simplify.c index 34d6094..618d7df 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -1333,9 +1333,12 @@ static int div_is_redundant(struct isl_basic_map *bmap, int div) return 0; } - for (i = 0; i < bmap->n_div; ++i) + for (i = 0; i < bmap->n_div; ++i) { + if (isl_int_is_zero(bmap->div[i][0])) + continue; if (!isl_int_is_zero(bmap->div[i][1+pos])) return 0; + } return 1; }