Repository: go
Issue: cmd/asm: doesn't handle register offset correctly when GOARCH=arm
Labels: help wanted,NeedsInvestigation,compiler/runtime

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.13.5 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dd/Library/Caches/go-build"
GOENV="/Users/dd/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/dd/dev/source/golang/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/n5/26_m50tn4_j2n3gmvt19300h0000gn/T/go-build651869539=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

main.go:

```
package main

import (
	"fmt"
)

func b()

func print32(i uint32) {
	fmt.Printf("0x%x\n", i)
}

func main() {
	b()
}
```

asm_arm.s:

```
#include "textflag.h"

TEXT ·b(SB), NOSPLIT, $4
    MOVW    $1, R0
    MOVW    $4, R1
    MOVW    R0, (R13)(R1)
    CALL    ·print32(SB)
    RET

```

then run,

```
objdump -d -df 'main.b' ./demo
```

and

```
go tool objdump -S -s 'main\.b' ./demo
```

./demo is the target executable file.

### What did you expect to see?

```
main.b:
   b8e18:       08 e0 2d e5     str     lr, [sp, #-8]!
   b8e1c:       01 00 a0 e3     mov     r0, #1
   b8e20:       04 10 a0 e3     mov     r1, #4
   b8e24:       01 00 8d e7     str     r0, [sp, r1]
   b8e28:       c5 ff ff eb     bl      #-236 <main.print32>
   b8e2c:       08 f0 9d e4     ldr     pc, [sp], #8687 
```

and

```
TEXT main.b(SB) 
  0xb8e18               e52de008                MOVW.W R14, -0x8(R13)   
  0xb8e1c               e3a00001                MOVW $1, R0             
  0xb8e20               e3a01004                MOVW $4, R1             
  0xb8e24               e78d0001                MOVW R0, (R13)(R1)      
  0xb8e28               ebffffc5                BL main.print32(SB)     
  0xb8e2c               e49df008                RET #8 
```

### What did you see instead?

```
main.b:
   b8e18:       08 e0 2d e5     str     lr, [sp, #-8]!
   b8e1c:       01 00 a0 e3     mov     r0, #1
   b8e20:       04 10 a0 e3     mov     r1, #4
   b8e24:       00 00 8d e5     str     r0, [sp]
   b8e28:       c5 ff ff eb     bl      #-236 <main.print32>
   b8e2c:       08 f0 9d e4     ldr     pc, [sp], #8
```

and

```
TEXT main.b(SB) 
  0xb8e18               e52de008                MOVW.W R14, -0x8(R13)   
  0xb8e1c               e3a00001                MOVW $1, R0             
  0xb8e20               e3a01004                MOVW $4, R1             
  0xb8e24               e58d0000                MOVW R0, (R13)          
  0xb8e28               ebffffc5                BL main.print32(SB)     
  0xb8e2c               e49df008                RET #8 
```

don't know why the code of register offset was lost?

```
MOVW    R0, (R13)(R1)
```

change into 

```
MOVW    R0, (R13)
```