Hi! During the first loop iteration, n is uninitialized, so testing n.base_addr is wrong. Testing (i == first ? this_n.base_addr : n.base_addr) is overkill, perform_symbolic_merge will fail if some iterations have base_addr set and others don't.
Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2017-11-21 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/83086 * gimple-ssa-store-merging.c (imm_store_chain_info::try_coalesce_bswap): Test this_n.base_addr rather than n.base_addr. --- gcc/gimple-ssa-store-merging.c.jj 2017-11-21 09:41:00.000000000 +0100 +++ gcc/gimple-ssa-store-merging.c 2017-11-21 12:13:23.346947756 +0100 @@ -2390,7 +2390,7 @@ imm_store_chain_info::try_coalesce_bswap ? try_size - info->bitsize - bitpos : bitpos)) return false; - if (n.base_addr && vuse_store) + if (this_n.base_addr && vuse_store) { unsigned int j; for (j = first; j <= last; ++j) Jakub