aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index afdc7f8..7fbdd07 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -1098,9 +1098,13 @@ Gcc_backend::set_placeholder_struct_type(
if (TYPE_NAME(t) != NULL_TREE)
{
// Build the data structure gcc wants to see for a typedef.
- tree copy = build_variant_type_copy(t);
+ tree copy = build_distinct_type_copy(t);
TYPE_NAME(copy) = NULL_TREE;
DECL_ORIGINAL_TYPE(TYPE_NAME(t)) = copy;
+ TYPE_SIZE(copy) = NULL_TREE;
+ Btype* bc = this->make_type(copy);
+ this->fill_in_struct(bc, fields);
+ delete bc;
}
return r->get_tree() != error_mark_node;