Skip to content

gccgo: no panic on nil pointer dereference on ^ operator #53019

Closed as not planned
@ddaa2000

Description

@ddaa2000

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

$ gccgo -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-12.1.0/bin/gccgo
COLLECT_LTO_WRAPPER=/usr/local/gcc-12.1.0/libexec/gcc/x86_64-pc-linux-gnu/12.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-12.1.0/configure --prefix=/usr/local/gcc-12.1.0 --enable-languages=c,c++,go --with-arch-32=i586
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.1.0 (GCC) 

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
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://mirrors.aliyun.com/goproxy/"
GOROOT="/usr/local/go1.18.1"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go1.18.1/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="/usr/local/gcc-12.1.0/bin/gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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-build847055300=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://go.dev/play/p/jbdJGKWIsuL?v=gotip

What did you expect to see?

The program throws a panic.

What did you see instead?

The program finished running and print "no panic" in gccgo-6.1.0 and gccgo-12.1.0 (other versions are not tested).

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions