This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/3] Call recompute_tree_invariant_for_addr_expr when replacing a constant in an ADDR_EXPR.


Committed to the graphite branch.

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.
---
 gcc/ChangeLog.graphite |    5 +++++
 gcc/sese.c             |   13 +++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c2da86f..e5df72e 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);
     }
 }
-- 
1.7.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]