scons: Fixes uninitialized warnings issued by clang
authorMitch Hayenga <mitch.hayenga@arm.com>
Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)
committerMitch Hayenga <mitch.hayenga@arm.com>
Fri, 7 Mar 2014 20:56:23 +0000 (15:56 -0500)
Small fixes to appease recent clang versions.

src/arch/arm/insts/fplib.cc
src/base/compiler.hh
src/cpu/o3/scoreboard.hh
src/sim/probe/probe.hh

index 1f44eed090da4c82f02cce84e0e1c4bcf6b4d836..e6528358ab933c94091f645d0ff501afd41c7050 100644 (file)
@@ -2509,7 +2509,7 @@ fplibRecipEstimate(uint32_t op, FPSCR &fpscr)
         result = fp32_infinity(sgn);
         flags |= FPLIB_DZC;
     } else if (!((uint32_t)(op << 1) >> 22)) {
-        bool overflow_to_inf;
+        bool overflow_to_inf = false;
         switch (FPCRRounding(fpscr)) {
           case FPRounding_TIEEVEN:
             overflow_to_inf = true;
@@ -2570,7 +2570,7 @@ fplibRecipEstimate(uint64_t op, FPSCR &fpscr)
         result = fp64_infinity(sgn);
         flags |= FPLIB_DZC;
     } else if (!((uint64_t)(op << 1) >> 51)) {
-        bool overflow_to_inf;
+        bool overflow_to_inf = false;
         switch (FPCRRounding(fpscr)) {
           case FPRounding_TIEEVEN:
             overflow_to_inf = true;
index 7176537d2fa48c9ed84d3a6ceae8a02212aae785..a16667d8d1e11faccf25745790f257cb16bde926 100644 (file)
 #define M5_PRAGMA_NORETURN(x)
 #define M5_DUMMY_RETURN
 #define M5_VAR_USED __attribute__((unused))
+
+#if defined(__clang__)
+#define M5_CLASS_VAR_USED M5_VAR_USED
+#else
+#define M5_CLASS_VAR_USED
+#endif
+
 #define M5_ATTR_PACKED __attribute__ ((__packed__))
 #define M5_NO_INLINE __attribute__ ((__noinline__))
 #else
index 79271082daba0382c78a774623f72f1f4230b36f..ec84becdff0321020bccbfdb1f47de0d494cda09 100644 (file)
@@ -72,7 +72,7 @@ class Scoreboard
      * the misc registers that come after the physical registers and
      * which are hardwired to be always considered ready.
      */
-    unsigned numTotalRegs;
+    unsigned M5_CLASS_VAR_USED numTotalRegs;
 
     /** The index of the zero register. */
     PhysRegIndex zeroRegIdx;
index 0f77ccb1de23aaa9863ca5e88d9cec36bd99baf5..5a0bf11c92664eaeca394aaa784af5d47fd3027e 100644 (file)
@@ -133,7 +133,7 @@ class ProbeManager
 {
   private:
     /** Required for sensible debug messages.*/
-    const SimObject *object;
+    const M5_CLASS_VAR_USED SimObject *object;
     /** Vector for name look-up. */
     std::vector<ProbePoint *> points;