Merge branch 'maint'
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 13 Apr 2012 11:29:57 +0000 (13:29 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 13 Apr 2012 11:29:57 +0000 (13:29 +0200)
isl_coalesce.c
isl_map.c
isl_polynomial.c
isl_tab.c
isl_test.c

index 0694ade..1a71661 100644 (file)
@@ -394,6 +394,9 @@ static int is_extension(struct isl_map *map, int i, int j, int k,
        struct isl_tab_undo *snap, *snap2;
        unsigned n_eq = map->p[i]->n_eq;
 
+       if (isl_tab_is_equality(tabs[i], n_eq + k))
+               return 0;
+
        snap = isl_tab_snap(tabs[i]);
        tabs[i] = isl_tab_relax(tabs[i], n_eq + k);
        snap2 = isl_tab_snap(tabs[i]);
index 58ac0ff..8023814 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -7066,7 +7066,7 @@ struct isl_map *isl_basic_map_union(
 {
        struct isl_map *map;
        if (!bmap1 || !bmap2)
-               return NULL;
+               goto error;
 
        isl_assert(bmap1->ctx, isl_space_is_equal(bmap1->dim, bmap2->dim), goto error);
 
index 132986e..6bccfba 100644 (file)
@@ -3482,7 +3482,7 @@ __isl_give isl_term *isl_term_dup(__isl_keep isl_term *term)
        isl_term *dup;
        unsigned total;
 
-       if (term)
+       if (!term)
                return NULL;
 
        total = isl_space_dim(term->dim, isl_dim_all) + term->div->n_row;
index 097b335..a5e55b0 100644 (file)
--- a/isl_tab.c
+++ b/isl_tab.c
@@ -2556,6 +2556,13 @@ struct isl_tab *isl_tab_relax(struct isl_tab *tab, int con)
 
        var = &tab->con[con];
 
+       if (var->is_row && (var->index < 0 || var->index < tab->n_redundant))
+               isl_die(tab->mat->ctx, isl_error_invalid,
+                       "cannot relax redundant constraint", goto error);
+       if (!var->is_row && (var->index < 0 || var->index < tab->n_dead))
+               isl_die(tab->mat->ctx, isl_error_invalid,
+                       "cannot relax dead constraint", goto error);
+
        if (!var->is_row && !max_is_manifestly_unbounded(tab, var))
                if (to_row(tab, var, 1) < 0)
                        goto error;
index 4fda4d8..f523a8e 100644 (file)
@@ -1106,6 +1106,12 @@ int test_coalesce(struct isl_ctx *ctx)
        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;
+       if (test_coalesce_set(ctx,
+               "{ [i, j, i', j'] : i <= 2 and j <= 2 and "
+                       "j' >= -1 + 2i + j - 2i' and i' <= -1 + i and "
+                       "j >= 1 and j' <= i + j - i' and i >= 1; "
+               "[1, 1, 1, 1] }", 0) < 0)
+               return -1;
        return 0;
 }