-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: bad debug_line stmt selection for if statement involving string comparison #31138
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
It's only happen if you disable optimization, which If you move For me, the compiler does reverse logic here. I expect the behavior of non-optimization happens in optimization mode. |
git bisect points to 2578ac5 It seems to be reasonable, because with optimization,
What should we do in this case? cc @josharian |
What tool are you using to print that?
|
You are correct, this problem is fixed on master. I'm using diexplorer, I haven't found anything else that prints the stmt flag in a satisfactory way. |
Given the following program:
for line 15 (
if st.Name == s
) the generated code is:Both instructions selected as statements (0x450c03 and 0x450c19) happen after a check on string length, something like 0x450bea or 0x450bf4 would be more appropriate.
Original report: go-delve/delve#1527
cc @heschik @dr2chase
@gopherbot please add label Debugging
The text was updated successfully, but these errors were encountered: