-
Notifications
You must be signed in to change notification settings - Fork 857
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
Miscompilation of printstring at high optimization levels #14
Comments
Just confirming this is still an issue with the latest |
I plan to look into it once I'm on a stable LLVM version. It is possible this is a bug in LLVM. What I've found last time I experimented with it, is that it is a specific combination of a branch depending on a volatile variable, println("foo", uint16(5)) is turned into this: runtime.printstring("foo")
runtime.printspace()
runtime.printuint16(5)
runtime.printnl() EDIT: if you manage to reproduce this on a desktop computer, that would make finding the bug much easier (with bugpoint). |
Tested on stable LLVM, the issue is still present. |
It looks like I made a mistake while testing. I cannot reproduce it now (on stable LLVM) so it looks like a bug in LLVM that was fixed before the release. |
Good news here, I also can no longer reproduce on latest LLVM. Seems you are correct, this must have been addressed upstream. Seems like it can ne closed now. |
Glad to hear, and thanks for testing! |
all: address PR feedback
As reported by @deadprogram in PR #12, this code does not print the string:
So far, I've found it's related to optimization levels (see params to
Optimize()
in main.go). Size level 0 and 1 compile just fine, but 2 fails. Optimization level 1 and 2 have no difference.The text was updated successfully, but these errors were encountered: