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 gimplify_expr #23868

Closed
ALTree opened this issue Feb 16, 2018 · 3 comments
Closed

gccgo: internal compiler error: in gimplify_expr #23868

ALTree opened this issue Feb 16, 2018 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Feb 16, 2018

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

package p

var F func([0]int) int
var G func() [0]int

var V = make([]int, F(G()))

crashes gccgo (GCC) 7.2.0 and gccgo (GCC) 8.0.1 20180205 (experimental), with the following error (for gcc8):

test.go: In function ‘p.go.p..import’:
test.go:6:21: internal compiler error: in gimplify_expr, at gimplify.c:12382
 var V = make([]int, F(G()))
                     ^
0x9b0917 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:12382
0x99f594 gimplify_expr
	../../gcc-trunk/gcc/gimplify.c:12430
0x9b89bf gimplify_call_expr
	../../gcc-trunk/gcc/gimplify.c:3385
0x9ad3a7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11406
0x9bbbe7 gimplify_modify_expr
	../../gcc-trunk/gcc/gimplify.c:5626
0x9aceed gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11435
0x9b1926 gimplify_stmt(tree_node**, gimple**)
	../../gcc-trunk/gcc/gimplify.c:6658
0x9b25d2 gimplify_and_add(tree_node*, gimple**)
	../../gcc-trunk/gcc/gimplify.c:441
0x9b25d2 gimplify_decl_expr
	../../gcc-trunk/gcc/gimplify.c:1714
0x9ae6b2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11631
0x9b1926 gimplify_stmt(tree_node**, gimple**)
	../../gcc-trunk/gcc/gimplify.c:6658
0x9ae033 gimplify_statement_list
	../../gcc-trunk/gcc/gimplify.c:1767
0x9ae033 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11863
0x9b1926 gimplify_stmt(tree_node**, gimple**)
	../../gcc-trunk/gcc/gimplify.c:6658
0x9b435d gimplify_bind_expr
	../../gcc-trunk/gcc/gimplify.c:1335
0x9ad0eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11635
0x9b1926 gimplify_stmt(tree_node**, gimple**)
	../../gcc-trunk/gcc/gimplify.c:6658
0x9ae033 gimplify_statement_list
	../../gcc-trunk/gcc/gimplify.c:1767
0x9ae033 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)
	../../gcc-trunk/gcc/gimplify.c:11863
0x9b1926 gimplify_stmt(tree_node**, gimple**)
	../../gcc-trunk/gcc/gimplify.c:6658
@ALTree ALTree added this to the Gccgo milestone Feb 16, 2018
@ALTree
Copy link
Member Author

ALTree commented Jul 13, 2021

(Still reproducible in gccgo 11.1)

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2021
@gopherbot
Copy link

Change https://go.dev/cl/417481 mentions this issue: test: add test that caused gccgo to crash

@ianlancetaylor
Copy link
Contributor

I've committed a fix to GCC mainline to fix this problem. This was a problem in the interface between the gofrontend code the GCC middle-end. Thanks for reporting the bug.

xionghul pushed a commit to xionghul/gcc that referenced this issue Jul 15, 2022
Test case is https://go.dev/cl/417481.

Fixes golang/go#23868

	* go-gcc.cc (Gcc_backend::call_expression): Handle a void
	argument, as for f(g()) where g returns a zero-sized type.
timll pushed a commit to timll/gcc that referenced this issue Jul 16, 2022
Test case is https://go.dev/cl/417481.

Fixes golang/go#23868

	* go-gcc.cc (Gcc_backend::call_expression): Handle a void
	argument, as for f(g()) where g returns a zero-sized type.
gopherbot pushed a commit that referenced this issue Aug 19, 2022
For #23868

Change-Id: I07b001836e8d1411609ab84786398a5b575bf8d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/417481
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
@golang golang locked and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants