https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78821
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Nov 13 10:26:13 2017 New Revision: 254679 URL: https://gcc.gnu.org/viewcvs?rev=254679&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/gcc.dg/store_merging_15.c Modified: trunk/gcc/ChangeLog trunk/gcc/gimple-ssa-store-merging.c trunk/gcc/testsuite/ChangeLog