cmd/5g: avoid temporaries during gcmp(reg, constant)
cmd/5g: avoid temporaries during gcmp(reg, constant)

Address several instances of unneeded temporaries when using gcmp.

func M(m map[int]bool) int {
        return len(m)
}

--- prog list "M" ---
0000 (/home/dfc/src/map.go:3) TEXT      M+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      m+0(FP),R0
0002 (/home/dfc/src/map.go:4) MOVW      $0,R1
0003 (/home/dfc/src/map.go:4) CMP       R1,R0,
0004 (/home/dfc/src/map.go:4) BEQ       ,6(APC)
0005 (/home/dfc/src/map.go:4) MOVW      0(R0),R0
0006 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0007 (/home/dfc/src/map.go:4) RET       ,

after:

--- prog list "M" ---
0000 (/home/dfc/src/map.go:3) TEXT      M+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      m+0(FP),R0
0002 (/home/dfc/src/map.go:4) CMP       $0,R0,
0003 (/home/dfc/src/map.go:4) BEQ       ,5(APC)
0004 (/home/dfc/src/map.go:4) MOVW      0(R0),R0
0005 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0006 (/home/dfc/src/map.go:4) RET       ,

func C(c chan int) int {
        return cap(c)
}

--- prog list "C" ---
0000 (/home/dfc/src/map.go:3) TEXT      C+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      c+0(FP),R0
0002 (/home/dfc/src/map.go:4) MOVW      $0,R1
0003 (/home/dfc/src/map.go:4) CMP       R1,R0,
0004 (/home/dfc/src/map.go:4) BEQ       ,6(APC)
0005 (/home/dfc/src/map.go:4) MOVW      4(R0),R0
0006 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0007 (/home/dfc/src/map.go:4) RET       ,

after:

--- prog list "C" ---
0000 (/home/dfc/src/map.go:3) TEXT      C+0(SB),$0-8
0001 (/home/dfc/src/map.go:4) MOVW      c+0(FP),R0
0002 (/home/dfc/src/map.go:4) CMP       $0,R0,
0003 (/home/dfc/src/map.go:4) BEQ       ,5(APC)
0004 (/home/dfc/src/map.go:4) MOVW      4(R0),R0
0005 (/home/dfc/src/map.go:4) MOVW      R0,.noname+4(FP)
0006 (/home/dfc/src/map.go:4) RET       ,

R=rsc, minux.ma, remyoudompheng
CC=golang-dev
http://codereview.appspot.com/6618054

sanjosh/sanjos100-tipc,bryanxu/go-zh,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,webfd/go-zh,rflanagan/reginaldflanagan-project1,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,webfd/go-zh,d0f/go-zh,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,bryanxu/go-zh,d0f/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,scirelli/scirelli-go,rdp/rogerpack2005-golang,sanjosh/sanjos100-tipc,mhennings/marcohennings-go,scirelli/scirelli-go,webfd/go-zh,rdp/rogerpack2005-golang,scirelli/scirelli-go,sanjosh/sanjos100-tipc,webfd/go-zh,scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,d0f/go-zh,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,d0f/go-zh,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,webfd/go-zh,sanjosh/sanjos100-tipc,mhennings/marcohennings-go,d0f/go-zh,rdp/rogerpack2005-golang,webfd/go-zh,rdp/rogerpack2005-golang,d0f/go-zh,bryanxu/go-zh,bryanxu/go-zh,webfd/go-zh,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,mhennings/marcohennings-go,d0f/go-zh,sanjosh/sanjos100-tipc,scirelli/scirelli-go,bryanxu/go-zh,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,mhennings/marcohennings-go,rdp/rogerpack2005-golang,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof