You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wiki says the function containing panic's wouldn't be inlined. I want to see the function add not inlined.
What did you see instead?
I see the function add is inlined, the output is:
./main.go:23:6: can inline add with cost 5 as: func(float32, float32) float32 { panic("hello");return 1 }
./main.go:28:6: can inline sub with cost 4 as: func(float32, float32) float32 { return a - b }
...
The wiki maybe not updated, if so, please update it.
The text was updated successfully, but these errors were encountered:
hitzhangjie
changed the title
wiki: compiler optimization could inline a simple function containing panic
inline: the wiki says compiler optimization wouldn't inline a function containing panic's
May 9, 2021
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I write a simple go code to validate inlining logic:
file: main.go
then run `go run -gcflags='-m -m' main.go
What did you expect to see?
The wiki says the function containing panic's wouldn't be inlined. I want to see the function
add
not inlined.What did you see instead?
I see the function
add
is inlined, the output is:The wiki maybe not updated, if so, please update it.
The text was updated successfully, but these errors were encountered: