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

clang: missed optimization for an empty string #64535

Open
diamante0018 opened this issue Aug 8, 2023 · 0 comments
Open

clang: missed optimization for an empty string #64535

diamante0018 opened this issue Aug 8, 2023 · 0 comments

Comments

@diamante0018
Copy link
Contributor

When initializing a std::string with "" (empty) clang misses the opportunity to optimize a lot of code away.
In a real example we came across when examing a function from libc++ with @philnik777 we found the loss can be quite substantial

God bolt demo:
https://godbolt.org/z/f8av3EYbn

I opened this issue as advised by philnik777

@diamante0018 diamante0018 changed the title clang: missed optimazation for an empty string clang: missed optimization for an empty string Aug 8, 2023
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