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: 'New': can't find source #32681

Closed
chanxuehong opened this issue Jun 19, 2019 · 2 comments
Closed

cmd/compile: internal compiler error: 'New': can't find source #32681

chanxuehong opened this issue Jun 19, 2019 · 2 comments

Comments

@chanxuehong
Copy link
Contributor

@chanxuehong chanxuehong commented Jun 19, 2019

What version of Go are you using (go version)?

go version go1.12.6 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/chan/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/chan/gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qw/ddvmdjjd35xcj6823_nz3z780000gn/T/go-build028699097=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

package main

import (
	"fmt"
)

func main() {
	fmt.Println(New().info)
}

type interfaceImpl struct {
	info [256]uint32
}

func New() *interfaceImpl {
	p := interfaceImpl{}
	for k := 0; k < 256; k++ {
		i := k*8 + 4
		if k == 0 {
			fmt.Println("debug")
		}
		p.info[k] = readLittleEndian32(data[i], data[i+1], data[i+2], data[i+3])
	}
	return &p
}

func readLittleEndian32(a, b, c, d byte) uint32 {
	return uint32(a) | (uint32(b) << 8) | (uint32(c) << 16) | (uint32(d) << 24)
}

var data = []byte{
	112, 1, 250, 10, 146, 254, 150, 46, 114, 115, 40, 141, 42, 144, 93, 5, 124, 166, 33, 115, 46, 36, 167, 13, 104, 240, 64, 6, 72, 10, 56, 108,
	161, 222, 173, 14, 112, 43, 206, 127, 75, 160, 97, 147, 37, 247, 164, 191, 227, 80, 14, 45, 239, 136, 118, 33, 250, 35, 139, 252, 139, 185, 14, 27,
	83, 174, 104, 224, 28, 124, 175, 193, 21, 182, 188, 44, 150, 225, 22, 54, 167, 33, 4, 137, 114, 213, 154, 164, 29, 48, 75, 39, 154, 70, 118, 162,
	35, 154, 52, 215, 141, 209, 130, 210, 110, 155, 130, 3, 44, 179, 118, 252, 142, 159, 95, 59, 33, 234, 242, 111, 204, 119, 84, 133, 154, 126, 134, 127,
	48, 128, 54, 115, 202, 210, 163, 134, 30, 9, 254, 117, 177, 15, 103, 158, 99, 205, 136, 196, 7, 84, 5, 103, 22, 168, 243, 20, 130, 125, 80, 62,
	18, 21, 9, 59, 150, 9, 33, 16, 138, 60, 221, 167, 42, 137, 197, 161, 31, 150, 168, 240, 12, 207, 169, 175, 132, 43, 74, 55, 171, 87, 227, 90,
	84, 161, 47, 121, 47, 171, 203, 149, 48, 120, 36, 180, 252, 137, 192, 40, 228, 125, 24, 220, 28, 146, 173, 190, 179, 81, 220, 240, 255, 66, 71, 189,
	252, 27, 145, 129, 134, 23, 251, 131, 147, 87, 248, 237, 10, 106, 141, 58, 0, 87, 176, 177, 148, 167, 149, 33, 123, 228, 222, 206, 7, 2, 182, 112,
	177, 77, 65, 164, 80, 120, 216, 246, 155, 98, 90, 238, 237, 33, 228, 19, 50, 2, 24, 163, 65, 58, 222, 85, 241, 128, 46, 223, 138, 11, 35, 136,
	51, 170, 220, 139, 241, 167, 86, 9, 77, 132, 74, 200, 118, 198, 86, 181, 156, 216, 89, 26, 64, 219, 45, 94, 130, 250, 69, 172, 107, 196, 70, 40,
	159, 14, 174, 6, 196, 170, 183, 55, 247, 41, 84, 152, 227, 112, 67, 252, 190, 221, 51, 74, 175, 212, 254, 18, 23, 62, 29, 242, 128, 15, 85, 137,
	62, 98, 112, 52, 114, 242, 13, 208, 127, 161, 186, 51, 173, 113, 41, 245, 201, 13, 130, 229, 3, 160, 151, 228, 75, 170, 33, 176, 141, 189, 124, 88,
	220, 195, 227, 40, 196, 217, 81, 202, 166, 193, 38, 136, 129, 38, 188, 5, 216, 123, 141, 214, 130, 246, 186, 92, 34, 28, 166, 95, 160, 48, 19, 224,
	160, 212, 137, 112, 143, 182, 244, 99, 103, 252, 119, 72, 178, 115, 133, 141, 9, 146, 98, 237, 199, 255, 122, 144, 165, 118, 147, 35, 50, 63, 127, 12,
	23, 165, 140, 92, 6, 118, 42, 141, 134, 160, 102, 214, 181, 99, 218, 77, 154, 133, 30, 117, 238, 215, 207, 236, 148, 209, 192, 56, 69, 101, 49, 148,
	40, 7, 51, 1, 218, 188, 87, 28, 54, 17, 228, 17, 124, 95, 201, 206, 57, 215, 216, 133, 162, 15, 14, 43, 67, 137, 249, 190, 84, 52, 197, 84,
	87, 195, 50, 97, 93, 85, 82, 116, 33, 243, 112, 41, 135, 57, 34, 30, 212, 110, 27, 43, 201, 142, 201, 12, 236, 105, 248, 112, 121, 201, 89, 64,
	11, 86, 16, 88, 8, 77, 179, 50, 89, 210, 24, 10, 197, 224, 221, 22, 122, 127, 182, 35, 158, 224, 185, 181, 226, 39, 121, 230, 176, 80, 188, 8,
	206, 183, 46, 198, 249, 72, 243, 63, 160, 115, 14, 24, 167, 91, 172, 162, 52, 91, 2, 198, 129, 56, 245, 182, 179, 229, 176, 26, 18, 82, 25, 228,
	83, 241, 54, 85, 96, 66, 200, 157, 182, 48, 232, 139, 122, 158, 16, 239, 67, 103, 100, 225, 121, 28, 221, 158, 191, 234, 125, 9, 215, 80, 167, 138,
	191, 6, 145, 229, 230, 152, 124, 19, 22, 41, 64, 227, 180, 29, 201, 5, 173, 218, 241, 187, 182, 89, 85, 61, 167, 55, 175, 11, 56, 179, 44, 238,
	97, 125, 160, 80, 141, 114, 6, 194, 113, 194, 164, 249, 205, 124, 103, 15, 77, 7, 88, 19, 6, 30, 17, 49, 249, 129, 246, 63, 217, 222, 159, 161,
	187, 170, 33, 198, 206, 8, 110, 170, 218, 189, 235, 181, 141, 120, 51, 190, 133, 44, 109, 150, 11, 105, 154, 241, 249, 200, 223, 116, 154, 66, 209, 240,
	133, 59, 7, 181, 99, 215, 196, 93, 26, 148, 133, 127, 62, 144, 21, 110, 168, 222, 242, 252, 0, 242, 227, 37, 104, 21, 182, 199, 255, 69, 116, 207,
	75, 32, 93, 150, 192, 207, 173, 29, 81, 139, 245, 116, 126, 93, 7, 196, 107, 205, 192, 214, 175, 25, 54, 246, 7, 226, 64, 85, 166, 28, 205, 89,
	124, 90, 133, 18, 112, 81, 30, 36, 170, 37, 229, 174, 118, 213, 86, 143, 75, 242, 176, 48, 245, 229, 13, 26, 103, 162, 49, 26, 223, 254, 59, 212,
	153, 223, 21, 58, 17, 171, 42, 66, 203, 185, 249, 74, 66, 63, 177, 7, 184, 25, 130, 29, 162, 34, 17, 118, 192, 110, 4, 247, 158, 169, 103, 38,
	91, 90, 16, 105, 205, 70, 230, 224, 94, 37, 14, 27, 175, 171, 23, 67, 180, 44, 79, 2, 142, 130, 205, 72, 208, 99, 78, 77, 185, 137, 70, 160,
	180, 227, 110, 134, 147, 134, 237, 79, 186, 42, 140, 41, 127, 158, 226, 188, 136, 18, 252, 50, 10, 52, 109, 79, 220, 227, 192, 180, 14, 70, 143, 181,
	101, 101, 65, 8, 23, 18, 7, 62, 150, 190, 111, 164, 212, 78, 219, 114, 175, 166, 53, 61, 231, 19, 6, 143, 160, 225, 61, 106, 12, 182, 93, 106,
	14, 186, 59, 80, 134, 221, 38, 90, 152, 15, 132, 7, 58, 89, 191, 140, 173, 49, 140, 200, 59, 149, 110, 49, 139, 97, 24, 242, 110, 209, 13, 252,
	219, 120, 40, 160, 73, 44, 81, 203, 207, 247, 83, 45, 34, 171, 140, 143, 102, 238, 163, 139, 254, 28, 65, 230, 59, 94, 187, 238, 39, 240, 95, 113,
	201, 22, 67, 176, 223, 244, 98, 175, 114, 79, 133, 105, 244, 29, 216, 128, 23, 58, 234, 232, 124, 199, 62, 25, 216, 213, 94, 216, 184, 230, 57, 54,
	81, 206, 1, 156, 58, 231, 134, 16, 32, 39, 63, 97, 148, 159, 245, 146, 218, 227, 87, 170, 191, 233, 147, 37, 62, 62, 172, 106, 214, 103, 64, 125,
	20, 46, 25, 237, 169, 55, 249, 130, 52, 163, 12, 253, 63, 27, 173, 215, 182, 166, 179, 120, 6, 234, 171, 130, 50, 150, 248, 159, 64, 178, 168, 105,
	161, 185, 192, 100, 134, 248, 177, 168, 172, 149, 211, 172, 238, 166, 12, 46, 171, 230, 130, 43, 51, 205, 186, 90, 199, 37, 197, 86, 181, 235, 203, 127,
	128, 105, 137, 180, 67, 99, 202, 144, 235, 208, 207, 248, 189, 5, 86, 254, 40, 148, 119, 118, 143, 11, 115, 160, 84, 98, 15, 52, 33, 174, 125, 24,
	228, 27, 14, 25, 2, 211, 156, 118, 216, 227, 117, 232, 54, 101, 49, 166, 48, 199, 44, 3, 36, 167, 166, 13, 146, 227, 179, 141, 79, 95, 241, 249,
	66, 103, 130, 51, 186, 28, 140, 47, 30, 231, 181, 88, 44, 74, 142, 190, 97, 210, 93, 180, 146, 70, 106, 140, 166, 202, 242, 92, 1, 183, 20, 157,
	171, 142, 71, 250, 58, 183, 240, 120, 15, 151, 181, 85, 30, 17, 43, 75, 134, 15, 36, 224, 249, 105, 150, 59, 47, 112, 19, 178, 119, 108, 85, 107,
	115, 155, 56, 103, 226, 209, 223, 26, 200, 46, 220, 197, 73, 210, 56, 186, 12, 221, 75, 70, 19, 114, 10, 75, 154, 43, 62, 131, 90, 235, 152, 12,
	139, 20, 172, 241, 246, 114, 194, 234, 14, 205, 44, 137, 13, 253, 252, 101, 250, 170, 36, 68, 199, 229, 69, 32, 74, 167, 218, 225, 145, 246, 220, 39,
	235, 177, 42, 25, 20, 209, 83, 246, 196, 212, 98, 65, 11, 103, 47, 14, 163, 96, 5, 124, 180, 204, 70, 243, 56, 7, 164, 14, 206, 142, 109, 190,
	151, 95, 102, 81, 112, 134, 6, 159, 141, 7, 42, 58, 42, 79, 163, 2, 84, 15, 190, 39, 45, 122, 219, 199, 45, 115, 191, 92, 235, 232, 107, 222,
	124, 204, 182, 131, 116, 14, 73, 21, 76, 236, 78, 42, 180, 186, 220, 174, 87, 155, 65, 172, 244, 159, 90, 163, 179, 11, 240, 177, 187, 208, 241, 41,
	182, 170, 111, 40, 245, 12, 253, 26, 161, 73, 189, 137, 181, 105, 1, 203, 49, 34, 165, 124, 233, 53, 114, 254, 210, 219, 13, 204, 67, 151, 6, 104,
	61, 205, 252, 123, 13, 206, 13, 64, 117, 237, 230, 202, 114, 58, 32, 49, 163, 203, 202, 169, 49, 242, 135, 18, 145, 96, 113, 103, 35, 185, 153, 44,
	244, 145, 185, 135, 35, 219, 79, 199, 87, 54, 112, 5, 229, 191, 55, 185, 52, 207, 173, 3, 40, 101, 197, 45, 27, 155, 131, 158, 176, 198, 78, 33,
	67, 140, 237, 5, 241, 120, 72, 115, 85, 236, 144, 64, 62, 248, 187, 62, 196, 143, 140, 111, 108, 148, 129, 200, 180, 163, 14, 169, 76, 168, 5, 197,
	94, 178, 251, 150, 226, 29, 22, 144, 241, 208, 173, 12, 171, 124, 36, 182, 231, 128, 185, 139, 95, 117, 129, 238, 65, 100, 162, 45, 3, 79, 188, 91,
	195, 110, 5, 154, 116, 131, 244, 17, 214, 75, 27, 198, 73, 30, 195, 6, 242, 71, 160, 242, 186, 120, 135, 233, 120, 135, 58, 195, 203, 106, 133, 161,
	246, 104, 118, 31, 105, 198, 94, 17, 79, 244, 213, 106, 125, 214, 45, 1, 149, 36, 252, 51, 196, 105, 43, 24, 237, 231, 54, 89, 91, 187, 148, 54,
	72, 156, 6, 213, 111, 217, 111, 235, 250, 179, 249, 138, 203, 23, 9, 156, 190, 254, 67, 119, 102, 191, 204, 53, 153, 2, 75, 97, 248, 199, 206, 163,
	9, 68, 81, 133, 133, 14, 131, 112, 42, 57, 9, 237, 184, 22, 29, 208, 161, 86, 98, 164, 246, 175, 56, 169, 165, 5, 75, 132, 163, 22, 68, 203,
	48, 190, 9, 144, 169, 26, 86, 20, 198, 193, 33, 52, 148, 42, 52, 33, 18, 132, 132, 207, 96, 76, 196, 214, 208, 233, 126, 191, 4, 224, 107, 199,
	14, 33, 228, 16, 200, 36, 198, 191, 149, 147, 80, 186, 44, 58, 86, 79, 13, 47, 122, 32, 37, 31, 218, 182, 178, 236, 120, 154, 84, 36, 176, 207,
	183, 45, 116, 146, 185, 31, 136, 255, 35, 132, 120, 57, 44, 118, 96, 204, 46, 153, 33, 249, 214, 123, 205, 243, 186, 206, 144, 172, 29, 8, 57, 127,
	169, 190, 163, 243, 72, 135, 221, 116, 149, 82, 90, 233, 65, 44, 15, 141, 181, 3, 128, 136, 212, 220, 118, 86, 40, 50, 123, 188, 167, 42, 22, 131,
	94, 251, 85, 103, 206, 140, 49, 75, 14, 48, 176, 5, 112, 63, 110, 122, 255, 209, 105, 64, 41, 39, 126, 176, 122, 110, 108, 122, 165, 39, 243, 36,
	164, 130, 205, 78, 7, 241, 89, 52, 191, 53, 219, 47, 25, 152, 83, 129, 29, 216, 219, 10, 29, 47, 113, 92, 121, 36, 237, 101, 94, 52, 59, 90,
	167, 88, 164, 137, 42, 161, 242, 140, 63, 193, 10, 10, 142, 42, 6, 54, 0, 155, 153, 247, 214, 75, 172, 141, 196, 126, 255, 27, 24, 237, 130, 57,
	56, 156, 59, 137, 102, 194, 206, 20, 100, 240, 67, 154, 32, 42, 245, 4, 70, 17, 38, 24, 49, 152, 7, 22, 128, 171, 15, 225, 226, 89, 140, 0,
	22, 25, 155, 181, 101, 164, 198, 143, 161, 126, 135, 202, 22, 205, 87, 120, 149, 218, 197, 127, 200, 13, 191, 172, 192, 47, 42, 219, 7, 5, 184, 162,
	183, 130, 193, 113, 26, 126, 136, 72, 195, 81, 54, 238, 92, 243, 114, 9, 219, 226, 51, 2, 210, 226, 184, 166, 105, 57, 172, 152, 175, 139, 47, 108,
}

What did you expect to see?

build success

What did you see instead?

./main.go:17:2: internal compiler error: 'New': can't find source for b10->b6: v26 = MOVWloadidx1 <uint32> [4] v130 v37 v66 : CX


Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

if remove the code below, it will be ok.

		if k == 0 {
			fmt.Println("debug")
		}
@ALTree

This comment has been minimized.

Copy link
Member

@ALTree ALTree commented Jun 19, 2019

Thanks for the report.

I can reproduce this with tip and with 1.12.5 (so it's not a 1.12.6 regression).

cc @randall77

@ALTree ALTree added this to the Go1.13 milestone Jun 19, 2019
@ALTree ALTree changed the title build failed for go1.12.6 cmd/compile: 'New': can't find source Jun 19, 2019
@ALTree ALTree changed the title cmd/compile: 'New': can't find source cmd/compile: internal compiler error: 'New': can't find source Jun 19, 2019
@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Jun 22, 2019

Fixed at tip now.

@agnivade agnivade closed this Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.