-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: extraneous line number info #16380
Comments
Based on the output of
The output was
As you can see, there are many loads from the stack that are attributed to |
While I don't know the cause, I want to comment that GCC has the notion of an IR instruction with no location. When debug info for such an instruction is generated, it simply inherits the location of the preceding instruction. Perhaps that would be appropriate here. |
It seems these loads come from "shuffle" step of the reg allocator, where it puts values to desired locations to satisfy merge edges. In this case, the load instruction is labelled with the line number of the spill (unlike the general case where it is labelled with the line number of the use). Maybe we should assign the line number based on its use as well? However, the use information seems not carried to this step. I will see how simple to add it. |
CL https://golang.org/cl/25082 is a tentative fix. Do the line numbers get better with this CL? |
CL https://golang.org/cl/25082 mentions this issue. |
A tentative fix of #16380. It adds "line" everywhere... This also reduces binary size slightly (cmd/go on ARM as an example): before after total binary size 8068097 8018945 (-0.6%) .gopclntab 1195341 1179929 (-1.3%) .debug_line 689692 652017 (-5.5%) Change-Id: Ibda657c6999783c5bac180cbbba487006dbf0ed7 Reviewed-on: https://go-review.googlesource.com/25082 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Fixed in that CL. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.7rc1 windows/amd64
go env
)?windows/amd64
Profiling https://play.golang.org/p/pUyOao-V9w
Assembly listing similar to pprof's 1.6.2
weblist
:Assembly listing from 41da11 to 41de1b is unnecessary.
version devel +4054769 produces same listing
The text was updated successfully, but these errors were encountered: