Fix off-by-one error in previous commit
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 28 May 2020 17:29:42 +0000 (19:29 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 28 May 2020 17:31:56 +0000 (19:31 +0200)
The bitregion_end field points to the next bit after the region.

gcc/ChangeLog
* gimple-ssa-store-merging.c (merged_store_group::can_be_merged_into):
Fix off-by-one error.

gcc/gimple-ssa-store-merging.c

index 400a0010c343828550b5c81643a5260a0bbd16a2..3ab614148a742ff6558bd25b679595ddd4f48c24 100644 (file)
@@ -1874,7 +1874,7 @@ merged_store_group::can_be_merged_into (store_immediate_info *info)
          || stores[0]->rhs_code == BIT_INSERT_EXPR)
       && info->bitregion_start == stores[0]->bitregion_start
       && info->bitregion_end == stores[0]->bitregion_end
-      && info->bitregion_end - info->bitregion_start < MAX_FIXED_MODE_SIZE)
+      && info->bitregion_end - info->bitregion_start <= MAX_FIXED_MODE_SIZE)
     return true;
 
   if (stores[0]->rhs_code == MEM_REF
@@ -1882,7 +1882,7 @@ merged_store_group::can_be_merged_into (store_immediate_info *info)
          || info->rhs_code == BIT_INSERT_EXPR)
       && info->bitregion_start == stores[0]->bitregion_start
       && info->bitregion_end == stores[0]->bitregion_end
-      && info->bitregion_end - info->bitregion_start < MAX_FIXED_MODE_SIZE)
+      && info->bitregion_end - info->bitregion_start <= MAX_FIXED_MODE_SIZE)
     return true;
 
   return false;