Power: Fix MaxMiscDestRegs which was set to zero
authorAndreas Hansson <andreas.hansson@arm.com>
Fri, 8 Jun 2012 16:44:17 +0000 (12:44 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Fri, 8 Jun 2012 16:44:17 +0000 (12:44 -0400)
This patch fixes a failing compilation caused by MaxMiscDestRegs being
zero. According to gcc 4.6, the result is a comparison that is always
false due to limited range of data type.

src/arch/power/registers.hh

index 2d09677b2374cef44cf8f80f0110933724cbd329..723d664d2f9f70c8a036e61ea327672f67ae8abd 100644 (file)
@@ -38,7 +38,10 @@ namespace PowerISA {
 
 using PowerISAInst::MaxInstSrcRegs;
 using PowerISAInst::MaxInstDestRegs;
-using PowerISAInst::MaxMiscDestRegs;
+
+// Power writes a misc register outside of the isa parser, so it can't
+// be detected by it. Manually add it here.
+const int MaxMiscDestRegs = PowerISAInst::MaxMiscDestRegs + 1;
 
 typedef uint8_t RegIndex;