PR tree-optimization/78821
commitc35548ce9b652e4877857aac7a196219dd967f56
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Nov 2017 15:46:58 +0000 (8 15:46 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Nov 2017 15:46:58 +0000 (8 15:46 +0000)
treed8ee3fb831dd90541d0114b71ab2b990661f2d41
parent3e3c72d45fd4d57d18e084100b5177c537a92adb
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254536 138bc75d-0d04-0410-961f-82ee72b054a4
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