summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-03-07 15:56:23 -0500
committerMitch Hayenga <mitch.hayenga@arm.com>2014-03-07 15:56:23 -0500
commitb9a9d99b226768dc972f0c40488f332066396e69 (patch)
tree711545134b14d63a51c096da0f5a2e7811c7b4fc
parentbef2086f5bb1ef350181791c6dff14d0964a5680 (diff)
downloadgem5-b9a9d99b226768dc972f0c40488f332066396e69.tar.xz
scons: Fixes uninitialized warnings issued by clang
Small fixes to appease recent clang versions.
-rw-r--r--src/arch/arm/insts/fplib.cc4
-rw-r--r--src/base/compiler.hh7
-rw-r--r--src/cpu/o3/scoreboard.hh2
-rw-r--r--src/sim/probe/probe.hh2
4 files changed, 11 insertions, 4 deletions
diff --git a/src/arch/arm/insts/fplib.cc b/src/arch/arm/insts/fplib.cc
index 1f44eed09..e6528358a 100644
--- a/src/arch/arm/insts/fplib.cc
+++ b/src/arch/arm/insts/fplib.cc
@@ -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;
diff --git a/src/base/compiler.hh b/src/base/compiler.hh
index 7176537d2..a16667d8d 100644
--- a/src/base/compiler.hh
+++ b/src/base/compiler.hh
@@ -50,6 +50,13 @@
#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
diff --git a/src/cpu/o3/scoreboard.hh b/src/cpu/o3/scoreboard.hh
index 79271082d..ec84becdf 100644
--- a/src/cpu/o3/scoreboard.hh
+++ b/src/cpu/o3/scoreboard.hh
@@ -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;
diff --git a/src/sim/probe/probe.hh b/src/sim/probe/probe.hh
index 0f77ccb1d..5a0bf11c9 100644
--- a/src/sim/probe/probe.hh
+++ b/src/sim/probe/probe.hh
@@ -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;