aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoman Gareev <gareevroman@gmail.com>2014-07-30 13:18:16 +0000
committerRoman Gareev <romangareev@gcc.gnu.org>2014-07-30 13:18:16 +0000
commit6a7d8936f3db515ba34e59e6974793f433498188 (patch)
tree45e21cde83937b45a73ec51cdbb64cf684b44d42 /gcc
parent480156b2a34bb7f979b7f4f1f7339cf1ad569c07 (diff)
downloadgcc-6a7d8936f3db515ba34e59e6974793f433498188.zip
gcc-6a7d8936f3db515ba34e59e6974793f433498188.tar.gz
gcc-6a7d8936f3db515ba34e59e6974793f433498188.tar.bz2
[gcc/]
* graphite-isl-ast-to-gimple.c: (gcc_expression_from_isl_ast_expr_id): Add calling of fold_convert. (gcc_expression_from_isl_expression): Pass type to gcc_expression_from_isl_ast_expr_id. From-SVN: r213262
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c14
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6f074c..de72290 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-30 Roman Gareev <gareevroman@gmail.com>
+
+ * graphite-isl-ast-to-gimple.c:
+ (gcc_expression_from_isl_ast_expr_id): Add calling of fold_convert.
+ (gcc_expression_from_isl_expression): Pass type to
+ gcc_expression_from_isl_ast_expr_id.
+
2014-07-30 Richard Biener <rguenther@suse.de>
* lto-streamer.h (lto_write_data): New function.
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index b5631ca..fd04118 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -122,10 +122,16 @@ gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *,
ivs_params &ip);
/* Return the tree variable that corresponds to the given isl ast identifier
- expression (an isl_ast_expr of type isl_ast_expr_id). */
+ expression (an isl_ast_expr of type isl_ast_expr_id).
+
+ FIXME: We should replace blind conversation of id's type with derivation
+ of the optimal type when we get the corresponding isl support. Blindly
+ converting type sizes may be problematic when we switch to smaller
+ types. */
static tree
-gcc_expression_from_isl_ast_expr_id (__isl_keep isl_ast_expr *expr_id,
+gcc_expression_from_isl_ast_expr_id (tree type,
+ __isl_keep isl_ast_expr *expr_id,
ivs_params &ip)
{
gcc_assert (isl_ast_expr_get_type (expr_id) == isl_ast_expr_id);
@@ -136,7 +142,7 @@ gcc_expression_from_isl_ast_expr_id (__isl_keep isl_ast_expr *expr_id,
gcc_assert (res != ip.end () &&
"Could not map isl_id to tree expression");
isl_ast_expr_free (expr_id);
- return res->second;
+ return fold_convert (type, res->second);
}
/* Converts an isl_ast_expr_int expression E to a GCC expression tree of
@@ -351,7 +357,7 @@ gcc_expression_from_isl_expression (tree type, __isl_take isl_ast_expr *expr,
switch (isl_ast_expr_get_type (expr))
{
case isl_ast_expr_id:
- return gcc_expression_from_isl_ast_expr_id (expr, ip);
+ return gcc_expression_from_isl_ast_expr_id (type, expr, ip);
case isl_ast_expr_int:
return gcc_expression_from_isl_expr_int (type, expr);