From: Iru Cai Date: Thu, 10 Sep 2020 06:18:19 +0000 (+0800) Subject: arch-arm: just return the fault in twoEqualRegInst{,Fp} X-Git-Tag: v20.1.0.0~41 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59a3f3365fcb2445877ecfac09dce55e7bb9198e;p=gem5.git arch-arm: just return the fault in twoEqualRegInst{,Fp} This prevents the code from using the uninitialized destReg when running the ``if (imm >= eCount)`` branch, which will make GCC 10.2 report a -Werror=maybe-uninitialized error when building gem5.opt. Change-Id: Ie6e7d3d47a1b65b840b2106263ecfc21eb6af26b Signed-off-by: Iru Cai Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34275 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- diff --git a/src/arch/arm/isa/insts/neon.isa b/src/arch/arm/isa/insts/neon.isa index d536d5b8d..1dfefe7c3 100644 --- a/src/arch/arm/isa/insts/neon.isa +++ b/src/arch/arm/isa/insts/neon.isa @@ -1417,8 +1417,8 @@ let {{ readDestCode = 'destElem = letoh(destReg.elements[i]);' eWalkCode += ''' if (imm >= eCount) { - fault = std::make_shared(machInst, false, - mnemonic); + return std::make_shared(machInst, false, + mnemonic); } else { for (unsigned i = 0; i < eCount; i++) { Element srcElem1 = letoh(srcReg1.elements[i]); @@ -1519,8 +1519,8 @@ let {{ readDestCode = 'destReg = destRegs[i];' eWalkCode += ''' if (imm >= eCount) { - fault = std::make_shared(machInst, false, - mnemonic); + return std::make_shared(machInst, false, + mnemonic); } else { for (unsigned i = 0; i < rCount; i++) { float srcReg1 = srcRegs1[i];