golang/go

gccgo: internal compiler error: in write_equal_function

ALTree opened this issue · 0 comments

$ gccgo --version
gccgo (GCC) 11.0.1 20210317 (experimental)
package main

const B = false

func main() {
	if B {
		var m map[int]struct {
			f float64
		}
		_ = func() float64 {
			return m[0].f
		}
	}
}
$ gccgo crash.go
go1: internal compiler error: in write_equal_function, at go/gofrontend/types.cc:2303
  0x16ad6e9 internal_error(char const*, ...)
  0x6e4be6 fancy_abort(char const*, int, char const*)
  0x7c3f6a Type::write_equal_function(Gogo*, Named_type*, long, Backend_name const*, Function_type*)
  0x7c4262 Type::build_equal_function(Gogo*, Named_type*, long, Function_type*)
  0x7cc337 Type::equal_function(Gogo*, Named_type*, Function_type*)
  0x7cf87c Type::type_descriptor_constructor(Gogo*, int, Named_type*, Methods const*, bool)
  0x7d07bc Struct_type::do_type_descriptor(Gogo*, Named_type*)
  0x7c7c7f Type::make_type_descriptor_var(Gogo*)
  0x7c838f Type::type_descriptor_pointer(Gogo*, Location)
...

Also crashes gccgo 10.2.

cc @ianlancetaylor @thanm