Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: Inline simple functions with dead sections #12007

Closed
dsnet opened this issue Aug 3, 2015 · 1 comment
Closed

cmd/compile: Inline simple functions with dead sections #12007

dsnet opened this issue Aug 3, 2015 · 1 comment

Comments

@dsnet
Copy link
Member

dsnet commented Aug 3, 2015

Using go1.5beta3.
Simple functions with dead sections that would normally be inlined should be inlined.

Example:

package foo

import "fmt"

const debug = false

func Foo(a, b int) int {
    if debug {
        // This section is never used
        fmt.Println()
    }
    return a + b
}

func Bar(a, b int) int {
    return a + b
}

However, only Bar is inlined:

$ go build -gcflags=-m
./foo.go:15: can inline Bar
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 4, 2015
@ALTree
Copy link
Member

ALTree commented Aug 4, 2015

This is #9274

@bradfitz bradfitz closed this as completed Aug 4, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants