Commit 39637a44 by Bin Cheng Committed by Bin Cheng

re PR tree-optimization/81620 (ICE in is_inv_store_elimination_chain, at…

re PR tree-optimization/81620 (ICE in is_inv_store_elimination_chain, at tree-predcom.c:1651 with -O3)

	PR tree-optimization/81620
	* tree-predcom.c (add_ref_to_chain): Don't set has_max_use_after
	for store-store chain.

	gcc/testsuite
	* gcc.dg/tree-ssa/pr81620-1.c: New.
	* gcc.dg/tree-ssa/pr81620-2.c: New.

From-SVN: r250763
parent f9c5fe06
2017-08-01 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/81620
* tree-predcom.c (add_ref_to_chain): Don't set has_max_use_after
for store-store chain.
2017-08-01 Jakub Jelinek <jakub@redhat.com> 2017-08-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/81588 PR tree-optimization/81588
......
2017-08-01 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/81620
* gcc.dg/tree-ssa/pr81620-1.c: New.
* gcc.dg/tree-ssa/pr81620-2.c: New.
2017-08-01 Dominique d'Humieres <dominiq@lps.ens.fr> 2017-08-01 Dominique d'Humieres <dominiq@lps.ens.fr>
PR testsuite/53542 PR testsuite/53542
......
/* { dg-do run } */
/* { dg-options "-O3 -fno-tree-loop-vectorize -fdump-tree-pcom-details" } */
int a[7];
char b;
void abort (void);
int main() {
b = 4;
for (; b; b--) {
a[b] = b;
a[b + 2] = 1;
}
if (a[0] != 0 || a[1] != 1 || a[2] != 2
|| a[3] != 1 || a[4] != 1 || a[5] != 1 || a[6] != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "Store-stores chain" 1 "pcom" } } */
/* { dg-do run } */
/* { dg-options "-O3 -fno-tree-loop-vectorize -fdump-tree-pcom-details" } */
int a[200];
char b;
void abort (void);
int main() {
int i;
b = 100;
for (; b; b--) {
a[b] = 2;
a[b + 2] = 1;
}
if (a[0] != 0 || a[1] != 2 || a[2] != 2)
abort ();
for (i = 3; i < 103; i++)
if (a[i] != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "Store-stores chain" 1 "pcom" } } */
...@@ -1069,7 +1069,9 @@ add_ref_to_chain (chain_p chain, dref ref) ...@@ -1069,7 +1069,9 @@ add_ref_to_chain (chain_p chain, dref ref)
chain->has_max_use_after = false; chain->has_max_use_after = false;
} }
if (ref->distance == chain->length /* Don't set the flag for store-store chain since there is no use. */
if (chain->type != CT_STORE_STORE
&& ref->distance == chain->length
&& ref->pos > root->pos) && ref->pos > root->pos)
chain->has_max_use_after = true; chain->has_max_use_after = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment