aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-11-08 05:46:22 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-11-08 05:46:22 +0000
commit7d6c5039bb1030e01a66a8cf4525abff4b825276 (patch)
tree4524118a1bb0b493bac3457deaf2adf930f25093 /gcc
parent26e3d0ae64120aa70079e404b8bc0f61b306833b (diff)
downloadgcc-7d6c5039bb1030e01a66a8cf4525abff4b825276.zip
gcc-7d6c5039bb1030e01a66a8cf4525abff4b825276.tar.gz
gcc-7d6c5039bb1030e01a66a8cf4525abff4b825276.tar.bz2
compiler: Correct types when type conversion makes backend call.
From-SVN: r204559
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/expressions.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index c4d3268..7269f58 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -3351,9 +3351,10 @@ Type_conversion_expression::do_get_tree(Translate_context* context)
return se->get_tree(context);
}
- Call_expression* i2s_expr =
+ Expression* i2s_expr =
Runtime::make_call(Runtime::INT_TO_STRING, this->location(), 1,
this->expr_);
+ i2s_expr = Expression::make_cast(type, i2s_expr, this->location());
ret = i2s_expr->get_tree(context);
}
else if (type->is_string_type() && expr_type->is_slice_type())
@@ -3405,7 +3406,7 @@ Type_conversion_expression::do_get_tree(Translate_context* context)
Type* e = type->array_type()->element_type()->forwarded();
go_assert(e->integer_type() != NULL);
- Call_expression* s2a_expr;
+ Expression* s2a_expr;
if (e->integer_type()->is_byte())
s2a_expr = Runtime::make_call(Runtime::STRING_TO_BYTE_ARRAY,
this->location(), 1, this->expr_);
@@ -3415,6 +3416,8 @@ Type_conversion_expression::do_get_tree(Translate_context* context)
s2a_expr = Runtime::make_call(Runtime::STRING_TO_INT_ARRAY,
this->location(), 1, this->expr_);
}
+ s2a_expr = Expression::make_unsafe_cast(type, s2a_expr,
+ this->location());
ret = s2a_expr->get_tree(context);
}
else if ((type->is_unsafe_pointer_type()