re PR tree-optimization/77808 (ICE in duplicate_ssa_name_ptr_info, at tree-ssanames.c:630 starting with r240439)

Fix PR tree-optimization/77808

gcc/
	PR tree-optimization/77808
	* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Check base_addr
	and addr are different before copying points-to information.

gcc/testsuite/
	PR tree-optimization/77808
	* gcc.dg/tree-ssa/pr77808.c: New testcase.

From-SVN: r240749
This commit is contained in:
Doug Gilmore 2016-10-04 15:28:23 +00:00 committed by Matthew Fortune
parent 9f06db14fa
commit fe8b1e839c
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-10-04 Doug Gilmore <doug.gilmore@imgtec.com>
PR tree-optimization/77808
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Check base_addr
and addr are different before copying points-to information.
2016-10-04 Uros Bizjak <ubizjak@gmail.com>
* config/i386/x86-tune.def (X86_TUNE_VECTORIZE_DOUBLE): Remove.

View File

@ -1,3 +1,8 @@
2016-10-04 Doug Gilmore <doug.gilmore@imgtec.com>
PR tree-optimization/77808
* gcc.dg/tree-ssa/pr77808.c: New testcase.
2016-10-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/77399

View File

@ -0,0 +1,11 @@
/* PR tree-optimization/77808 */
/* { dg-options "-O2 -fprefetch-loop-arrays --param prefetch-latency=0 -w" } */
void
daxpy(int n, double da, double * __restrict dx, double * __restrict dy)
{
int i;
for (i = 0;i < n; i++)
dy[i] = dy[i] + da*dx[i];
}

View File

@ -1162,7 +1162,8 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
NULL, true, GSI_SAME_STMT);
}
if (TREE_CODE (addr_base) == SSA_NAME
if (addr_base != addr
&& TREE_CODE (addr_base) == SSA_NAME
&& TREE_CODE (addr) == SSA_NAME)
{
duplicate_ssa_name_ptr_info (addr, SSA_NAME_PTR_INFO (addr_base));