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: inlining of empty functions computes arguments #4204
Labels
FrozenDueToAge
Performance
Suggested
Issues that may be good for new contributors looking for work to do.
Milestone
Comments
Here is another test case for the issue: package main import "fmt" type Foo struct { x, y, z, w int } func (Foo) Bar() { } func main() { f := new(Foo) fmt.Println(f) f.Bar() 400c9d: 48 8b 74 24 30 mov 0x30(%rsp),%rsi 400ca2: 48 8d 7c 24 68 lea 0x68(%rsp),%rdi 400ca7: 48 c7 c1 04 00 00 00 mov $0x4,%rcx 400cae: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) } |
What about (empty) `bar` inlined here? // http://play.golang.org/p/oh_n16JptE package main var i int func foo() int { i++; return 0 } func bar(n int) {} func main() { bar(foo()) println(i) } |
dvyukov
added
accepted
Suggested
Issues that may be good for new contributors looking for work to do.
Performance
labels
Apr 2, 2014
rsc
changed the title
cmd/gc: inlining of empty functions computes arguments
cmd/compile: inlining of empty functions computes arguments
Jun 8, 2015
This should be fixed with the SSA backend at tip. |
Go tip generates a call to the empty function if the function is only empty e.g. after some dead code elimination (e.g. when used with a compile time debug constant) in the function: #4563 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
Performance
Suggested
Issues that may be good for new contributors looking for work to do.
The text was updated successfully, but these errors were encountered: