Brandon Potter merged this change by Brandon Potter. ( https://gem5-review.googlesource.com/8462 )

Change subject: mem: fix page_table bug for .fast build
......................................................................

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 <ja...@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutier...@amd.com>
Maintainer: Jason Lowe-Power <ja...@lowepower.com>
Maintainer: Anthony Gutierrez <anthony.gutier...@amd.com>
---
M src/mem/page_table.cc
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved



diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc
index cd34225..d771479 100644
--- a/src/mem/page_table.cc
+++ b/src/mem/page_table.cc
@@ -39,6 +39,7 @@

 #include <string>

+#include "base/compiler.hh"
 #include "base/trace.hh"
 #include "debug/MMU.hh"
 #include "sim/faults.hh"
@@ -83,7 +84,7 @@
             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());


--
To view, visit https://gem5-review.googlesource.com/8462
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I38f6bbed1e4c0506c5bbc1206c21f1f7e3d8dfe6
Gerrit-Change-Number: 8462
Gerrit-PatchSet: 3
Gerrit-Owner: Brandon Potter <brandon.pot...@amd.com>
Gerrit-Assignee: Sujay Phadke <electronicsguy...@gmail.com>
Gerrit-Reviewer: Ali Saidi <asa...@gmail.com>
Gerrit-Reviewer: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Brandon Potter <brandon.pot...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to