]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips: reduce compile warnings
authorPetar Jovanovic <mips32r2@gmail.com>
Fri, 5 May 2017 14:15:48 +0000 (14:15 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Fri, 5 May 2017 14:15:48 +0000 (14:15 +0000)
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

VEX/priv/host_mips_isel.c

index 8b07edf4e9e9f859cb736ee7f1422e5b182ce33a..88f37080071ad2181a0b758f44d9b5b1b3a43deb 100644 (file)
@@ -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;