Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from rewrite_cross_bb_phi_deps.

2010-06-24  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
	rewrite_close_phi_out_of_ssa.

	* gcc.dg/graphite/id-22.c: New.

From-SVN: r163130
This commit is contained in:
Sebastian Pop 2010-08-11 20:26:07 +00:00 committed by Sebastian Pop
parent f2c51113b7
commit aedede6630
5 changed files with 37 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
rewrite_close_phi_out_of_ssa.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.

View File

@ -1,3 +1,10 @@
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
rewrite_close_phi_out_of_ssa.
* gcc.dg/graphite/id-22.c: New.
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.

View File

@ -2361,8 +2361,12 @@ rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
if (gimple_code (use_stmt) == GIMPLE_PHI)
{
gimple_stmt_iterator si = gsi_for_stmt (use_stmt);
rewrite_phi_out_of_ssa (&si);
gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
if (scalar_close_phi_node_p (gsi_stmt (psi)))
rewrite_close_phi_out_of_ssa (&psi);
else
rewrite_phi_out_of_ssa (&psi);
}
}

View File

@ -1,3 +1,7 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* gcc.dg/graphite/id-22.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* gcc.dg/graphite/run-id-2.c: Call abort.

View File

@ -0,0 +1,15 @@
typedef float rvec[3];
float calc_similar_ind (int nind, rvec x[])
{
int i, j, d;
float m, tm, xd, rd;
for(j=0; j<nind; j++) {
i = x[j][0];
tm += m;
for(d=0 ; d<3; d++) {
xd = x[i][d] - x[i][d];
rd += m * xd;
}
}
return rd/tm;
}