From 68eb852d62864b2093c365ce2a80e9fd39908312 Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Mon, 19 Feb 2018 13:54:46 -0500 Subject: [PATCH] mem: fix page_table bug for .fast build Since b8b13206c8, the '.fast' build has failed to compile with an error caused by a variable and an assert. As a reminder, assert macros are optimized out of the build for '.fast'. If an assert check requires a variable that is unused anywhere else in the code, the compiler complains that the variable is unused and the scons build fails. The solution is to add a M5_VAR_USED specifier to tell the compiler to ignore the variable. Change-Id: I38f6bbed1e4c0506c5bbc1206c21f1f7e3d8dfe6 Reviewed-on: https://gem5-review.googlesource.com/8462 Reviewed-by: Jason Lowe-Power Reviewed-by: Anthony Gutierrez Maintainer: Jason Lowe-Power Maintainer: Anthony Gutierrez --- src/mem/page_table.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc index cd3422560..d771479d0 100644 --- a/src/mem/page_table.cc +++ b/src/mem/page_table.cc @@ -39,6 +39,7 @@ #include +#include "base/compiler.hh" #include "base/trace.hh" #include "debug/MMU.hh" #include "sim/faults.hh" @@ -83,7 +84,7 @@ EmulationPageTable::remap(Addr vaddr, int64_t size, Addr new_vaddr) new_vaddr, size); while (size > 0) { - auto new_it = pTable.find(new_vaddr); + auto new_it M5_VAR_USED = pTable.find(new_vaddr); auto old_it = pTable.find(vaddr); assert(old_it != pTable.end() && new_it == pTable.end()); -- 2.30.2