Skip to content

cmd/compile: ssacheck failure on GOARCH=arm building runtime #22499

Closed

Description

@rsc

Discovered by accident. I can provoke an ssacheck failure on arm reliably with:

$ VM=$(gomote create linux-arm)
$ gomote push $VM
$ gomote run $VM go/src/make.bash
$ gomote run $VM go/bin/go build -a -gcflags=-d=ssa/check/on -v runtme
runtime/internal/sys
runtime/internal/atomic
runtime
# runtime
../src/runtime/malloc.go:892:14: internal compiler error: bad int32 AuxInt value for v54

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/tmp/workdir/go/src/runtime/debug/stack.go:24 +0x80
cmd/compile/internal/gc.Fatalf(0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/gc/subr.go:182 +0x1c0
cmd/compile/internal/gc.(*ssafn).Fatalf(0x113ef140, 0x26, 0x37c0e, 0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/gc/ssa.go:5176 +0x54
cmd/compile/internal/ssa.(*Func).Fatalf(0x12ffe1e0, 0x6dc821, 0x1d, 0x121ba4d0, 0x1, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/func.go:497 +0x64
cmd/compile/internal/ssa.checkFunc(0x12ffe1e0)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/check.go:140 +0x1508
cmd/compile/internal/ssa.Compile(0x12ffe1e0)
	/tmp/workdir/go/src/cmd/compile/internal/ssa/compile.go:110 +0x31c
cmd/compile/internal/gc.buildssa(0x1161f520, 0x0, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/ssa.go:216 +0xb28
cmd/compile/internal/gc.compileSSA(0x1161f520, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/pgen.go:238 +0x24
cmd/compile/internal/gc.compile(0x1161f520)
	/tmp/workdir/go/src/cmd/compile/internal/gc/pgen.go:217 +0x208
cmd/compile/internal/gc.funccompile(0x1161f520)
	/tmp/workdir/go/src/cmd/compile/internal/gc/dcl.go:1036 +0xa4
cmd/compile/internal/gc.Main(0x6eb0a0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/main.go:618 +0x25c8
main.main()
	/tmp/workdir/go/src/cmd/compile/main.go:49 +0x7c

Error running run: exit status 2
$ 

I thought maybe the problem was 32-bit-specific, but it does not happen if I build with GOARCH=386 ./make.bash on my Mac, so maybe it is only arm-specific.

I don't know what this means, really, but I thought you'd want to see it.

/cc @randall77 @dr2chase @cherrymui

Activity

  1. added this to the Go1.10 milestone on Oct 31, 2017
  2. cherrymui commented on Oct 31, 2017

    @cherrymui
    Member

    It is ARM specific. ssacheck complains a BICconst's AuxInt does not fit into int32. It fits into uint32 so the generated code is not affected. I'll have a CL soon.

  3. self-assigned this
    on Oct 31, 2017
  4. gopherbot commented on Oct 31, 2017

    @gopherbot
    Contributor

    Change https://golang.org/cl/74770 mentions this issue: cmd/compile: on ARM, make sure *const's AuxInt fit into int32

  5. cherrymui commented on Oct 31, 2017

    @cherrymui
    Member

    Seems this also happens with Go 1.9. Are we going to fix Go 1.9?

  6. randall77 commented on Oct 31, 2017

    @randall77
    Contributor

    If the generated code is correct, and this only affects the ssacheck builder, I don't see a reason to backport to 1.9.

  7. gopherbot commented on Nov 6, 2017

    @gopherbot
    Contributor

    Change https://golang.org/cl/76024 mentions this issue: cmd/compile: enable ssacheck for tests in ssa_test.go

  8. locked and limited conversation to collaborators on Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions