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 in linux/loong64 #53018

Closed
ALTree opened this issue May 20, 2022 · 2 comments
Closed

cmd/compile: internal compiler error: panic during lower in linux/loong64 #53018

ALTree opened this issue May 20, 2022 · 2 comments
Labels
arch-loong64 NeedsFix
Milestone

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented May 20, 2022

$ gotip version
go version devel go1.19-69b412b7d6 Fri May 20 19:01:40 2022 +0000 linux/amd64
package p

var V []int

func f(i int, c chan int) int {
	arr := []int{0, 1}
	for range c {
		for a2 := range arr {
			var a []int
			V = V[:1/a2]
			a[i] = 0
		}
		return func() int {
			arr = []int{}
			return func() int {
				return func() int {
					return func() int { return 4 }()
				}()
			}()
		}()
	}

	return 0
}
$ GOARCH=loong64 gotip tool compile crash.go

crash.go:7:6: 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()
	/home/alberto/gotip/src/cmd/compile/internal/ssa/compile.go:50 +0x71
panic({0xcc28e0, 0x133b7b0})
	/home/alberto/gotip/src/runtime/panic.go:884 +0x212
cmd/compile/internal/ssa.rewriteValueLOONG64_OpSelect1(0xc0004819d0)
	/home/alberto/gotip/src/cmd/compile/internal/ssa/rewriteLOONG64.go:7060 +0x6cd
cmd/compile/internal/ssa.rewriteValueLOONG64(0xc0004b7940?)
	/home/alberto/gotip/src/cmd/compile/internal/ssa/rewriteLOONG64.go:573 +0x1e71
cmd/compile/internal/ssa.applyRewrite(0xc0004028c0, 0xd67b50, 0xd67bd0, 0x1)
	/home/alberto/gotip/src/cmd/compile/internal/ssa/rewrite.go:133 +0xfd6
cmd/compile/internal/ssa.lower(0xc0004028c0?)
	/home/alberto/gotip/src/cmd/compile/internal/ssa/lower.go:10 +0x2f
cmd/compile/internal/ssa.Compile(0xc0004028c0)
	/home/alberto/gotip/src/cmd/compile/internal/ssa/compile.go:98 +0x9be

...

cc @XiaodongLoong

@ALTree ALTree added the NeedsInvestigation label May 20, 2022
@ALTree ALTree added this to the Go1.19 milestone May 20, 2022
@ALTree ALTree changed the title cmd/compile: internal compiler error: panic during lower [GOARCH=loong64] cmd/compile: internal compiler error: panic during lower in linux/loong64 May 20, 2022
@XiaodongLoong
Copy link
Contributor

@XiaodongLoong XiaodongLoong commented May 21, 2022

Thanks!

CC @golang/loong64

@mengzhuo mengzhuo added the arch-loong64 label May 21, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented May 21, 2022

Change https://go.dev/cl/407655 mentions this issue: cmd/compile: fix loong64 constant folding in signed division

@dmitshur dmitshur added NeedsFix and removed NeedsInvestigation labels May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-loong64 NeedsFix
Projects
None yet
Development

No branches or pull requests

5 participants