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

C++23's [[assume]] #276

Closed
lefticus opened this issue Apr 5, 2023 · 4 comments
Closed

C++23's [[assume]] #276

lefticus opened this issue Apr 5, 2023 · 4 comments

Comments

@lefticus
Copy link
Owner

lefticus commented Apr 5, 2023

https://en.cppreference.com/w/cpp/language/attributes/assume

@lefticus
Copy link
Owner Author

lefticus commented Jan 5, 2024

Here's an example https://compiler-explorer.com/z/jMh8fz7nK

@lefticus
Copy link
Owner Author

Coming in episode 412

@nandanvasudevan
Copy link

After defining a body for get_ptr() I am not able to see any improvement with [[assume]].
Why do you think that is?

https://compiler-explorer.com/z/vPWcoo5o6

@LB--
Copy link

LB-- commented Apr 6, 2024

@nandanvasudevan The link you posted seems to show proper optimized assembly output, but you left it on GCC trunk so the compiler has likely been updated since you posted the link. I suppose the answer to your question is that it was a GCC bug that has since been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants