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: gccgo error: incompatible types in binary expression #51475

Closed
ddaa2000 opened this issue Mar 4, 2022 · 4 comments
Closed

cmd/compile: gccgo error: incompatible types in binary expression #51475

ddaa2000 opened this issue Mar 4, 2022 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ddaa2000
Copy link

ddaa2000 commented Mar 4, 2022

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

$ go version
go version go1.17.8 linux/amd64
$ gccgo --version
gccgo (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Does this issue reproduce with the latest release?

It is produced by gccgo, I'm not sure.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ddaa/.cache/go-build"
GOENV="/home/ddaa/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ddaa/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ddaa/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.8"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ddaa/Desktop/bugReview/go.mod"
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-build3532773105=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$go build --compiler=gccgo
package main

type T11 bool

func main() {
	var V55 T11 = false
	if (true && true) && V55 {
	}
}

What did you expect to see?

go build successfully just as using gc compiler.
Actually if replace

if (true && true) && V55

with

if true && V55

It will compile successfully even using gccgo.

What did you see instead?

#bugReview
./main.go:8:20: error: incompatible types in binary expression
    8 |  if (true && true) && V55 {
      |        
@gopherbot gopherbot added this to the Gccgo milestone Mar 4, 2022
@mengzhuo mengzhuo changed the title affected/package: gccgo cmd/compile: gccgo error: incompatible types in binary expression Mar 4, 2022
@mengzhuo mengzhuo added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 4, 2022
@mengzhuo
Copy link
Contributor

mengzhuo commented Mar 4, 2022

cc @ianlancetaylor

@ddaa2000
Copy link
Author

This also can be reproduced in gccgo12.1.0

@gopherbot
Copy link

Change https://go.dev/cl/414755 mentions this issue: test: add test that gofrontend failed to compile

@gopherbot
Copy link

Change https://go.dev/cl/414735 mentions this issue: compiler: permit expressions of abstract bool to remain abstract

gopherbot pushed a commit that referenced this issue Jun 28, 2022
For #51475

Change-Id: Ie1b27304687225194a323dc8305e5d62578fff4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/414755
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
realqhc pushed a commit to realqhc/gofrontend that referenced this issue Aug 4, 2022
Test case is https://go.dev/cl/414755.

Fixes golang/go#51475

Change-Id: Ib4a066c370440339d28a5bb5180a1f032e4fb4f7
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414735
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
For golang#51475

Change-Id: Ie1b27304687225194a323dc8305e5d62578fff4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/414755
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@golang golang locked and limited conversation to collaborators Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants