From: Alec Roelke Date: Thu, 13 Jul 2017 20:26:53 +0000 (-0400) Subject: riscv: Add unused attribute to some registers.hh constants X-Git-Tag: v19.0.0.0~2684 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d72eafa64b4313f30f4c7a25000ff04f5cf30380;p=gem5.git riscv: Add unused attribute to some registers.hh constants Three of the constants defined in arch/riscv/registers.hh (ReturnValueReg, SyscallNumReg, and SyscallPseudoReturnReg) may cause the compiler to warn that they are unused, which results in an error. This patch adds M5_VAR_USED attributes to them to stop this. Change-Id: Ie6389a55e8ffb3d003a47d02e76bdf9fb5219457 Reviewed-on: https://gem5-review.googlesource.com/4040 Reviewed-by: Jason Lowe-Power Maintainer: Alec Roelke --- diff --git a/src/arch/riscv/registers.hh b/src/arch/riscv/registers.hh index e2b04ab84..114d7e9e1 100644 --- a/src/arch/riscv/registers.hh +++ b/src/arch/riscv/registers.hh @@ -93,7 +93,7 @@ const int GlobalPointerReg = 3; const int ThreadPointerReg = 4; const int FramePointerReg = 8; const std::vector ReturnValueRegs = {10, 11}; -const int ReturnValueReg = ReturnValueRegs[0]; +const int ReturnValueReg M5_VAR_USED = ReturnValueRegs[0]; const std::vector ArgumentRegs = {10, 11, 12, 13, 14, 15, 16, 17}; const int AMOTempReg = 32; @@ -118,10 +118,10 @@ const std::vector FloatRegNames = { "ft8", "ft9", "ft10", "ft11" }; -const int SyscallNumReg = ArgumentRegs[7]; +const int SyscallNumReg M5_VAR_USED = ArgumentRegs[7]; const std::vector SyscallArgumentRegs = {ArgumentRegs[0], ArgumentRegs[1], ArgumentRegs[2], ArgumentRegs[3]}; -const int SyscallPseudoReturnReg = ReturnValueRegs[0]; +const int SyscallPseudoReturnReg M5_VAR_USED = ReturnValueRegs[0]; enum MiscRegIndex { MISCREG_USTATUS = 0x000,