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 gen_reg_rtx, at emit-rtl #56113

Closed
ALTree opened this issue Oct 9, 2022 · 4 comments
Closed

gccgo: internal compiler error: in gen_reg_rtx, at emit-rtl #56113

ALTree opened this issue Oct 9, 2022 · 4 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 Oct 9, 2022

$ gccgo --version
gccgo (Debian 12.2.0-3) 12.2.0
package main

type S string

func main() {
	m := map[int]int{1: 1}
	println(m[len(S(""))])
}
$ gccgo crash.go 

go1: internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1199
0x7fc936229209 __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x7fc9362292bb __libc_start_main_impl
	../csu/libc-start.c:389
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 9, 2022
@ALTree ALTree added this to the Gccgo milestone Oct 9, 2022
@ianlancetaylor
Copy link
Contributor

Interestingly it only fails when compiling without optimization.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/441555 mentions this issue: compiler: treat S("") as a string constant

@ALTree
Copy link
Member Author

ALTree commented Oct 9, 2022

Interestingly it only fails when compiling without optimization.

At least on gccgo 12.2.0, I see a crash on -O2 too. Godbolt link.

@ianlancetaylor
Copy link
Contributor

Hmmm, I see that in your Godbolt link but I haven't been able to recreate it locally. Odd. But I guess it doesn't matter too much.

nstester pushed a commit to nstester/gcc that referenced this issue Oct 10, 2022
The compiler neglected to notice that a conversion from a string
constant to a string type was a valid string constant.

No test case because this only caused a compiler failure when compiling
without optimization, which is not the normal case, and is not a case
that we test.

Fixes golang/go#56113

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/441555
@golang golang locked and limited conversation to collaborators Oct 10, 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