aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc7
1 files changed, 7 insertions, 0 deletions
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;
}