Bug 1736044

Summary: internal compiler error: '(*client).sendMsgToGateways': no register available for v418 = LoweredAtomicAdd32Variant <uint32,mem> v344 v145 v407
Product: [Fedora] Fedora Reporter: Robert-André Mauchin 🐧 <zebob.m>
Component: golangAssignee: Jakub Čajka <jcajka>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amurdaca, deparker, jcajka, lemenkov, renich, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: golang-1.13-0.beta1.2.fc31.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-02 18:20:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1732118, 1735290    

Description Robert-André Mauchin 🐧 2019-08-01 14:31:42 UTC
Description of problem:
I'm building github.com/nats-io/gnatsd 2.0.0-RC8 with:

go build -buildmode pie -compiler gc '-tags=rpm_crashtraceback ' -ldflags '-X github.com/nats-io/gnatsd/version.tag=v2.0.0-RC8 -X github.com/nats-io/gnatsd/version=2.0.0 -B 0x51f0a6c96fb7745750f72bd94ce56793deb3d943 -extldflags '\''-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\''' -a -v -x -o /builddir/build/BUILD/nats-server-2.0.0-RC8/_build/bin/gnatsd github.com/nats-io/gnatsd

Build progress until it hits this error:

cd /builddir/build/BUILD/nats-server-2.0.0-RC8/_build/src/github.com/nats-io/gnatsd/server
BUILDSTDERR: /usr/lib/golang/pkg/tool/linux_arm64/compile -o $WORK/b033/_pkg_.a -trimpath "$WORK/b033=>" -shared -p github.com/nats-io/gnatsd/server -complete -installsuffix shared -buildid 9lWsjnhecOJeLDa8YX6b/9lWsjnhecOJeLDa8YX6b -goversion go1.13beta1 -D "" -importcfg $WORK/b033/importcfg -pack ./accounts.go ./auth.go ./ciphersuites.go ./client.go ./const.go ./errors.go ./events.go ./gateway.go ./jwt.go ./leafnode.go ./log.go ./monitor.go ./monitor_sort_opts.go ./nkey.go ./opts.go ./parser.go ./reload.go ./ring.go ./route.go ./server.go ./service.go ./signal.go ./sublist.go ./util.go
BUILDSTDERR: # github.com/nats-io/gnatsd/server
BUILDSTDERR: _build/src/github.com/nats-io/gnatsd/server/gateway.go:2119:10: internal compiler error: '(*client).sendMsgToGateways': no register available for v418 = LoweredAtomicAdd32Variant <uint32,mem> v344 v145 v407
BUILDSTDERR: Please file a bug report including a short program that triggers the error.
BUILDSTDERR: https://golang.org/issue/new

Build was working with Golang 1.12.7 under the same conditions. Other arches beside aarch64 are working correctly.

Version-Release number of selected component (if applicable):
golang-1.13-0.beta1.2.fc31

How reproducible:
Always

Steps to Reproduce:

mkdir issue33355
cd issue33355
git clone https://github.com/nats-io/gnatsd
cd gnatsd
GOARCH=arm64 go build

Actual results:
_build/src/github.com/nats-io/gnatsd/server/gateway.go:2119:10: internal compiler error: '(*client).sendMsgToGateways': no register available for v418 = LoweredAtomicAdd32Variant <uint32,mem> v344 v145 v407

Expected results:
Build success.


Additional info:
Upstream bug report https://github.com/golang/go/issues/33355
Solved in https://github.com/golang/go/commit/8a317ebc0f50339628c003bf06107cd865406dd4