From: Petar Jovanovic Date: Fri, 5 May 2017 14:15:48 +0000 (+0000) Subject: mips: reduce compile warnings X-Git-Tag: svn/VALGRIND_3_13_0^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20324f13bb7d5ad1dccf2c1642905d07defef850;p=thirdparty%2Fvalgrind.git mips: reduce compile warnings Tune the code so it does not trigger any compile warnings. argregs and tmpregs arrays have been enlarged to have 8 elements on mips32, since that way we get rid of several false warnings: warning: array index 5 is past the end of the array (which contains 4 elements) [-Warray-bounds] Also removing three "vassert(tmp >= 0);" as these asserts are not valid, since tmp is an unsigned value. With the change, we get rid of: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] git-svn-id: svn://svn.valgrind.org/vex/trunk@3361 --- diff --git a/VEX/priv/host_mips_isel.c b/VEX/priv/host_mips_isel.c index 8b07edf4e9..88f3708007 100644 --- a/VEX/priv/host_mips_isel.c +++ b/VEX/priv/host_mips_isel.c @@ -129,14 +129,12 @@ typedef static HReg lookupIRTemp(ISelEnv * env, IRTemp tmp) { - vassert(tmp >= 0); vassert(tmp < env->n_vregmap); return env->vregmap[tmp]; } static void lookupIRTemp64(HReg * vrHI, HReg * vrLO, ISelEnv * env, IRTemp tmp) { - vassert(tmp >= 0); vassert(tmp < env->n_vregmap); vassert(! hregIsInvalid(env->vregmapHI[tmp])); *vrLO = env->vregmap[tmp]; @@ -147,7 +145,6 @@ static void lookupIRTempPair(HReg * vrHI, HReg * vrLO, ISelEnv * env, IRTemp tmp) { vassert(env->mode64); - vassert(tmp >= 0); vassert(tmp < env->n_vregmap); vassert(! hregIsInvalid(env->vregmapHI[tmp])); *vrLO = env->vregmap[tmp]; @@ -395,8 +392,8 @@ static void doHelperCall(/*OUT*/UInt* stackAdjustAfterCall, IRCallee* cee, IRType retTy, IRExpr** args ) { MIPSCondCode cc; - HReg argregs[MIPS_N_REGPARMS]; - HReg tmpregs[MIPS_N_REGPARMS]; + HReg argregs[8]; + HReg tmpregs[8]; Bool go_fast; Int n_args, i, argreg; UInt argiregs;