-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Missed optimization: codegen test repeat-trusted-len.rs fails when stdlib is compiled with overflow-checks=on #72549
Comments
Odd, this doesn't reproduce on godbolt (i.e. there's a memset), even when I go back to a release from 2020. |
That's using a stdlib that's not compiled with overflow-checks -- the
overflow checks only applies to your code.
…On Mon, Oct 11, 2021 at 3:11 PM the8472 ***@***.***> wrote:
Odd, this doesn't reproduce on godbolt (i.e. there's a memset), even when
I go back to a release from 2020.
https://rust.godbolt.org/z/WjM7jz619
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#72549 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBCMNGY3BZOBJIVGTQLUGMZG5ANCNFSM4NJBYZVQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
All that is necessary for evil to succeed is for good people to do nothing.
|
Right, I forgot, although it depends on whether the methods in question are annotated with |
We could work around that LLVM shortcoming by using unchecked add/sub which have been added in the meantime. #85122 |
Can't seem to reproduce it. Maybe it is gone with the new LLVM pass manager? |
Maybe? The C reproucer I filed the LLVM bug with still reproduces for me. |
The LLVM bug I filed no longer reproduces, so I'm going to close this. |
This is another discovery in my work on #58475 / rust-lang/rfcs#2635 -- trying to see if it's practical to enable overflow checks by default in release builds.
This fails with:
The issue seems to be that the LLVM loop-idiom recognizer runs before the optimizations that remove the overflow checks, therefor you get a loop in assembly, instead of a call to memset. I've filed a bug against LLVM with this: https://bugs.llvm.org/show_bug.cgi?id=46057 , but I'm also filing a bug here so there's a way to track the rust side impact of it
The text was updated successfully, but these errors were encountered: