arm: Fix maybe-uninitialized GCC warnings
authorChun-Chen Hsu <chunchenhsu@google.com>
Tue, 13 Mar 2018 10:24:21 +0000 (18:24 +0800)
committerChun-Chen TK Hsu <chunchenhsu@google.com>
Wed, 14 Mar 2018 11:57:10 +0000 (11:57 +0000)
GCC 7 generates maybe-uninitialized warnings at the code that updates
the "dest" variables in the writeVecElem function of neon64_mem.hh file.
It is because the generated code does not appropriately initialize the
output variable before passing it to the writeVecElem function.  This
patch initializes the output variable to fix this.

Change-Id: I50a8f4e456ccdcaa3db1392ec097017450c56ecb
Signed-off-by: Chun-Chen Hsu <chunchenhsu@google.com>
Reviewed-on: https://gem5-review.googlesource.com/9121
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/arch/arm/isa/insts/neon64_mem.isa

index 4d32412266ac7d83ac9958c53832404e649489e4..4511ad105249c3e6916801715eff786180378e50 100644 (file)
@@ -336,7 +336,8 @@ let {{
             eCode = '''
                 //input data from scratch area
                 VReg input[4] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} };
-                VReg output[2];  //output data to arch. SIMD regs
+                //output data to arch. SIMD regs
+                VReg output[2] = { {0, 0}, {0, 0} };
             '''
 
             eCode += getInputCodeOp1L