about summary refs log tree commit diff
path: root/src/test/codegen/non-terminate/infinite-recursion.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-14/+0
2021-10-22Update the minimum external LLVM to 12Josh Stone-1/+0
2021-03-10Remove the -Zinsert-sideeffectSimonas Kazlauskas-1/+2
This removes all of the code we had in place to work-around LLVM's handling of forward progress. From this removal excluded is a workaround where we'd insert a `sideeffect` into clearly infinite loops such as `loop {}`. This code remains conditionally effective when the LLVM version is earlier than 12.0, which fixed the forward progress related miscompilations at their root.
2019-09-28Gate llvm.sideeffect under -Z insert-sideeffectXiang Fan-1/+1
2019-09-28Add llvm.sideeffect to potential infinite loops and recursionsXiang Fan-0/+14
LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728