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

Open
ddaa2000 opened this issue Mar 4, 2022 · 2 comments
Open

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

ddaa2000 opened this issue Mar 4, 2022 · 2 comments
Labels
NeedsInvestigation
Milestone

Comments

@ddaa2000
Copy link

@ddaa2000 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 label Mar 4, 2022
@mengzhuo
Copy link
Contributor

@mengzhuo mengzhuo commented Mar 4, 2022

@ddaa2000
Copy link
Author

@ddaa2000 ddaa2000 commented May 20, 2022

This also can be reproduced in gccgo12.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants