]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix panic-okay-to-inline change; adjust tests
authorDavid Chase <drchase@google.com>
Wed, 6 Jun 2018 16:38:35 +0000 (12:38 -0400)
committerDavid Chase <drchase@google.com>
Wed, 6 Jun 2018 20:35:23 +0000 (20:35 +0000)
commitc08b01ecb4488fb3a95fd5cc7baa8b31812e7b76
treeaaf2bc2e86918d000bc5f8081f1122e4b37366ba
parentd09d7627f38211eaa02fed660fd1b3001a7812b3
cmd/compile: fix panic-okay-to-inline change; adjust tests

This line of the inlining tuning experiment
https://go-review.googlesource.com/c/go/+/109918/1/src/cmd/compile/internal/gc/inl.go#347
was incorrectly rewritten in a later patch to use the call
cost, not the panic cost, and thus the inlining of panic
didn't occur when it should.  I discovered this when I
realized that tests should have failed, but didn't.

Fix is to make the correct change, and also to modify the
tests that this causes to fail.  One test now asserts the
new normal, the other calls "ppanic" instead which is
designed to behave like panic but not be inlined.

Change-Id: I423bb7f08bd66a70d999826dd9b87027abf34cdf
Reviewed-on: https://go-review.googlesource.com/116656
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/inl.go
src/runtime/runtime-gdb_test.go
test/closure3.dir/main.go
test/escape4.go