aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-10-30 17:20:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-10-30 17:20:24 +0100
commit4403d99aef3dddbd11cb3d444b0febf2ea89eca9 (patch)
tree694ece5015c08fca7e5ec5585f7d24415357a5be /gcc
parent6b139f0d931c20d442eefdfb176b2c0dddd9ccfb (diff)
downloadgcc-4403d99aef3dddbd11cb3d444b0febf2ea89eca9.zip
gcc-4403d99aef3dddbd11cb3d444b0febf2ea89eca9.tar.gz
gcc-4403d99aef3dddbd11cb3d444b0febf2ea89eca9.tar.bz2
re PR middle-end/22141 (Missing optimization when storing structures)
PR middle-end/22141 * gimple-ssa-store-merging.c (merged_store_group::apply_stores): Fix arguments to clear_bit_region_be. From-SVN: r254228
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple-ssa-store-merging.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dcef7ec..711458f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index fb68a81..5a5b776 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -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);
}