diff mbox series

[committed] Fix a buglet in store merging (PR tree-optimization/83086)

Message ID 20171121135628.GX14653@tucnak
State New
Headers show
Series [committed] Fix a buglet in store merging (PR tree-optimization/83086) | expand

Commit Message

Jakub Jelinek Nov. 21, 2017, 1:56 p.m. UTC
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.


	Jakub
diff mbox series

Patch

--- 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)