Skip to content

cmd/compile: "illegal combination SRA ADDCON REG REG" on mips #42587

Closed

Description

@ALTree
$ go version
go version go1.15.5 linux/amd64
$ gotip version
go version devel +f423d616b1 Fri Nov 13 15:15:15 2020 +0000 linux/amd64

The following program:

package p

func f() {
	var i, j int
	_ = func() {
		i = 32
		j = j>>i | len([]int{})
	}
}

Crashes the go1.15.5 and tip compilers when built for mips:

$ GOARCH=mips go tool compile crash.go 

00020 (crash.go:7)	SRA	$-1, R2, R2
00020 (crash.go:7)	SRA	$-1, R2, R2
00020 (crash.go:7)	SRA	$-1, R2, R2
00020 (crash.go:7)	SRA	$-1, R2, R2
crash.go:7:5: illegal combination SRA ADDCON REG REG

The go1.14.12 compiler compiles it with no issues.

cc @cherrymui @randall77

Activity

  1. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Nov 13, 2020
  2. added this to the Go1.16 milestone on Nov 13, 2020
  3. gopherbot commented on Nov 14, 2020

    @gopherbot
    Contributor

    Change https://golang.org/cl/270117 mentions this issue: cmd/compile: check unsigned value for SRA mips rule

  4. gopherbot commented on Nov 17, 2020

    @gopherbot
    Contributor

    Change https://golang.org/cl/270558 mentions this issue: cmd/compile: stop MOVW-ing -1 as SRA shift amount in mips

  5. locked and limited conversation to collaborators on Nov 17, 2021
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.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions