Repository navigation
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
c4ef597 caused a regression where the following coder no longer compiles:
type Foo struct{ A, B time.Duration }
func Bar(fs []Foo) string {
ss := make([]string, 2*len(fs))
for i, h := range fs {
ss[2*i] = fmt.Sprintf("%v %v", h.A, h.B.Seconds())
ss[2*i+1] = fmt.Sprintf("%v %v", h.A, h.B.Seconds())
}
return strings.Join(ss, ",")
}It now panics with:
./main.go:16: internal compiler error: attempt to load unspilled value v53 = MOVQload <time.Duration> {h} [8] v2 v117
goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
/home/rawr/Projects/go/src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0xaccaeb, 0x22, 0xc4204a4600, 0x1, 0x1)
/home/rawr/Projects/go/src/cmd/compile/internal/gc/subr.go:175 +0x230
cmd/compile/internal/gc.(*ssaExport).Fatalf(0xdd0af5, 0x100d00000001, 0xaccaeb, 0x22, 0xc4204a4600, 0x1, 0x1)
/home/rawr/Projects/go/src/cmd/compile/internal/gc/ssa.go:4929 +0x67
cmd/compile/internal/ssa.(*Config).Fatalf(0xc420452000, 0x100d00000001, 0xaccaeb, 0x22, 0xc4204a4600, 0x1, 0x1)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/config.go:345 +0x76
cmd/compile/internal/ssa.(*Func).Fatalf(0xc4204b4000, 0xaccaeb, 0x22, 0xc4204a4600, 0x1, 0x1)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/func.go:416 +0x72
cmd/compile/internal/ssa.(*regAllocState).allocValToReg(0xc4204d83c0, 0xc420453988, 0xffce, 0x100000001, 0xc400001233, 0xc4204551e8)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/regalloc.go:454 +0x58e
cmd/compile/internal/ssa.(*regAllocState).regalloc(0xc4204d83c0, 0xc4204b4000)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/regalloc.go:1188 +0x1731
cmd/compile/internal/ssa.regalloc(0xc4204b4000)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/regalloc.go:135 +0x62
cmd/compile/internal/ssa.Compile(0xc4204b4000)
/home/rawr/Projects/go/src/cmd/compile/internal/ssa/compile.go:70 +0x2c4
cmd/compile/internal/gc.buildssa(0xc4200b9180, 0x0)
/home/rawr/Projects/go/src/cmd/compile/internal/gc/ssa.go:173 +0x1060
cmd/compile/internal/gc.compile(0xc4200b9180)
/home/rawr/Projects/go/src/cmd/compile/internal/gc/pgen.go:366 +0x2d0
cmd/compile/internal/gc.funccompile(0xc4200b9180)
/home/rawr/Projects/go/src/cmd/compile/internal/gc/dcl.go:1226 +0xdc
cmd/compile/internal/gc.Main()
/home/rawr/Projects/go/src/cmd/compile/internal/gc/main.go:473 +0x202d
main.main()
/home/rawr/Projects/go/src/cmd/compile/main.go:50 +0x101
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Activity
gopherbot commentedon Feb 19, 2017
CL https://golang.org/cl/37250 mentions this issue.
funny-falcon commentedon Feb 21, 2017
Catched with same bit in code with defer.
Code looks like:
Unfortunately, can't build small reproduce case.
funny-falcon commentedon Feb 21, 2017
Changeset 37250 doesn't fix for me at the moment.
funny-falcon commentedon Feb 21, 2017
I reduced case to minimal. Looks like removing any line makes it compile
cherrymui commentedon Feb 21, 2017
@funny-falcon Thanks for the repro! However, the related values are not touched in the writebarrier pass, and they are in the correct order at that point. Later the tighten pass got something wrong. So it's a different bug. I'll take a look.
funny-falcon commentedon Feb 21, 2017
@cherrymui
panic("")could be changed to any non-empty line:ixw = 0,return nilorbreak- all still trigger error. But removing that line makes it compileable.cherrymui commentedon Feb 21, 2017
@funny-falcon, I filed issue #19217, since it is a different bug, and even apply to Go 1.8.
funny-falcon commentedon Feb 21, 2017
@cherrymui, thank you