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

cmd/compile: internal compiler error: panic during lower (integer divide by zero) #43099

Closed
ALTree opened this issue Dec 9, 2020 · 1 comment
Closed

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Dec 9, 2020

go version go1.14.13 linux/amd64
go version go1.15.6 linux/amd64
go version devel +854a2f8e01 Wed Dec 9 03:06:41 2020 +0000 linux/amd64

The following program:

package p

func f() {
	var i int
	var s string
	for i > 0 {
		_ = s[0]
		i++
	}

	var c chan int
	c <- 1 % i
}

Crashes the 1.14, 1.15, and tip compilers, when compiled for arm, mips, or mipsle, with this error:

$ GOARCH=arm go tool compile crash.go

crash.go:6:10: internal compiler error: 'f': panic during lower while compiling f:

runtime error: integer divide by zero

goroutine 1 [running]:
cmd/compile/internal/ssa.Compile.func1(0xc00045c550, 0xc0001506e0)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:48 +0xa5
panic(0xc34f20, 0x11182c0)
	/home/alberto/go/src/runtime/panic.go:965 +0x1b9
cmd/compile/internal/ssa.rewriteValueARM_OpSelect1(0xc000400a10, 0xc000400400)
	/home/alberto/go/src/cmd/compile/internal/ssa/rewriteARM.go:15681 +0x1f7
cmd/compile/internal/ssa.rewriteValueARM(0xc000400a10, 0xc000000000)
	/home/alberto/go/src/cmd/compile/internal/ssa/rewriteARM.go:807 +0x3e7d

[...]

Tentatively putting in the 1.16 milestone, pending investigation.

cc @randall77

@ALTree ALTree added this to the Go1.16 milestone Dec 9, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Dec 9, 2020

Change https://golang.org/cl/276652 mentions this issue: cmd/compile: don't constant fold divide by zero

Loading

@golang golang deleted a comment Dec 9, 2020
@gopherbot gopherbot closed this in 6c64b6d Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants