Skip to content

cmd/compile: do not escape pure value type on dottype2 conversion #15796

@tshprecher

Description

@tshprecher
  1. What version of Go are you using (go version)?

    go version devel +cdcb827 Wed May 18 04:43:32 2016 +0000 darwin/amd64

  2. What operating system and processor architecture are you using (go env)?

    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/tshprecher/Workspace/go"
    GORACE=""
    GOROOT="/Users/tshprecher/Workspace/golang"
    GOTOOLDIR="/Users/tshprecher/Workspace/golang/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"

  3. What did you do?

    This is a followup to runtime: scalability problem with allocation #13805. I made this fix for the ODOTTYPE node type, but not for ODOTTYPE2.

    input:

    package p
    
    func setPointer(p *int, v interface{}) {
        *p, _ = v.(int)
    }
    
    func main() {
        var i int
        setPointer(&i, 1)
    }
    
  4. What did you expect to see?

    dottype_esc.go:9: main 1 does not escape

  5. What did you see instead?

    dottype_esc.go:9: 1 escapes to heap

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions