arch: get rid of dummy var init

MemOperand variables were being initialized to 0
"to avoid 'uninitialized variable' errors" but these
no longer seem to be a problem (with the exception of
one use case in POWER that is arguably broken and
easily fixed here).

Getting rid of the initialization is necessary to
set up a subsequent patch which extends memory
operands to possibly not be scalars, making the
'= 0' initialization no longer feasible.
This commit is contained in:
Steve Reinhardt 2016-02-06 17:21:20 -08:00
parent 92b750d5ef
commit f5343df1e1
2 changed files with 2 additions and 4 deletions

View file

@ -790,10 +790,8 @@ class MemOperand(Operand):
return '' return ''
def makeDecl(self): def makeDecl(self):
# Note that initializations in the declarations are solely
# to avoid 'uninitialized variable' errors from the compiler.
# Declare memory data variable. # Declare memory data variable.
return '%s %s = 0;\n' % (self.ctype, self.base_name) return '%s %s;\n' % (self.ctype, self.base_name)
def makeRead(self, predRead): def makeRead(self, predRead):
if self.read_code != None: if self.read_code != None:

View file

@ -309,10 +309,10 @@ decode OPCODE default Unknown::unknown() {
151: stwx({{ Mem = Rs; }}); 151: stwx({{ Mem = Rs; }});
150: stwcx({{ 150: stwcx({{
bool store_performed = false; bool store_performed = false;
Mem = Rs;
if (Rsv) { if (Rsv) {
if (RsvLen == 4) { if (RsvLen == 4) {
if (RsvAddr == EA) { if (RsvAddr == EA) {
Mem = Rs;
store_performed = true; store_performed = true;
} }
} }