aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2009-05-06 18:27:10 +0400
committerAndrey Belevantsev <abel@gcc.gnu.org>2009-05-06 18:27:10 +0400
commitfff1894cd63f0bf02a87c2284a7ae60bc08c70fe (patch)
treef42b7e6ad28124b32fb513b6b602ef7474fb842e
parent700ae70ccd0670e450e76529e413cbb5e14c72f4 (diff)
downloadgcc-fff1894cd63f0bf02a87c2284a7ae60bc08c70fe.zip
gcc-fff1894cd63f0bf02a87c2284a7ae60bc08c70fe.tar.gz
gcc-fff1894cd63f0bf02a87c2284a7ae60bc08c70fe.tar.bz2
tree-ssa.c (execute_update_address_taken): Handle TARGET_MEM_REF when processing for not_regs_needed bitmap.
* tree-ssa.c (execute_update_address_taken): Handle TARGET_MEM_REF when processing for not_regs_needed bitmap. * gimple.c (walk_stmt_load_store_addr_ops): When visiting address, handle TARGET_MEM_REF in lhs. Check TMR_BASE for NULL while handling it for rhs. From-SVN: r147179
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple.c6
-rw-r--r--gcc/tree-ssa.c22
3 files changed, 28 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0594686..3593d74 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-06 Andrey Belevantsev <abel@ispras.ru>
+
+ * tree-ssa.c (execute_update_address_taken): Handle TARGET_MEM_REF
+ when processing for not_regs_needed bitmap.
+ * gimple.c (walk_stmt_load_store_addr_ops): When visiting address,
+ handle TARGET_MEM_REF in lhs. Check TMR_BASE for NULL while
+ handling it for rhs.
+
2009-05-06 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md ((unnamed inc/dec peephole): Use
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 6ea1470..d81c3f3 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3232,12 +3232,18 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data,
if (TREE_CODE (rhs) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
else if (TREE_CODE (rhs) == TARGET_MEM_REF
+ && TMR_BASE (rhs) != NULL_TREE
&& TREE_CODE (TMR_BASE (rhs)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (rhs), 0), data);
else if (TREE_CODE (rhs) == OBJ_TYPE_REF
&& TREE_CODE (OBJ_TYPE_REF_OBJECT (rhs)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (OBJ_TYPE_REF_OBJECT (rhs),
0), data);
+ lhs = gimple_assign_lhs (stmt);
+ if (TREE_CODE (lhs) == TARGET_MEM_REF
+ && TMR_BASE (lhs) != NULL_TREE
+ && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR)
+ ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), data);
}
if (visit_load)
{
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 10ec35b..10f8482 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1518,14 +1518,20 @@ execute_update_addresses_taken (bool do_optimize)
a local decl that requires not to be a gimple register. */
if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
{
- tree lhs = gimple_get_lhs (stmt);
- /* A plain decl does not need it set. */
- if (lhs && handled_component_p (lhs))
- {
- var = get_base_address (lhs);
- if (DECL_P (var))
- bitmap_set_bit (not_reg_needs, DECL_UID (var));
- }
+ tree lhs = gimple_get_lhs (stmt);
+
+ /* We may not rewrite TMR_SYMBOL to SSA. */
+ if (lhs && TREE_CODE (lhs) == TARGET_MEM_REF
+ && TMR_SYMBOL (lhs))
+ bitmap_set_bit (not_reg_needs, DECL_UID (TMR_SYMBOL (lhs)));
+
+ /* A plain decl does not need it set. */
+ else if (lhs && handled_component_p (lhs))
+ {
+ var = get_base_address (lhs);
+ if (DECL_P (var))
+ bitmap_set_bit (not_reg_needs, DECL_UID (var));
+ }
}
}