re PR tree-optimization/78821 (GCC7: Copying whole 32 bits structure field by field...
authorJakub Jelinek <jakub@redhat.com>
Mon, 13 Nov 2017 10:26:13 +0000 (11:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 13 Nov 2017 10:26:13 +0000 (11:26 +0100)
commita6fbd15424044457d5c283e5fd2d0d1bb0dcfbb6
treec4644b84d36195da7ac02fcc2c2a4ac621c3a29f
parenta1b5dd18ae7e335058f2f096b54a251b19eb9d2d
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 (compatible_load_p): Don't require
that bit_not_p is the same.
(imm_store_chain_info::coalesce_immediate_stores): Likewise.
(split_group): Count precisely bit_not_p bits in each statement.
(invert_op): New function.
(imm_store_chain_info::output_merged_store): Use invert_op to
emit BIT_XOR_EXPR with a xor_mask instead of BIT_NOT_EXPR if some
but not all orig_stores have BIT_NOT_EXPR in the corresponding spots.

* gcc.dg/store_merging_15.c: New test.

From-SVN: r254679
gcc/ChangeLog
gcc/gimple-ssa-store-merging.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/store_merging_15.c [new file with mode: 0644]