aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2023-03-02 00:24:37 -0800
committerAndrew Waterman <andrew@sifive.com>2023-03-02 00:24:37 -0800
commit860a120bf16ba32eb491111bdf1b214bfa652654 (patch)
tree7930198937dd654fbce649f26e5b206989601673
parentd1ae27b7f843b35bd32778c54b4973d7aeffad52 (diff)
downloadspike-860a120bf16ba32eb491111bdf1b214bfa652654.zip
spike-860a120bf16ba32eb491111bdf1b214bfa652654.tar.gz
spike-860a120bf16ba32eb491111bdf1b214bfa652654.tar.bz2
Define sim_t::INTERLEAVE so that it can be accessed by reference
std::min takes its arguments by reference, so the arguments need to be defined. An alternative would have been to force the problematic argument into being an rvalue (e.g., by adding 0), but this approach seems to me to be more robust. This fixes compilation under -O0; see https://github.com/riscv-software-src/riscv-isa-sim/pull/1264#issuecomment-1451114717 @scottj97 I posit that this situation is unusual enough that it shouldn't motivate us to test -O0 in CI.
-rw-r--r--riscv/sim.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc
index c623de1..b1426fb 100644
--- a/riscv/sim.cc
+++ b/riscv/sim.cc
@@ -30,6 +30,8 @@ static void handle_signal(int sig)
signal(sig, &handle_signal);
}
+const size_t sim_t::INTERLEAVE;
+
sim_t::sim_t(const cfg_t *cfg, bool halted,
std::vector<std::pair<reg_t, mem_t*>> mems,
std::vector<std::pair<reg_t, abstract_device_t*>> plugin_devices,