-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: '-gcflags=all=-l' flag does not disable inlining for all packages #27708
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
Comments
Just to set expectations: If you're using it for tests that you actually care about, I recommend restructuring the code so that you can test it via its exported API (without relying on the implementation details of the compiler). |
http server
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
(CC @bouk) |
I stand corrected: it does appear that 0000000000671f90 <test_inline/handle.SayMax>:
671f90: 64 48 8b 0c 25 f8 ff mov %fs:0xfffffffffffffff8,%rcx
671f97: ff ff
671f99: 48 3b 61 10 cmp 0x10(%rcx),%rsp
671f9d: 0f 86 ba 00 00 00 jbe 67205d <test_inline/handle.SayMax+0xcd>
671fa3: 48 83 ec 68 sub $0x68,%rsp
671fa7: 48 89 6c 24 60 mov %rbp,0x60(%rsp)
671fac: 48 8d 6c 24 60 lea 0x60(%rsp),%rbp
671fb1: 0f 57 c0 xorps %xmm0,%xmm0
671fb4: 0f 11 44 24 50 movups %xmm0,0x50(%rsp)
671fb9: 48 8d 05 c0 22 03 00 lea 0x322c0(%rip),%rax # 6a4280 <type.*+0x31060>
671fc0: 48 89 04 24 mov %rax,(%rsp)
671fc4: 48 c7 44 24 08 02 00 movq $0x2,0x8(%rsp)
671fcb: 00 00
671fcd: e8 3e 9b d9 ff callq 40bb10 <runtime.convT2E64>
671fd2: 48 8b 44 24 10 mov 0x10(%rsp),%rax
671fd7: 48 8b 4c 24 18 mov 0x18(%rsp),%rcx
671fdc: 48 89 44 24 50 mov %rax,0x50(%rsp)
671fe1: 48 89 4c 24 58 mov %rcx,0x58(%rsp)
671fe6: 48 8d 05 93 05 05 00 lea 0x50593(%rip),%rax # 6c2580 <type.*+0x4f360>
671fed: 48 89 04 24 mov %rax,(%rsp)
671ff1: 48 8b 44 24 70 mov 0x70(%rsp),%rax
671ff6: 48 89 44 24 08 mov %rax,0x8(%rsp)
671ffb: 48 8b 44 24 78 mov 0x78(%rsp),%rax
672000: 48 89 44 24 10 mov %rax,0x10(%rsp)
672005: e8 f6 a0 d9 ff callq 40c100 <runtime.convI2I>
67200a: 48 8b 44 24 18 mov 0x18(%rsp),%rax
67200f: 48 8b 4c 24 20 mov 0x20(%rsp),%rcx
672014: 48 89 04 24 mov %rax,(%rsp)
672018: 48 89 4c 24 08 mov %rcx,0x8(%rsp)
67201d: 48 8d 05 fe 4b 0a 00 lea 0xa4bfe(%rip),%rax # 716c22 <go.string.*+0x42>
672024: 48 89 44 24 10 mov %rax,0x10(%rsp)
672029: 48 c7 44 24 18 02 00 movq $0x2,0x18(%rsp)
672030: 00 00
672032: 48 8d 44 24 50 lea 0x50(%rsp),%rax
672037: 48 89 44 24 20 mov %rax,0x20(%rsp)
67203c: 48 c7 44 24 28 01 00 movq $0x1,0x28(%rsp)
672043: 00 00
672045: 48 c7 44 24 30 01 00 movq $0x1,0x30(%rsp)
67204c: 00 00
67204e: e8 cd 60 e4 ff callq 4b8120 <fmt.Fprintf>
672053: 48 8b 6c 24 60 mov 0x60(%rsp),%rbp
672058: 48 83 c4 68 add $0x68,%rsp
67205c: c3 retq
67205d: e8 4e f6 de ff callq 4616b0 <runtime.morestack_noctxt>
672062: e9 29 ff ff ff jmpq 671f90 <test_inline/handle.SayMax> |
CC @randall77 @josharian @martisch It's not obvious to me whether the |
I think if inlining is disabled, it should not do constant-folding through the call. In fact, adding In fact, I tried
Reading the build log,
More complete list for all compiles:
There are quite a few compilations where |
Possibly the same underlying cause as #27681? |
With or without |
Closing as a duplicate of #27681. Very likely the same cause, and we can always reopen if it turns out to be independent. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?ubuntu 18.04
What did you do?
'go test -gcflags=all=-l' my project, but failed because disable inlining is invalid on
http server
.The following program can be reproduced.
https://github.com/houxl123/test_inline/
What did you expect to see?
go test success in go1.11
What did you see instead?
go test fail
The text was updated successfully, but these errors were encountered: