Commit c3382979 by Sebastian Pop Committed by Sebastian Pop

Fix PR43097: rename only SSA_NAMEs.

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

	PR middle-end/43140
	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.

	* gfortran.dg/graphite/pr43097.f: New.

From-SVN: r156995
parent 13cd10a2
2010-02-22 Sebastian Pop <sebastian.pop@amd.com> 2010-02-22 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43140
* sese.c (get_rename): Assert that old_name is an SSA_NAME.
(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
* gfortran.dg/graphite/pr43097.f: New.
2010-02-22 Sebastian Pop <sebastian.pop@amd.com>
Manuel López-Ibáñez <manu@gcc.gnu.org> Manuel López-Ibáñez <manu@gcc.gnu.org>
PR middle-end/43140 PR middle-end/43140
......
...@@ -494,6 +494,7 @@ get_rename (htab_t map, tree old_name) ...@@ -494,6 +494,7 @@ get_rename (htab_t map, tree old_name)
struct rename_map_elt_s tmp; struct rename_map_elt_s tmp;
PTR *slot; PTR *slot;
gcc_assert (TREE_CODE (old_name) == SSA_NAME);
tmp.old_name = old_name; tmp.old_name = old_name;
slot = htab_find_slot (map, &tmp, NO_INSERT); slot = htab_find_slot (map, &tmp, NO_INSERT);
...@@ -658,14 +659,19 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_ ...@@ -658,14 +659,19 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES) FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{ {
tree use = USE_FROM_PTR (use_p); tree use = USE_FROM_PTR (use_p);
tree expr = get_rename (map, use); tree expr, type_use, type_expr;
tree type_use = TREE_TYPE (use);
tree type_expr = TREE_TYPE (expr);
gimple_seq stmts; gimple_seq stmts;
if (TREE_CODE (use) != SSA_NAME)
continue;
expr = get_rename (map, use);
if (use == expr) if (use == expr)
continue; continue;
type_use = TREE_TYPE (use);
type_expr = TREE_TYPE (expr);
if (type_use != type_expr if (type_use != type_expr
|| (TREE_CODE (expr) != SSA_NAME || (TREE_CODE (expr) != SSA_NAME
&& is_gimple_reg (use))) && is_gimple_reg (use)))
......
! { dg-options "-O2 -fgraphite-identity" }
subroutine foo (ldmx,ldmy,nx,ny,v)
implicit real*8 (a-h, o-z)
dimension v(5,ldmx,ldmy,*)
dimension tmat(5,5)
k = 2
do j = 2, ny-1
do i = 2, nx-1
do ip = 1, 4
do m = ip+1, 5
v(m,i,j,k) = v(m,i,j,k) * m
end do
end do
do m = 5, 1, -1
do l = m+1, 5
v(m,i,j,k) = v(l,i,j,k)
end do
v(m,i,j,k) = m
end do
end do
end do
return
end
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