Fix PR42326: handle default definitions.

2010-03-02  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/42326
	* sese.c (name_defined_in_loop_p): Return false for default
	definitions.

	* gcc.dg/graphite/pr42326.c: New.

From-SVN: r157280
This commit is contained in:
Sebastian Pop 2010-03-08 17:48:55 +00:00 committed by Sebastian Pop
parent bd7742f8ef
commit 392c0ce1d7
3 changed files with 30 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2010-03-02 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42326
* sese.c (name_defined_in_loop_p): Return false for default
definitions.
* gcc.dg/graphite/pr42326.c: New.
2010-02-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify

View File

@ -1106,9 +1106,8 @@ get_false_edge_from_guard_bb (basic_block bb)
static bool
name_defined_in_loop_p (tree name, loop_p loop)
{
gimple stmt = SSA_NAME_DEF_STMT (name);
return (gimple_bb (stmt)->loop_father == loop);
return !SSA_NAME_IS_DEFAULT_DEF (name)
&& gimple_bb (SSA_NAME_DEF_STMT (name))->loop_father == loop;
}
/* Returns true when EXPR contains SSA_NAMEs defined in LOOP. */

View File

@ -0,0 +1,20 @@
/* { dg-options "-O1 -floop-parallelize-all" } */
double lagrange(const double x[],
const double y[],
long n,
double xval)
{
long i, j;
double yval = 0.;
for( i=0; i < n; i++ )
{
double l = 1.;
for( j=0; j < n; j++ )
if( i != j )
l *= (xval-x[j])/(x[i]-x[j]);
yval += y[i]*l;
}
return yval;
}