From 4403d99aef3dddbd11cb3d444b0febf2ea89eca9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 30 Oct 2017 17:20:24 +0100 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-store-merging.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dcef7ec7ec1..711458f428c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-10-30 Jakub Jelinek + + 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 * gimplify.c: Include memmodel.h. diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index fb68a815c87..5a5b776290a 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); } -- 2.30.2