News for hackers. Stuff that matters.
Re:GCC Rust: GCC Front-End for Rust by gpderetta on Tuesday January 12, 2021 @01:10PM (#25750843)
Store sinking for example, which is unsafe unless the loop is guaranteed to terminate.

C does not have this guarantee (at least not in all cases). Also rust is compiled with the llvm backend, so my understanding is that in practice rust assumes that loops terminate. See:

https://github.com/rust-lang/rust/issues/28728

There are llvm directives that can be added to prevent the optimization, but they are rejected by the rust maintainers exactly because they would cause performance regressions.

There are no comments on this comment yet.