Skip to content
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: constant inlining happens even when disabling inlining and optimizations #35527

Open
dlsniper opened this issue Nov 12, 2019 · 3 comments

Comments

@dlsniper
Copy link
Contributor

@dlsniper dlsniper commented Nov 12, 2019

What version of Go are you using (go version)?

go1.13.4

Does this issue reproduce with the latest release?

I haven't tried with Go 1.14 yet

What operating system and processor architecture are you using (go env)?

windows/amd64

What did you do?

ot == AnotherConst

What did you expect to see?

A boolean result

What did you see instead?

could not find symbol value for AnotherConst
@aarzilli

This comment has been minimized.

Copy link
Contributor

@aarzilli aarzilli commented Nov 12, 2019

Non-integer constants are never exported to debug_info, it doesn't have anything to do with whether they are inlined or not. Also, I'm not sure it's worth the executable bloat costs, since IIRC there was no way to reuse the strings stored in rodata from the debug_info constant entries.

@gopherbot please add label Debugging

@gopherbot gopherbot added the Debugging label Nov 12, 2019
@dlsniper

This comment has been minimized.

Copy link
Contributor Author

@dlsniper dlsniper commented Nov 12, 2019

Thanks for the explanation.

The problem was reported to GoLand by a user that had a similar code like the one above.
It's rather common to run a compare operation like this. For example, I use this to setup conditional breakpoints. Also, not everyone will know ahead of time that one is a constant or not when making the comparison, nor suggesting to change the code would be possible.

I'm not sure if go-delve/delve#1753 is related or not.

@andybons

This comment has been minimized.

Copy link
Member

@andybons andybons commented Nov 12, 2019

@andybons andybons added this to the Unplanned milestone Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.