isl_tab_relax: prevent relaxation on dead or redundant constraints
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 13 Apr 2012 11:01:21 +0000 (13:01 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 13 Apr 2012 11:03:07 +0000 (13:03 +0200)
Trying to relax such constraints can only lead to problems,
especially if the constraints have been removed from the tableau.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_tab.c

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;