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: bitwise OR of fp constants triggers an internal compiler error #31060

Closed
nsajko opened this issue Mar 26, 2019 · 7 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nsajko
Copy link
Contributor

nsajko commented Mar 26, 2019

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

$ go version
go version go1.12.1 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/tmp/freedesktopCache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/nsajko"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build891538814=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/__u_Ihvs3Vg

What did you expect to see?

No "internal compiler error". Probably a message like "operator | not defined on floating point constants" would be nice.

What did you see instead?

internal compiler error: binaryOp: bad operation: 3.5 | 2.8
@josharian
Copy link
Contributor

cc @mdempsky

@josharian josharian changed the title Bitwise OR of fp constants triggers an internal compiler error cmd/compile: bitwise OR of fp constants triggers an internal compiler error Mar 26, 2019
@josharian josharian added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 26, 2019
@josharian josharian added this to the Go1.13 milestone Mar 26, 2019
@mark-rushakoff
Copy link
Contributor

Looks like was not an ICE in 1.11.

$ go version; go build x.go
go version go1.11.4 darwin/amd64
# command-line-arguments
./x.go:8:18: illegal constant expression: untyped number | untyped number

@mdempsky
Copy link
Member

Technically, an "illegal constant expression" was still an ICE. ;)

But yes, hmm, this is definitely related to my const.go refactoring. I'll take a look.

@gopherbot
Copy link

Change https://golang.org/cl/169719 mentions this issue: cmd/compile: fix ICE from invalid operations on float/complex constants

@mdempsky
Copy link
Member

This might be worth backporting to Go 1.12. It's only affects invalid Go code (i.e., failing with ICE instead of emitting a proper compiler error), but it's still technically a regression in Go 1.12 from Go 1.11.

@ianlancetaylor
Copy link
Contributor

The guideline on backports isn't to fix all regressions, it's to only backport patches that fix serious bugs with no workaround. There is always a workaround for invalid code, so I don't think we need to backport this.

@mdempsky
Copy link
Member

@ianlancetaylor Okay, SGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants