diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-02-14 21:07:13 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-02-14 21:07:13 +0000 |
commit | a6c723e202ebd5ae388ca04b7be5ff6fbe70439f (patch) | |
tree | 546527b1dfc6648f57ba6cdc3e4b317040f4d3ee /gcc | |
parent | cc2593977ba32d6c37a8f8f94c2479fc6a560e85 (diff) | |
download | gcc-a6c723e202ebd5ae388ca04b7be5ff6fbe70439f.zip gcc-a6c723e202ebd5ae388ca04b7be5ff6fbe70439f.tar.gz gcc-a6c723e202ebd5ae388ca04b7be5ff6fbe70439f.tar.bz2 |
re PR go/89321 (cross build with riscv64 gccgo compilation failed due to assert in constructor_expression)
PR go/89321
compiler: copy has_padding field from converted struct
Test case is https://golang.org/cl/162617.
Fixes https://gcc.gnu.org/PR89321
Reviewed-on: https://go-review.googlesource.com/c/162618
From-SVN: r268904
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index f74b5f8..ebf8cd5 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -a487c86418488f6a17dab4f9945e2a5d495e3ddb +c2fc3b83d832725accd4fa5874a5b5ca02dd90dc The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index e411456..9081af6 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1003,6 +1003,16 @@ Type::get_backend(Gogo* gogo) ins.first->second.is_placeholder = false; } + // We set the has_padding field of a Struct_type when we convert + // to the backend type, so if we have multiple Struct_type's + // mapping to the same backend type we need to copy the + // has_padding field. FIXME: This is awkward. We shouldn't + // really change the type when setting the backend type, but + // there isn't any other good time to add the padding field. + if (ins.first->first->struct_type() != NULL + && ins.first->first->struct_type()->has_padding()) + this->struct_type()->set_has_padding(); + return ins.first->second.btype; } |