[1/2] Fix off-by-one error in clear_bit_region in store merging (PR tree-optimization...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 8 Nov 2016 12:31:31 +0000 (12:31 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 8 Nov 2016 12:31:31 +0000 (12:31 +0000)
PR tree-optimization/78234
* gimple-ssa-store-merging.c (clear_bit_region): Fix off-by-one error
in start != 0 case.

From-SVN: r241962

gcc/ChangeLog
gcc/gimple-ssa-store-merging.c

index f06b68e856d6de9e54536701f7fe19f1e08a64cc..b4169edded38cb2ab4e437af7ec90f39115c002d 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-08  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR tree-optimization/78234
+       * gimple-ssa-store-merging.c (clear_bit_region): Fix off-by-one error
+       in start != 0 case.
+
 2016-11-08  Martin Liska  <mliska@suse.cz>
 
        PR testsuite/78242
index 57b855671dbbda59c206403ce3adb4acf65a3cad..727ed9fb6a24fe235daa3ceed1895a2ad78b09ca 100644 (file)
@@ -337,7 +337,7 @@ clear_bit_region (unsigned char *ptr, unsigned int start,
   else if (start != 0)
     {
       clear_bit_region (ptr, start, BITS_PER_UNIT - start);
-      clear_bit_region (ptr + 1, 0, len - (BITS_PER_UNIT - start) + 1);
+      clear_bit_region (ptr + 1, 0, len - (BITS_PER_UNIT - start));
     }
   /* Whole bytes need to be cleared.  */
   else if (start == 0 && len > BITS_PER_UNIT)