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

Codegen regression from stable to nightly and beta #102208

Closed
newpavlov opened this issue Sep 23, 2022 · 2 comments
Closed

Codegen regression from stable to nightly and beta #102208

newpavlov opened this issue Sep 23, 2022 · 2 comments
Labels
C-bug Category: This is a bug.

Comments

@newpavlov
Copy link
Contributor

While discussing potential alternative implementations for array::map in #102202, the following regression was discovered on nigthly/beta: https://rust.godbolt.org/z/h39Tr776T See assembly for foo2, it should be identical to foo1, but for some reason compiler was unable to eliminate panics. Switching toolchain to 1.64 results in expected efficient assembly.

@newpavlov newpavlov added the C-bug Category: This is a bug. label Sep 23, 2022
@the8472
Copy link
Member

the8472 commented Sep 23, 2022

Using for_each instead of for (i, x) in works. LLVM has issues with that pattern #92174

@newpavlov
Copy link
Contributor Author

It looks like the issue was fixed in Rust 1.69.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants