re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field...
authorJakub Jelinek <jakub@redhat.com>
Wed, 8 Nov 2017 15:46:58 +0000 (16:46 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 8 Nov 2017 15:46:58 +0000 (16:46 +0100)
commit383ac8dc264dad7e173ad808e814e3c4b609dcab
treed8ee3fb831dd90541d0114b71ab2b990661f2d41
parenta14ab2c3467950ccaad000864164a62d24129dd5
re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field not optimised into copying whole 32 bits at once)

PR tree-optimization/78821
* gimple-ssa-store-merging.c (struct store_operand_info): Add bit_not_p
data member.
(store_operand_info::store_operand_info): Initialize it to false.
(pass_store_merging::terminate_all_aliasing_chains): Rewritten to use
ref_maybe_used_by_stmt_p and stmt_may_clobber_ref_p on lhs of each
store in the group, and if chain_info is non-NULL, to ignore altogether
that chain.
(compatible_load_p): Fail if bit_not_p does not match.
(imm_store_chain_info::output_merged_store): Handle bit_not_p loads.
(handled_load): Fill in bit_not_p.  Handle BIT_NOT_EXPR.
(pass_store_merging::process_store): Adjust
terminate_all_aliasing_chains calls to pass NULL in all current spots,
call terminate_all_aliasing_chains newly when adding a store into
a chain with non-NULL chain_info.

* gcc.dg/store_merging_2.c: Expect 3 store mergings instead of 2.
* gcc.dg/store_merging_13.c (f7, f8, f9, f10, f11, f12, f13): New
functions.
(main): Test also those.  Expect 13 store mergings instead of 6.
* gcc.dg/store_merging_14.c (f7, f8, f9): New functions.
(main): Test also those.  Expect 9 store mergings instead of 6.

From-SVN: r254536
gcc/ChangeLog
gcc/gimple-ssa-store-merging.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/store_merging_13.c
gcc/testsuite/gcc.dg/store_merging_14.c
gcc/testsuite/gcc.dg/store_merging_2.c