Skip to content

cmd/compile: small program does not pass ssachecks on arm (internal compiler error: bad AuxInt value) #25993

Closed

Description

@ALTree
$ gotip version
go version devel +578e066862 Wed Jun 20 16:04:33 2018 +0000 linux/amd64

The following program:

package p

func f() {
	var x int
	var B0 bool
	B0 = !B0 || B0
	if B0 && B0 {
		x = -1
	}
	var AI []int
	var AB []bool
	_ = AI[x] > 0 && AB[x]
}

does not pass the ssa checks when compiled for GOARCH=arm, triggers an internal compiler error:

$ GOARCH=arm gotip tool compile -d=ssa/check/on crash.go 
crash.go:12:8: internal compiler error: bad int32 AuxInt value for v23

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f7
cmd/compile/internal/gc.(*ssafn).Fatalf(0xc00000f9e0, 0xc08000000002, 0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:5540 +0x67
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0003442c0, 0xcbb48c, 0x1d, 0xc000046cc0, 0x1, 0x1)
	/home/alberto/go/src/cmd/compile/internal/ssa/func.go:562 +0x73
cmd/compile/internal/ssa.checkFunc(0xc0003442c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/check.go:140 +0x1931
cmd/compile/internal/ssa.Compile(0xc0003442c0)
	/home/alberto/go/src/cmd/compile/internal/ssa/compile.go:110 +0x3c6
cmd/compile/internal/gc.buildssa(0xc000344000, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/ssa.go:210 +0xaa7
cmd/compile/internal/gc.compileSSA(0xc000344000, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:259 +0x39
cmd/compile/internal/gc.compile(0xc000344000)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:238 +0x1a0
cmd/compile/internal/gc.funccompile(0xc000344000)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:209 +0xbd
cmd/compile/internal/gc.Main(0xccc458)
	/home/alberto/go/src/cmd/compile/internal/gc/main.go:637 +0x261d
main.main()
	/home/alberto/go/src/cmd/compile/main.go:51 +0x96

This also happens in go1.10, so it's not a recent regression.

Activity

  1. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Jun 21, 2018
  2. added this to the Go1.12 milestone on Jun 21, 2018
  3. gopherbot commented on Jun 21, 2018

    @gopherbot
    Contributor

    Change https://golang.org/cl/120335 mentions this issue: cmd/compile: convert uint32 to int32 in ARM constant folding rules

  4. modified the milestones: Go1.12, Go1.11 on Jun 22, 2018
  5. locked and limited conversation to collaborators on Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.release-blocker

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions