vex: r3361 - /trunk/priv/host_mips_isel.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

vex: r3361 - /trunk/priv/host_mips_isel.c

svn-2
Author: petarj
Date: Fri May  5 15:15:48 2017
New Revision: 3361

Log:
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]

Modified:
    trunk/priv/host_mips_isel.c

Modified: trunk/priv/host_mips_isel.c
==============================================================================
--- trunk/priv/host_mips_isel.c (original)
+++ trunk/priv/host_mips_isel.c Fri May  5 15:15:48 2017
@@ -129,14 +129,12 @@
 
 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 @@
 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 @@
                          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;


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers