cpu: Fixed unused var error when with fast builds
authorBobby R. Bruce <bbruce@ucdavis.edu>
Thu, 10 Sep 2020 05:26:29 +0000 (22:26 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Thu, 10 Sep 2020 16:54:36 +0000 (16:54 +0000)
As `is_htm_speculative` is only used in assert statements, it is
considered unused during the `.fast` compilation. This commit adds the
`M5_USED_VAR` macro.

This caused our compiler tests to fail:
https://www.mail-archive.com/gem5-dev@gem5.org/msg35913.html

Change-Id: I00d187d1a31d065c236ac29a657bd479ad4b03bc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34256
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/simple/timing.cc

index f22c58ddd559126650f8cc88b6a8f7809ea9e813..820bede1b5b448e492b54071f342d8d450171ae2 100644 (file)
@@ -947,7 +947,7 @@ TimingSimpleCPU::completeDataAccess(PacketPtr pkt)
     // hardware transactional memory
 
     SimpleExecContext *t_info = threadInfo[curThread];
-    const bool is_htm_speculative =
+    const bool is_htm_speculative M5_VAR_USED =
         t_info->inHtmTransactionalState();
 
     // received a response from the dcache: complete the load or store