]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Get rid of the --check-addrVs flag and everything to do with it.
authorJulian Seward <jseward@acm.org>
Sun, 15 Dec 2002 01:42:22 +0000 (01:42 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 15 Dec 2002 01:42:22 +0000 (01:42 +0000)
It no longer makes much sense now we have a seperate addrcheck skin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1371

addrcheck/ac_main.c
memcheck/mc_common.c
memcheck/mc_common.h
memcheck/mc_main.c
memcheck/mc_translate.c

index 9d08f706b2d0bd1ee9081b324d4d7525a19dd5cf..2fa5ff10598fad72a5d06ff6c4cf162f4fe76770 100644 (file)
@@ -1243,8 +1243,6 @@ Char* SK_(usage)(void)
 "                              amount of bt merging in leak check [low]\n"
 "    --show-reachable=no|yes   show reachable blocks in leak check? [no]\n"
 "    --workaround-gcc296-bugs=no|yes  self explanatory [no]\n"
-"    --check-addrVs=no|yes     experimental lighterweight checking? [yes]\n"
-"                              yes == Valgrind's original behaviour\n"
 "\n"
 "    --cleanup=no|yes          improve after instrumentation? [yes]\n";
 }
index e08097631bd30881296b5e5b01d5e197cf2f6774..e90a3ae5e72aae054b49cf604e68b39789af74b4 100644 (file)
@@ -52,7 +52,6 @@ VgRes MC_(clo_leak_resolution)        = Vg_LowRes;
 Bool  MC_(clo_show_reachable)         = False;
 Bool  MC_(clo_workaround_gcc296_bugs) = False;
 Bool  MC_(clo_cleanup)                = True;
-Bool  MC_(clo_check_addrVs)           = True;
 Bool  MC_(clo_avoid_strlen_errors)    = True;
 
 Bool MC_(process_common_cmd_line_option)(Char* arg)
index 1ef3a1ab91f263bbc960edb0d17ea381bdc79c43..bea414a48fe5a11bb4fec3a99b52f7778f644145 100644 (file)
@@ -196,9 +196,6 @@ extern Bool MC_(clo_workaround_gcc296_bugs);
 /* DEBUG: clean up instrumented code?  default: YES */
 extern Bool MC_(clo_cleanup);
 
-/* Shall we V-check addrs? (they are always A checked too)   default: YES */
-extern Bool MC_(clo_check_addrVs);
-
 /* When instrumenting, omit some checks if tell-tale literals for
    inlined strlen() are visible in the basic block.  default: YES */
 extern Bool MC_(clo_avoid_strlen_errors);
index a3c8abd5eaeb4f7f62e4ce24010ce9c4de23c161..2cace6e4d4b1c45d74aa88d41838eb33ceeaa936 100644 (file)
@@ -1486,12 +1486,7 @@ Bool SK_(process_cmd_line_option)(Char* arg)
 #  define STREQ(s1,s2)     (0==VG_(strcmp_ws)((s1),(s2)))
 #  define STREQN(nn,s1,s2) (0==VG_(strncmp_ws)((s1),(s2),(nn)))
 
-   if (STREQ(arg, "--check-addrVs=yes"))
-      MC_(clo_check_addrVs) = True;
-   else if (STREQ(arg, "--check-addrVs=no"))
-      MC_(clo_check_addrVs) = False;
-
-   else if (STREQ(arg, "--avoid-strlen-errors=yes"))
+   if (STREQ(arg, "--avoid-strlen-errors=yes"))
       MC_(clo_avoid_strlen_errors) = True;
    else if (STREQ(arg, "--avoid-strlen-errors=no"))
       MC_(clo_avoid_strlen_errors) = False;
@@ -1515,8 +1510,6 @@ Char* SK_(usage)(void)
 "                              amount of bt merging in leak check [low]\n"
 "    --show-reachable=no|yes   show reachable blocks in leak check? [no]\n"
 "    --workaround-gcc296-bugs=no|yes  self explanatory [no]\n"
-"    --check-addrVs=no|yes     experimental lighterweight checking? [yes]\n"
-"                              yes == Valgrind's original behaviour\n"
 "\n"
 "    --cleanup=no|yes          improve after instrumentation? [yes]\n"
 "    --avoid-strlen-errors=no|yes  suppress errs from inlined strlen [yes]\n";
index 2c27fa7dd956ce2dc50dc55d171119aa039c685f..7d03b4e8f95aa891176ebb5b230052fb27641486 100644 (file)
@@ -580,16 +580,16 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
             really much point in doing the V-check too, unless you
             think that you might use addresses which are undefined but
             still addressible.  Hence the optionalisation of the V
-            check.
+            check.  15 Dec 02: optionalisation removed, since it no
+            longer makes much sense given we also have an addrcheck
+            skin.
 
             The LOADV/STOREV does an addressibility check for the
             address. */
 
          case LOAD: 
-            if (MC_(clo_check_addrVs)) {
-               uInstr1(cb, TESTV, 4, TempReg, SHADOW(u_in->val1));
-               uInstr1(cb, SETV,  4, TempReg, SHADOW(u_in->val1));
-            }
+            uInstr1(cb, TESTV, 4, TempReg, SHADOW(u_in->val1));
+            uInstr1(cb, SETV,  4, TempReg, SHADOW(u_in->val1));
             uInstr2(cb, LOADV, u_in->size, 
                         TempReg, u_in->val1,
                         TempReg, SHADOW(u_in->val2));
@@ -597,10 +597,8 @@ static UCodeBlock* memcheck_instrument ( UCodeBlock* cb_in )
             break;
 
          case STORE:
-            if (MC_(clo_check_addrVs)) {
-               uInstr1(cb, TESTV,  4, TempReg, SHADOW(u_in->val2));
-               uInstr1(cb, SETV,   4, TempReg, SHADOW(u_in->val2));
-            }
+            uInstr1(cb, TESTV,  4, TempReg, SHADOW(u_in->val2));
+            uInstr1(cb, SETV,   4, TempReg, SHADOW(u_in->val2));
             uInstr2(cb, STOREV, u_in->size,
                         TempReg, SHADOW(u_in->val1), 
                         TempReg, u_in->val2);
@@ -1151,36 +1149,36 @@ static void vg_delete_redundant_SETVs ( UCodeBlock* cb )
    for (i = VG_(get_num_instrs)(cb) - 1; i >= 0; i--) {
       u = VG_(get_instr)(cb, i);
 
-      /* If we're not checking address V bits, there will be a lot of
-         GETVs, TAG1s and TAG2s calculating values which are never
-         used.  These first three cases get rid of them. */
+      /* Occasionally there will be GETVs, TAG1s and TAG2s calculating
+         values which are never used.  These first three cases get rid
+         of them. */
 
       if (u->opcode == GETV && VGC_IS_SHADOW(u->val2) 
-                            && next_is_write[u->val2]
-                            && !MC_(clo_check_addrVs)) {
+                            && next_is_write[u->val2]) {
+         sk_assert(u->val2 < n_temps);
          VG_(new_NOP)(u);
          if (dis) 
             VG_(printf)("   at %2d: delete GETV\n", i);
       } else
 
       if (u->opcode == TAG1 && VGC_IS_SHADOW(u->val1) 
-                            && next_is_write[u->val1]
-                            && !MC_(clo_check_addrVs)) {
+                            && next_is_write[u->val1]) {
+         sk_assert(u->val1 < n_temps);
          VG_(new_NOP)(u);
          if (dis) 
             VG_(printf)("   at %2d: delete TAG1\n", i);
       } else
 
       if (u->opcode == TAG2 && VGC_IS_SHADOW(u->val2) 
-                            && next_is_write[u->val2]
-                            && !MC_(clo_check_addrVs)) {
+                            && next_is_write[u->val2]) {
+         sk_assert(u->val2 < n_temps);
          VG_(new_NOP)(u);
          if (dis) 
             VG_(printf)("   at %2d: delete TAG2\n", i);
       } else
 
-      /* We do the rest of these regardless of whether or not
-         addresses are V-checked. */
+      /* The bulk of the cleanup work of this function is done by
+         the code from here downwards. */
 
       if (u->opcode == MOV && VGC_IS_SHADOW(u->val2) 
                            && next_is_write[u->val2]) {