3 ms·
>Also, it is humorous to me to see blog posts that say, "[Rust feature that causes inconvenience] enables compilers to do [compiler optimization that C++ compil
by imtringued 4y ago
>Also, it is humorous to me to see blog posts that say, "[Rust feature that causes inconvenience] enables compilers to do [compiler optimization that C++ compilers already do]."
What? You can't safely do strict aliasing in C++ and even if you did, it was broken anyway to the point where the Rust compiler had to disable it because of LLVM bugs.
https://github.com/rust-lang/rust/issues/54878#issuecomment-429578187 https://github.com/rust-lang/rust/issues/54878#issuecomment-...
https://news.ycombinator.com/item?id=25624538 https://news.ycombinator.com/item?id=25624538
- jcranmer 4y agoStrict aliasing maps to TBAA in LLVM; the buggy feature is noalias, which corresponds to C's restrict.
- pclmulqdq 4y agoThe restrict keyword historically has meant "I know these pointers are different, please optimize as though they are." It had nothing to do with correctness. It is quite tricky to check for correctness in the general case of this kind of keyword.