go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as using structural equality.
authorIan Lance Taylor <iant@golang.org>
Sat, 3 Feb 2018 17:01:46 +0000 (17:01 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 3 Feb 2018 17:01:46 +0000 (17:01 +0000)
* go-gcc.cc (Gcc_backend::fill_in_struct): Mark struct types as
using structural equality.

From-SVN: r257357

gcc/go/ChangeLog
gcc/go/go-gcc.cc

index 720b0e4d934e95fc5231a85908a871bde52e9052..b63a969e377cabebe5e0c0466ef0a3847b9d3a8f 100644 (file)
@@ -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
index 71029dd609adec6df28144675b478a9b98aef58d..61e8493d0abb1c04630c98b762714decf5b78af5 100644 (file)
@@ -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;
 }