aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-06-14 00:47:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-06-14 00:47:38 +0000
commitc4675e5e5c10fba2f68fa086453e924481aaacd4 (patch)
tree121f3148c1a3b20c45aa825c7900b44bac0799a9 /gcc
parentf7a70512cbff7adae1fec817be6d98d0ef5666fa (diff)
downloadgcc-c4675e5e5c10fba2f68fa086453e924481aaacd4.zip
gcc-c4675e5e5c10fba2f68fa086453e924481aaacd4.tar.gz
gcc-c4675e5e5c10fba2f68fa086453e924481aaacd4.tar.bz2
compiler: Avoid unnecessary interface conversions.
From-SVN: r188545
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/expressions.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index f9c80b3..a2ac987 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -168,7 +168,8 @@ Expression::convert_for_assignment(Translate_context* context, Type* lhs_type,
if (lhs_type_tree == error_mark_node)
return error_mark_node;
- if (lhs_type != rhs_type && lhs_type->interface_type() != NULL)
+ if (lhs_type->forwarded() != rhs_type->forwarded()
+ && lhs_type->interface_type() != NULL)
{
if (rhs_type->interface_type() == NULL)
return Expression::convert_type_to_interface(context, lhs_type,
@@ -179,7 +180,8 @@ Expression::convert_for_assignment(Translate_context* context, Type* lhs_type,
rhs_type, rhs_tree,
false, location);
}
- else if (lhs_type != rhs_type && rhs_type->interface_type() != NULL)
+ else if (lhs_type->forwarded() != rhs_type->forwarded()
+ && rhs_type->interface_type() != NULL)
return Expression::convert_interface_to_type(context, lhs_type, rhs_type,
rhs_tree, location);
else if (lhs_type->is_slice_type() && rhs_type->is_nil_type())