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
Labels
arch-loong64 Issues solely affecting the loongson architecture. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ALTree
Copy link
Member

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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

Thanks!

CC @golang/loong64

@mengzhuo mengzhuo added the arch-loong64 Issues solely affecting the loongson architecture. label May 21, 2022
@gopherbot
Copy link

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

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 23, 2022
@golang golang locked and limited conversation to collaborators May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-loong64 Issues solely affecting the loongson architecture. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants