This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix a buglet in store merging (PR tree-optimization/83086)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Nov 2017 14:56:28 +0100
- Subject: [committed] Fix a buglet in store merging (PR tree-optimization/83086)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <jakub@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