@@ -233,109 +233,6 @@
return Expression::convert_interface_to_type(context, lhs_type, rhs_type,
rhs_tree, location);
else if (lhs_type->is_open_array_type()
- && rhs_type->points_to() != NULL
- && rhs_type->points_to()->array_type() != NULL
- && !rhs_type->points_to()->is_open_array_type())
- {
- // Conversion from *[N]T to []T.
- gcc_assert(TREE_CODE(lhs_type_tree) == RECORD_TYPE);
-
- Array_type* rhs_at = rhs_type->points_to()->array_type();
-
- VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 3);
-
- tree bad_index = NULL_TREE;
- tree value_pointer;
- bool is_constant;
- if (!INDIRECT_REF_P(rhs_tree)
- || !TREE_CONSTANT(TREE_OPERAND(rhs_tree, 0))
- || !rhs_at->length()->is_constant())
- {
- if (!DECL_P(rhs_tree))
- rhs_tree = save_expr(rhs_tree);
- bad_index = build2(EQ_EXPR, boolean_type_node, rhs_tree,
- fold_convert(TREE_TYPE(rhs_tree),
- null_pointer_node));
- value_pointer = rhs_tree;
- is_constant = false;
- }
- else
- {
- tree decl;
- if (DECL_P(TREE_OPERAND(rhs_tree, 0)))
- value_pointer = rhs_tree;
- else
- {
- decl = build_decl(location, VAR_DECL, create_tmp_var_name("A"),
- TREE_TYPE(TREE_TYPE(rhs_tree)));
- DECL_EXTERNAL(decl) = 0;
- TREE_PUBLIC(decl) = 0;
- TREE_STATIC(decl) = 1;
- DECL_ARTIFICIAL(decl) = 1;
- DECL_INITIAL(decl) = build_fold_indirect_ref(rhs_tree);
- rest_of_decl_compilation(decl, 1, 0);
- value_pointer = build_fold_addr_expr(decl);
- }
- is_constant = true;
- }
-
- constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
- tree field = TYPE_FIELDS(lhs_type_tree);
- gcc_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
- "__values") == 0);
- elt->index = field;
- elt->value = value_pointer;
- if (is_constant)
- gcc_assert(TREE_CONSTANT(elt->value));
-
- elt = VEC_quick_push(constructor_elt, init, NULL);
- field = TREE_CHAIN(field);
- gcc_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
- "__count") == 0);
- elt->index = field;
- elt->value = fold_convert(TREE_TYPE(field),
- rhs_at->length_tree(gogo, error_mark_node));
- gcc_assert(elt->value != error_mark_node);
- if (is_constant)
- gcc_assert(TREE_CONSTANT(elt->value));
-
- elt = VEC_quick_push(constructor_elt, init, NULL);
- field = TREE_CHAIN(field);
- gcc_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
- "__capacity") == 0);
- elt->index = field;
- elt->value = fold_convert(TREE_TYPE(field),
- rhs_at->capacity_tree(gogo, error_mark_node));
- gcc_assert(elt->value != error_mark_node);
- if (is_constant)
- gcc_assert(TREE_CONSTANT(elt->value));
-
- tree val = build_constructor(lhs_type_tree, init);
- if (is_constant)
- TREE_CONSTANT(val) = 1;
-
- if (bad_index != NULL_TREE)
- {
- gcc_assert(!is_constant);
-
- // FIXME: Duplicates Array_index_expression::do_get_tree.
- static tree bad_index_fndecl;
- tree crash = Gogo::call_builtin(&bad_index_fndecl,
- location,
- "__go_bad_index",
- 0,
- void_type_node);
- TREE_NOTHROW(bad_index_fndecl) = 0;
- TREE_THIS_VOLATILE(bad_index_fndecl) = 1;
- val = build2(COMPOUND_EXPR, TREE_TYPE(val),
- build3(COND_EXPR, void_type_node,
- bad_index, crash, NULL_TREE),
- val);
- }
-
- return val;
- }
- else if (lhs_type->is_open_array_type()
&& rhs_type->is_nil_type())
{
// Assigning nil to an open array.