re PR middle-end/22141 (Missing optimization when storing structures)
authorJakub Jelinek <jakub@redhat.com>
Mon, 30 Oct 2017 16:20:24 +0000 (17:20 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 30 Oct 2017 16:20:24 +0000 (17:20 +0100)
PR middle-end/22141
* gimple-ssa-store-merging.c (merged_store_group::apply_stores): Fix
arguments to clear_bit_region_be.

From-SVN: r254228

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

index dcef7ec7ec15d34806bc4dc1df44661cd316ce6e..711458f428caf7c5eca987ec451a59548a7f981e 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/22141
+       * gimple-ssa-store-merging.c (merged_store_group::apply_stores): Fix
+       arguments to clear_bit_region_be.
+
 2017-10-30  Jim Wilson  <wilson@tuliptree.org>
 
        * gimplify.c: Include memmodel.h.
index fb68a815c87c92563b3ad07bc6b3de7545652f14..5a5b776290ac717c75c648454ed37a4d01672e95 100644 (file)
@@ -701,7 +701,9 @@ merged_store_group::apply_stores ()
        return false;
       unsigned char *m = mask + (pos_in_buffer / BITS_PER_UNIT);
       if (BYTES_BIG_ENDIAN)
-       clear_bit_region_be (m, pos_in_buffer % BITS_PER_UNIT, info->bitsize);
+       clear_bit_region_be (m, (BITS_PER_UNIT - 1
+                                - (pos_in_buffer % BITS_PER_UNIT)),
+                            info->bitsize);
       else
        clear_bit_region (m, pos_in_buffer % BITS_PER_UNIT, info->bitsize);
     }