Repository: go
Issue: cmd/compile: redundant loop generated for comparing/hashing arrays of size 1.
Labels: Performance,binary-size,compiler/runtime

Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
   go version devel +f81cfc6 Tue Mar 8 23:54:09 2016 +0100 linux/amd64
   (local compile)
2. What operating system and processor architecture are you using (`go env`)?
   GOARCH="amd64"
   GOHOSTARCH="amd64"
3. What did you do?
   go tool objdump vet| less
4. What did you expect to see?
   No loop. There are many instances of this in the standard library.
5. What did you see instead?
   There is clearly a 1 trip loop in the following assembly code;

```
TEXT type..hash.[1]go/types.operand(SB) /.../go/src/go/types/api.go
        api.go:1        0x524af0        64488b0c25f8ffffff      FS MOVQ FS:0xfffffff8, CX
        api.go:1        0x524af9        483b6110                CMPQ 0x10(CX), SP
        api.go:1        0x524afd        7658                    JBE 0x524b57
        api.go:1        0x524aff        4883ec20                SUBQ $0x20, SP
        api.go:1        0x524b03        31c0                    XORL AX, AX
        api.go:1        0x524b05        488b4c2430              MOVQ 0x30(SP), CX
        api.go:1        0x524b0a        4889442418              MOVQ AX, 0x18(SP)
        api.go:1        0x524b0f        4883f801                CMPQ $0x1, AX   
        api.go:1        0x524b13        7d38                    JGE 0x524b4d
        api.go:1        0x524b15        488b542428              MOVQ 0x28(SP), DX   //  LOOP START
        api.go:1        0x524b1a        8402                    TESTL AL, 0(DX)
        api.go:1        0x524b1c        4889c3                  MOVQ AX, BX
        api.go:1        0x524b1f        48c1e306                SHLQ $0x6, BX
        api.go:1        0x524b23        4801d3                  ADDQ DX, BX
        api.go:1        0x524b26        48891c24                MOVQ BX, 0(SP)
        api.go:1        0x524b2a        48894c2408              MOVQ CX, 0x8(SP)
        api.go:1        0x524b2f        e8ccf1ffff              CALL type..hash.go/types.operand(SB)
        api.go:1        0x524b34        488b4c2410              MOVQ 0x10(SP), CX
        api.go:1        0x524b39        488b542418              MOVQ 0x18(SP), DX
        api.go:1        0x524b3e        488d4201                LEAQ 0x1(DX), AX
        api.go:1        0x524b42        4889442418              MOVQ AX, 0x18(SP)
        api.go:1        0x524b47        4883f801                CMPQ $0x1, AX
        api.go:1        0x524b4b        7cc8                    JL 0x524b15          // LOOP END
        api.go:1        0x524b4d        48894c2438              MOVQ CX, 0x38(SP)
        api.go:1        0x524b52        4883c420                ADDQ $0x20, SP
        api.go:1        0x524b56        c3                      RET
        api.go:1        0x524b57        e8b4d5f4ff              CALL runtime.morestack_noctxt(SB)
        api.go:1        0x524b5c        eb92                    JMP type..hash.[1]go/types.operand(SB)
        api.go:1        0x524b5e        cc                      INT $0x3
        api.go:1        0x524b5f        cc                      INT $0x3
```