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

Use HPX_ASSERT to aid the compiler #1161

Closed
eschnett opened this issue Jun 20, 2014 · 2 comments
Closed

Use HPX_ASSERT to aid the compiler #1161

eschnett opened this issue Jun 20, 2014 · 2 comments

Comments

@eschnett
Copy link
Contributor

With HPX_DISABLE_ASSERTS, HPX_ASSERT(cond) turns into (void)0. Instead, it could expand to HPX_LIKELY(expr), or even to (expr) ? (void)0 : __builtin_unreachable(). A modern version of clang would optimize away the condition, but could still use it for value range propagation.

@hkaiser
Copy link
Member

hkaiser commented Jun 20, 2014

__building_unreachable() is not portable

@eschnett
Copy link
Contributor Author

Sure. You would check whether it is available, and only use it if it exists.

@hkaiser hkaiser added this to the 0.9.9 milestone Jun 20, 2014
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

2 participants