cpu: fixed unused variable on fast binary
authorAndrea Mondelli <andrea.mondelli@huawei.com>
Mon, 18 May 2020 17:50:33 +0000 (01:50 +0800)
committerAndrea Mondelli <Andrea.Mondelli@huawei.com>
Tue, 19 May 2020 11:29:29 +0000 (11:29 +0000)
When gem5.fast is compiled, an error on a variable
used only for debug purposes is raised:

build/X86/cpu/o3/mem_dep_unit_impl.hh:262:19: error: unused variable 'producing_store' [-Werror=unused-variable]
         for (auto producing_store : producing_stores)

This patch remove the variable when *.fast is used.

Change-Id: Ib77c26073db39644e3525bc16edcb7d3bc871d76
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29252
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

src/cpu/o3/mem_dep_unit_impl.hh

index 9a50341b4da5af9e79c131a9655da4a5d7357014..d1eac2996ba8fb1cda9a0a8db35fd9655ffb15ec 100644 (file)
@@ -259,7 +259,7 @@ MemDepUnit<MemDepPred, Impl>::insert(const DynInstPtr &inst)
     } else {
         // Otherwise make the instruction dependent on the store/barrier.
         DPRINTF(MemDepUnit, "Adding to dependency list\n");
-        for (auto producing_store : producing_stores)
+        for (auto M5_VAR_USED producing_store : producing_stores)
             DPRINTF(MemDepUnit, "\tinst PC %s is dependent on [sn:%lli].\n",
                 inst->pcState(), producing_store);