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 error on complex comparison #32723

Closed
gazerro opened this issue Jun 21, 2019 · 3 comments
Closed

cmd/compile: internal error on complex comparison #32723

gazerro opened this issue Jun 21, 2019 · 3 comments
Labels
Milestone

Comments

@gazerro
Copy link

@gazerro gazerro commented Jun 21, 2019

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

$ go version
go version devel +44c9354c5a Fri Jun 21 05:21:30 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

_ = 1i < 2i

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

What did you expect to see?

invalid operation: 1i < 2i (operator < not defined on complex128)

What did you see instead?

internal compiler error: compareOp: bad comparison: 1i < 2i

@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Jun 21, 2019

Not a regression from 1.12. So adding to 1.14.

And seems to happen only while directly comparing literals. If I compare complex variables, I get the correct error.

@agnivade agnivade added this to the Go1.14 milestone Jun 21, 2019
@agnivade agnivade changed the title cmd/compiler: internal error on complex comparison cmd/compile: internal error on complex comparison Jun 21, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 24, 2019

Change https://golang.org/cl/183459 mentions this issue: cmd/compile: fix internal error on complex comparison

@fgm

This comment has been minimized.

Copy link

@fgm fgm commented Aug 4, 2019

A very similar error happens on bit operations, as shown on https://play.golang.org/p/hYUAK-ex6tQ (#33458 closed as dup), except it is not an internal error on comparison but on operation. .

@ALTree ALTree added NeedsFix and removed NeedsInvestigation labels Aug 10, 2019
@gopherbot gopherbot closed this in 24c6dd9 Aug 29, 2019
tomocy added a commit to tomocy/go that referenced this issue Sep 1, 2019
Complex type is the only TIDEAL that lack of support for all comparison
operators. When rewriting constant comparison into literal node, that
missing cause compiler raise an internal error.

Checking the operator is available for complex type before that fix the
problem.

We can make this check works more generally if there's more type lack of
supporting all comparison operators added, but it does not seem to be
happened, so just check explicitly for complex only.

Fixes golang#32723

Change-Id: I4938b1bdcbcdae9a9d87436024984bd2ab12995e
Reviewed-on: https://go-review.googlesource.com/c/go/+/183459
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
t4n6a1ka added a commit to t4n6a1ka/go that referenced this issue Sep 5, 2019
Complex type is the only TIDEAL that lack of support for all comparison
operators. When rewriting constant comparison into literal node, that
missing cause compiler raise an internal error.

Checking the operator is available for complex type before that fix the
problem.

We can make this check works more generally if there's more type lack of
supporting all comparison operators added, but it does not seem to be
happened, so just check explicitly for complex only.

Fixes golang#32723

Change-Id: I4938b1bdcbcdae9a9d87436024984bd2ab12995e
Reviewed-on: https://go-review.googlesource.com/c/go/+/183459
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.