Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,6 @@ to Miri failing to detect cases of undefined behavior in a program.
disables the randomization of the next thread to be picked, instead fixing a round-robin schedule.
Note however that other aspects of Miri's concurrency behavior are still randomize; use
`-Zmiri-deterministic-concurrency` to disable them all.
* `-Zmiri-force-intrinsic-fallback` forces the use of the "fallback" body for all intrinsics that
have one. This is useful to test the fallback bodies, but should not be used otherwise. It is
**unsound** since the fallback body might not be checking for all UB.
* `-Zmiri-native-lib=<path to a shared object file or folder>` is an experimental flag for providing
support for calling native functions from inside the interpreter via FFI. The flag is supported
only on Unix systems. Functions not provided by that file are still executed via the usual Miri
Expand Down
2 changes: 0 additions & 2 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,6 @@ fn main() -> ExitCode {
} else if arg == "-Zmiri-ignore-leaks" {
miri_config.ignore_leaks = true;
miri_config.collect_leak_backtraces = false;
} else if arg == "-Zmiri-force-intrinsic-fallback" {
miri_config.force_intrinsic_fallback = true;
} else if arg == "-Zmiri-deterministic-floats" {
miri_config.float_nondet = false;
} else if arg == "-Zmiri-no-extra-rounding-error" {
Expand Down
3 changes: 0 additions & 3 deletions src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ pub struct MiriConfig {
pub address_reuse_cross_thread_rate: f64,
/// Round Robin scheduling with no preemption.
pub fixed_scheduling: bool,
/// Always prefer the intrinsic fallback body over the native Miri implementation.
pub force_intrinsic_fallback: bool,
/// Whether floating-point operations can behave non-deterministically.
pub float_nondet: bool,
/// Whether floating-point operations can have a non-deterministic rounding error.
Expand Down Expand Up @@ -210,7 +208,6 @@ impl Default for MiriConfig {
address_reuse_rate: 0.5,
address_reuse_cross_thread_rate: 0.1,
fixed_scheduling: false,
force_intrinsic_fallback: false,
float_nondet: true,
float_rounding_error: FloatRoundingErrorMode::Random,
short_fd_operations: true,
Expand Down
10 changes: 0 additions & 10 deletions src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
) -> InterpResult<'tcx, Option<ty::Instance<'tcx>>> {
let this = self.eval_context_mut();

// Force use of fallback body, if available.
if this.machine.force_intrinsic_fallback
&& !this.tcx.intrinsic(instance.def_id()).unwrap().must_be_overridden
{
return interp_ok(Some(ty::Instance {
def: ty::InstanceKind::Item(instance.def_id()),
args: instance.args,
}));
}

// See if the core engine can handle this intrinsic.
if this.eval_intrinsic(instance, args, dest, ret)? {
return interp_ok(None);
Expand Down
5 changes: 0 additions & 5 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,6 @@ pub struct MiriMachine<'tcx> {
/// Cache for `mangle_internal_symbol`.
pub(crate) mangle_internal_symbol_cache: FxHashMap<&'static str, String>,

/// Always prefer the intrinsic fallback body over the native Miri implementation.
pub force_intrinsic_fallback: bool,

/// Whether floating-point operations can behave non-deterministically.
pub float_nondet: bool,
/// Whether floating-point operations can have a non-deterministic rounding error.
Expand Down Expand Up @@ -838,7 +835,6 @@ impl<'tcx> MiriMachine<'tcx> {
pthread_condvar_sanity: Cell::new(false),
allocator_shim_symbols: Self::allocator_shim_symbols(tcx),
mangle_internal_symbol_cache: Default::default(),
force_intrinsic_fallback: config.force_intrinsic_fallback,
float_nondet: config.float_nondet,
float_rounding_error: config.float_rounding_error,
short_fd_operations: config.short_fd_operations,
Expand Down Expand Up @@ -1074,7 +1070,6 @@ impl VisitProvenance for MiriMachine<'_> {
pthread_condvar_sanity: _,
allocator_shim_symbols: _,
mangle_internal_symbol_cache: _,
force_intrinsic_fallback: _,
float_nondet: _,
float_rounding_error: _,
short_fd_operations: _,
Expand Down
14 changes: 0 additions & 14 deletions tests/pass/c-variadic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ fn equal_up_to_free_lifetime() {
}

fn clone() {
if cfg!(force_intrinsic_fallback) {
// Skip this test when we use the fallback bodies. The fallback body does
// not hook into the Miri allocation bookkeeping for variable argument lists
// and would would falsely report UB.
return;
}

unsafe extern "C" fn clone_the_va_list(args: ...) {
// The implicit `drop` will catch a `VaList` that isn't properly initialized.
let _ = args.clone();
Expand All @@ -137,13 +130,6 @@ fn clone() {
}

fn clone_and_advance() {
if cfg!(force_intrinsic_fallback) {
// Skip this test when we use the fallback bodies. The fallback body does
// not hook into the Miri allocation bookkeeping for variable argument lists
// and would would falsely report UB.
return;
}

unsafe extern "C" fn variadic(mut a: ...) {
unsafe {
let mut b = a.clone();
Expand Down
6 changes: 0 additions & 6 deletions tests/pass/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1529,12 +1529,6 @@ fn test_fmuladd() {
}

fn test_non_determinism() {
if cfg!(force_intrinsic_fallback) {
// Skip this test when we use the fallback bodies, as that one is deterministic.
// (CI sets `--cfg force_intrinsic_fallback` together with `-Zmiri-force-intrinsic-fallback`.)
return;
}

use std::intrinsics::{
fadd_algebraic, fadd_fast, fdiv_algebraic, fdiv_fast, fmul_algebraic, fmul_fast,
frem_algebraic, frem_fast, fsub_algebraic, fsub_fast,
Expand Down
6 changes: 0 additions & 6 deletions tests/pass/float_nan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,6 @@ fn test_simd() {
}

fn main() {
if cfg!(force_intrinsic_fallback) {
// Skip this test when we use the fallback bodies, as that one is deterministic.
// (CI sets `--cfg force_intrinsic_fallback` together with `-Zmiri-force-intrinsic-fallback`.)
return;
}

// Check our constants against std, just to be sure.
// We add 1 since our numbers are the number of bits stored
// to represent the value, and std has the precision of the value,
Expand Down
6 changes: 1 addition & 5 deletions tests/pass/intrinsics/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ fn main() {
assert_eq!(intrinsics::likely(false), false);
assert_eq!(intrinsics::unlikely(true), true);

// Skip this test when we use the fallback bodies, as that one is deterministic.
// (CI sets `--cfg force_intrinsic_fallback` together with `-Zmiri-force-intrinsic-fallback`.)
if !cfg!(force_intrinsic_fallback) {
check_nondet(|| intrinsics::is_val_statically_known(0));
}
check_nondet(|| intrinsics::is_val_statically_known(0));

intrinsics::forget(Bomb);

Expand Down
Loading