Patchwork [2/7] Call recompute_tree_invariant_for_addr_expr when replacing a constant in an ADDR_EXPR.

login
register
mail settings
Submitter Sebastian Pop
Date Nov. 30, 2010, 2:50 p.m.
Message ID <1291128636-30240-3-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/73611/
State New
Headers show

Comments

Sebastian Pop - Nov. 30, 2010, 2:50 p.m.
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

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

	* sese.c (rename_uses): Call recompute_tree_invariant_for_addr_expr
	when replacing a constant in an ADDR_EXPR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@167058 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog          |    5 +++++
 gcc/ChangeLog.graphite |    5 +++++
 gcc/sese.c             |   13 +++++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3d6de3f..a9e0ddb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@ 
 2010-11-29  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* sese.c (rename_uses): Call recompute_tree_invariant_for_addr_expr
+	when replacing a constant in an ADDR_EXPR.
+
+2010-11-29  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-blocking.c (lst_do_strip_mine_loop): Extra parameter
 	for the stride.
 	(lst_do_strip_mine): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a205928..1746711 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@ 
+2010-11-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* sese.c (rename_uses): Call recompute_tree_invariant_for_addr_expr
+	when replacing a constant in an ADDR_EXPR.
+
 2010-10-20  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* graphite-blocking.c (lst_do_strip_mine_loop): Extra parameter
diff --git a/gcc/sese.c b/gcc/sese.c
index ffcb51c..dbb0cd7 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -547,6 +547,19 @@  rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
 				       true, NULL_TREE);
       gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
       replace_exp (use_p, new_expr);
+
+
+      if (TREE_CODE (new_expr) == INTEGER_CST)
+	{
+	  tree lhs = gimple_assign_lhs (copy);
+	  tree rhs = gimple_assign_rhs1 (copy);
+
+	  if (TREE_CODE (lhs) == ADDR_EXPR)
+	    recompute_tree_invariant_for_addr_expr (lhs);
+	  if (TREE_CODE (rhs) == ADDR_EXPR)
+	    recompute_tree_invariant_for_addr_expr (rhs);
+	}
+
       set_rename (rename_map, old_name, new_expr);
     }
 }