From: ian Date: Wed, 9 Jan 2019 23:38:55 +0000 (+0000) Subject: PR go/86343 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8059ac97b44da9e713198432a64e7421f4ae195;p=thirdparty%2Fgcc.git PR go/86343 * go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Go back to build_distinct_type_copy, but copy the fields so that they have the right DECL_CONTEXT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267789 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 64e20cd128a4..0a579bd94177 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,10 @@ +2019-01-09 Ian Lance Taylor + + PR go/86343 + * go-gcc.cc (Gcc_backend::set_placeholder_struct_type): Go back to + build_distinct_type_copy, but copy the fields so that they have + the right DECL_CONTEXT. + 2019-01-09 Sandra Loosemore PR other/16615 diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index afdc7f8c5b2b..7fbdd0741191 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;