diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-02-03 17:01:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-02-03 17:01:46 +0000 |
commit | 3df9a1fe73b4e28cbcf9390adc4dafcd9aad5e30 (patch) | |
tree | cebf38d9f6cb792477b592513583babcc5dcbe1f /gcc | |
parent | 2c536ce7b6a3a75ef4b43e94e1575122e3a962ca (diff) | |
download | gcc-3df9a1fe73b4e28cbcf9390adc4dafcd9aad5e30.zip gcc-3df9a1fe73b4e28cbcf9390adc4dafcd9aad5e30.tar.gz gcc-3df9a1fe73b4e28cbcf9390adc4dafcd9aad5e30.tar.bz2 |
go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as using structural equality.
* go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as
using structural equality.
From-SVN: r257357
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/go/go-gcc.cc | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index 720b0e4..b63a969 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2018-02-03 Ian Lance Taylor <iant@golang.org> + + * go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as + using structural equality. + 2018-02-02 Ian Lance Taylor <iant@golang.org> * go-gcc.cc (Gcc_backend::type_size): Return 0 for diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 71029dd6..61e8493 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -962,6 +962,13 @@ Gcc_backend::fill_in_struct(Btype* fill, } TYPE_FIELDS(fill_tree) = field_trees; layout_type(fill_tree); + + // Because Go permits converting between named struct types and + // equivalent struct types, for which we use VIEW_CONVERT_EXPR, and + // because we don't try to maintain TYPE_CANONICAL for struct types, + // we need to tell the middle-end to use structural equality. + SET_TYPE_STRUCTURAL_EQUALITY(fill_tree); + return fill; } |