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: Invalid PPC64 rotate mask #45589

Closed
ALTree opened this issue Apr 15, 2021 · 5 comments
Closed

cmd/compile: internal compiler error: Invalid PPC64 rotate mask #45589

ALTree opened this issue Apr 15, 2021 · 5 comments

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Apr 15, 2021

$ go version
go version go1.16.3 linux/amd64
$ gotip version
go version devel go1.17-31e12b953a Thu Apr 15 14:58:38 2021 +0000 linux/amd64
package p

func f() {
	var a, b byte

	switch a {
	case 2:
	case a:
		a, b = 1, a&1
	}
	if b > 0 {
		b = 2
	}

	println(a >> b &^ b)
}
$ GOARCH=ppc64 go tool compile crash.go

crash.go:16:1: internal compiler error: 'f': panic during lower while compiling f:

Invalid PPC64 rotate mask

goroutine 1 [running]:
cmd/compile/internal/ssa.Compile.func1(0xc00045c550, 0xc000152420)
	/usr/local/go/src/cmd/compile/internal/ssa/compile.go:48 +0xa5
panic(0xc252e0, 0xdb4950)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
cmd/compile/internal/ssa.encodePPC64RotateMask(0x20, 0xffffffff, 0x20, 0xc0004003f0)
	/usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:1402 +0x165
cmd/compile/internal/ssa.mergePPC64AndSrwi(0xffffffffffffffff, 0x0, 0xc000459250)
	/usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:1472 +0x8f
cmd/compile/internal/ssa.rewriteValuePPC64_OpPPC64AND(0xc000400850, 0xffffffffffffff01)
	/usr/local/go/src/cmd/compile/internal/ssa/rewritePPC64.go:4319 +0x36f
cmd/compile/internal/ssa.rewriteValuePPC64(0xc000400850, 0x0)
	/usr/local/go/src/cmd/compile/internal/ssa/rewritePPC64.go:442 +0x4b9
cmd/compile/internal/ssa.applyRewrite(0xc000152420, 0xcc9508, 0xcc9588, 0x6c142f4bd301)
	/usr/local/go/src/cmd/compile/internal/ssa/rewrite.go:129 +0x50d
cmd/compile/internal/ssa.lower(0xc000152420)
	/usr/local/go/src/cmd/compile/internal/ssa/lower.go:10 +0x4b
cmd/compile/internal/ssa.Compile(0xc000152420)
	/usr/local/go/src/cmd/compile/internal/ssa/compile.go:96 +0x98d
cmd/compile/internal/gc.buildssa(0xc0001522c0, 0x0, 0x0)
	/usr/local/go/src/cmd/compile/internal/gc/ssa.go:470 +0x11ba
cmd/compile/internal/gc.compileSSA(0xc0001522c0, 0x0)
	/usr/local/go/src/cmd/compile/internal/gc/pgen.go:319 +0x5d
cmd/compile/internal/gc.compile(0xc0001522c0)
	/usr/local/go/src/cmd/compile/internal/gc/pgen.go:277 +0x39e
cmd/compile/internal/gc.funccompile(0xc0001522c0)
	/usr/local/go/src/cmd/compile/internal/gc/pgen.go:220 +0xc5
cmd/compile/internal/gc.Main(0xcc92b8)
	/usr/local/go/src/cmd/compile/internal/gc/main.go:762 +0x3525
main.main()
	/usr/local/go/src/cmd/compile/main.go:52 +0xb1

cc @laboger @pmur

@ALTree ALTree added this to the Go1.17 milestone Apr 15, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 15, 2021

Change https://golang.org/cl/310569 mentions this issue: cmd/compile: fix ANDI/SRWI merge on ppc64

Loading

@gopherbot gopherbot closed this in c8fb0ec Apr 15, 2021
@pmur
Copy link
Contributor

@pmur pmur commented Apr 19, 2021

@gopherbot backport to 1.16 please

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 19, 2021

Backport issue(s) opened: #45636 (for 1.16).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 19, 2021

Change https://golang.org/cl/311378 mentions this issue: [release-branch.go1.16] cmd/compile: fix ANDI/SRWI merge on ppc64

Loading

@toothrot
Copy link
Contributor

@toothrot toothrot commented Apr 22, 2021

@ALTree Does this also impact 1.15? If so, we can open a backport for 1.15 as well.

Loading

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
4 participants