golang/go

cmd/compile: treecopy Name

dvyukov opened this issue · 2 comments

Gc crashes on the following program:

package a
import "fmt"
const n = fmt
treecopy [0xc820209d40]
.   PACK l(2) a.fmt
tmp.go:3: internal compiler error: treecopy Name

This is a regression from Go1.4, it produced a sensible error message.

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

I also ran into this tonight in GO 1.5.1. Before finally finding this open issue, I took the time to upgrade to 1.5.3 and also tried 1.6 Beta 2. The fact that it still fails in all those versions is no surprise now given the "Unplanned, Go1.6" milestone target.

FWIW, in my case, I was using "crypto/x509," and I was trying to set my constant to x509.RSA (one of the three defined PublicKeyAlgorithms). Obviously, it was a silly mistake to leave off the ".RSA", but with that esoteric compiler error, it took me a few minutes to track down the problem, especially since I had made several other changes in my source files since my last successful compile.

Yes, once understood, the user error is easily correctable, but given this is apparently a regression from 1.4, please consider fixing for a 1.6 minor release or 1.7.

CL https://golang.org/cl/21936 mentions this issue.