Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: internal compiler error: in struct_field_expression #23870

Open
ALTree opened this issue Feb 16, 2018 · 0 comments

Comments

@ALTree
Copy link
Member

commented Feb 16, 2018

The following program (reduced from a gosmith-generated one)

package p

var F func() [0]struct{
	A int 
}

var i int
var V = (F()[i]).A

crashes gccgo (GCC) 8.0.1 20180205 (experimental) with the following error:

go1: internal compiler error: in struct_field_expression, at go/go-gcc.cc:1539
0x6e164b Gcc_backend::struct_field_expression(Bexpression*, unsigned long, Location)
	../../gcc-trunk/gcc/go/go-gcc.cc:1539
0x6b8a81 Field_reference_expression::do_get_backend(Translate_context*)
	../../gcc-trunk/gcc/go/gofrontend/expressions.cc:11778
0x6c839b Type_conversion_expression::do_get_backend(Translate_context*)
	../../gcc-trunk/gcc/go/gofrontend/expressions.cc:3542
0x6ef008 Variable::get_init(Gogo*, Named_object*)
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:6670
0x703979 Gogo::write_globals()
	../../gcc-trunk/gcc/go/gofrontend/gogo.cc:1377

This gcc trunk build includes the fix for #22305, which no longer causes a crash; so I believe this is not a dup of #22305.

@ALTree ALTree added this to the Gccgo milestone Feb 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.