iscc.c: print_code: do not assume isl_union_map_get_space returns params space
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 3 Feb 2013 15:13:19 +0000 (3 16:13 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 3 Feb 2013 15:13:19 +0000 (3 16:13 +0100)
Although the space of an isl_union_map is only used to keep track of the
parameters, we do not enforce that this space is a pure parameter space.
We therefore should not assume that it is.

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

diff --git a/iscc.c b/iscc.c
index 825cbf1..a0d4f90 100644 (file)
--- a/iscc.c
+++ b/iscc.c
@@ -1819,12 +1819,14 @@ static __isl_give isl_printer *print_code(__isl_take isl_printer *p,
        __isl_take isl_union_map *schedule,
        __isl_take isl_union_map *options)
 {
+       isl_space *space;
        isl_set *context;
        isl_ast_build *build;
        isl_ast_node *tree;
        int format;
 
-       context = isl_set_universe(isl_union_map_get_space(schedule));
+       space = isl_union_map_get_space(schedule);
+       context = isl_set_universe(isl_space_params(space));
 
        build = isl_ast_build_from_context(context);
        build = isl_ast_build_set_options(build, options);