compiler: make single Btype for methods table of identical interface type

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 7 February 2018 01:52 EST

Normally we ensure to build a single Btype for identical types. We did not do this for methods table of identical interface types, however. If there are two identical interface type I, I2, they have the same Btype BI, but different Btypes for their methods tables, BM and BM2. From the backend's point of view only one of them is linked to BI. This can cause inconsitency in the backend's type system, like unresolved placeholder. This CL ensures we create a single Btype for methods table of identical interface type.

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

c961ab09d2b compiler: make single Btype for methods table of identical interface type
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/types.cc | 44 ++++++++++++++++++++++++++++++++++++++++----
gcc/go/gofrontend/types.h | 14 ++++++++++++++
3 files changed, 55 insertions(+), 5 deletions(-)

Upstream: gcc.gnu.org


  • Share