compiler: don't set btype_ too early for alias type
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 17 Jul 2018 18:27:22 +0000 (18:27 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 17 Jul 2018 18:27:22 +0000 (18:27 +0000)
    CL 123362 introduced a bug in creating alias type's backend
    representation. A type's btype_ should not be set before
    named types are converted if it is a placeholder. For alias
    type, it is set too early. This may result in unresolved
    placeholders. This CL fixes it.

    Reviewed-on: https://go-review.googlesource.com/123975

From-SVN: r262833

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index f9d37e728e777677083fc42f8960ff849103fde6..726bf3ab906802b19cee43140e28b63f7fb0ad23 100644 (file)
@@ -1,4 +1,4 @@
-d6338c94e5574b63469c740159d064e89c6718bf
+38850073f25f9de4f3daa33d799def3a33c942ab
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index fa8c0ad1901af651806e67d0d1a6c70f52b64702..2fb67064471ecb70ea84c0c93eb3f957680c3f7f 100644 (file)
@@ -992,8 +992,10 @@ Type::get_backend(Gogo* gogo)
     return this->btype_;
 
   if (this->named_type() != NULL && this->named_type()->is_alias()) {
-    this->btype_ = this->unalias()->get_backend(gogo);
-    return this->btype_;
+    Btype* bt = this->unalias()->get_backend(gogo);
+    if (gogo != NULL && gogo->named_types_are_converted())
+      this->btype_ = bt;
+    return bt;
   }
 
   if (this->forward_declaration_type() != NULL