-
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: floating point optimization bug #13008
Comments
For compiler bugs, we will need a reproducer, Note that debugging prints could also affect One way to see if it's related to the optimizer |
Can you please build with -gcflags="-N", if that fixes the problem, then it may be an inlining bug.
|
Building with But it's also 30k LOC plus dependencies, so it's a bit crap as a reproducer. Obviously, doing just the code above in a Go 1.5.1 also doesn't exhibit this issue. |
Please try with -l (ell) but not -N. It's possible this is a dup of #12411 but I expected that one had something to do with the deep nesting. There's no nesting here. I tried starting with your example code and defining enough scaffolding to make it compile, and then I commented out the same prints and looked for a mishandling of completionPct, but I don't see it. It would help a bit if you could try building both the buggy and the non-buggy versions of the code with -S (that is, -gcflags -S), redirecting to separate files. The output is a sequence of assembly listings, one per function, each starting with an unindented line giving the function name. If you could send the disassembly of just the Completion method with and without the bug, that would be helpful. For example you might see a file like
and I'm asking for the part starting at the TEXT line until the section for the next function in the file. Thanks. |
Here: https://gist.github.com/calmh/dccbd2e6d4d511067dea Of those, both the variants with |
Thanks for the assembly. Please try the most recent version of the toolchain. Looking at the bad code, I believe this was fixed by https://go.googlesource.com/go/+/0bef88aa5fa5d8f92e2821d9df7c37caaac432dd on Sunday. |
The relevant fix is this one: On Tue, Nov 10, 2015 at 11:22 AM, Russ Cox notifications@github.com wrote:
|
Hmm, so following the tags and commits around it looks like this is fixed in 1.6 and still broken in 1.5.2? |
On the other hand, I can't seem to reproduce it with 1.5.2 so either something changed on my end to no longer trigger or I'm wrong. Either way, that's good. |
@calmh wasn't this bug both introduced and fixed after 1.5? (Note that point releases comprise selected changes cherry-picked onto the original release; they are not cut from master.) |
Yes, I'm super confused, sorry for the noise. |
I'm hitting something really weird on
go version devel +3bc0601 Tue Oct 20 03:16:09 2015 +0000 darwin/amd64
. I don't have a small reproducer, so I'll just show you what I get and see what we can figure out from that. I have this method, that essentially just calculates a percentage:The relevant part for this report is the last part,
needRatio := ...
and so on. When run as it looks above, I get the following log output (which is correct and as expected):If I comment out two of the debug prints:
Then I get the following output:
Note that
completionPct
has taken on a bizarre value - uninitialized? Printing it separately on the line before fixes this...The text was updated successfully, but these errors were encountered: