isl_coalesce.c: wrap_in_facets: bail out if any of the facets are empty
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 23 Feb 2012 14:51:59 +0000 (15:51 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 23 Feb 2012 15:20:35 +0000 (16:20 +0100)
It the tableau corresponding to a facet is empty, then we don't have
accurate information on the ridges and we can't call add_wraps.
The facet can have no integer points due to other constraints.
An alternative would be to temporarily treat the tableau as a rational
tableau.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_coalesce.c
isl_test.c

index 1a4078e..531cbdc 100644 (file)
@@ -711,13 +711,16 @@ static int wrap_in_facets(struct isl_map *map, int i, int j,
                set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 1);
 
                isl_seq_neg(bound->el, map->p[i]->ineq[cuts[k]], 1 + total);
-               if (add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
+               if (!tabs[i]->empty &&
+                   add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
                        goto error;
 
                set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 0);
                if (isl_tab_rollback(tabs[i], snap_i) < 0)
                        goto error;
 
+               if (tabs[i]->empty)
+                       break;
                if (!wraps->n_row)
                        break;
 
index d464c70..7294518 100644 (file)
@@ -1056,6 +1056,9 @@ int test_coalesce(struct isl_ctx *ctx)
                return -1;
        if (test_coalesce_set(ctx, "{ [0,1]; [i,2i] : 1 <= i <= 10 }", 0) < 0)
                return -1;
+       if (test_coalesce_set(ctx, "{ [a, b] : exists e : 2e = a and "
+                   "a >= 0 and (a <= 3 or (b <= 0 and b >= -4 + a)) }", 0) < 0)
+               return -1;
        return 0;
 }