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
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gazerro
Copy link
Contributor

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
Copy link
Contributor

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 21, 2019
@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
Copy link

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

@fgm
Copy link

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 The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 10, 2019
tomocy pushed 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 pushed 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>
@golang golang locked and limited conversation to collaborators Aug 28, 2020
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

5 participants