summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-09 15:14:19 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-09 15:14:19 +0000
commit28098b5b27c8ae922acb070f62b1307263f252a0 (patch)
treef1670e405d630798297d4ba21644fe965549d789
parentd6fb657696759c6af7d1055a8f6c06aa0b31d3f1 (diff)
downloadgcc-28098b5b27c8ae922acb070f62b1307263f252a0.tar.gz
* gimple.c (is_gimple_non_addressable): Remove.
* gimple.h: Remove is_gimple_non_addressable. * gimplify.c (gimplify_modify_expr_rhs): Use is_gimple_reg instead of is_gimple_non_addressable. * trans-mem.c (expand_assign_tm): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183015 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple.c11
-rw-r--r--gcc/gimple.h3
-rw-r--r--gcc/gimplify.c4
-rw-r--r--gcc/trans-mem.c2
5 files changed, 12 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1df29212233..202042abf5a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2012-01-09 Aldy Hernandez <aldyh@redhat.com>
+
+ * gimple.c (is_gimple_non_addressable): Remove.
+ * gimple.h: Remove is_gimple_non_addressable.
+ * gimplify.c (gimplify_modify_expr_rhs): Use is_gimple_reg instead of
+ is_gimple_non_addressable.
+ * trans-mem.c (expand_assign_tm): Same.
+
2012-01-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51775
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 1f8f1027128..9a6ed671f84 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2963,17 +2963,6 @@ is_gimple_reg (tree t)
}
-/* Return true if T is a GIMPLE variable whose address is not needed. */
-
-bool
-is_gimple_non_addressable (tree t)
-{
- if (TREE_CODE (t) == SSA_NAME)
- t = SSA_NAME_VAR (t);
-
- return (is_gimple_variable (t) && ! needs_to_live_in_memory (t));
-}
-
/* Return true if T is a GIMPLE rvalue, i.e. an identifier or a constant. */
bool
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 484d1a0b407..5283ca2e2d6 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1006,9 +1006,6 @@ extern bool is_gimple_mem_rhs (tree);
/* Returns true iff T is a valid if-statement condition. */
extern bool is_gimple_condexpr (tree);
-/* Returns true iff T is a variable that does not need to live in memory. */
-extern bool is_gimple_non_addressable (tree t);
-
/* Returns true iff T is a valid call address expression. */
extern bool is_gimple_call_addr (tree);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5f2cbf3c769..b3b047a7561 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4411,7 +4411,9 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p,
/* It's OK to use the target directly if it's being
initialized. */
use_target = true;
- else if (!is_gimple_non_addressable (*to_p))
+ else if (TREE_CODE (*to_p) != SSA_NAME
+ && (!is_gimple_variable (*to_p)
+ || needs_to_live_in_memory (*to_p)))
/* Don't use the original target if it's already addressable;
if its address escapes, and the called function uses the
NRV optimization, a conforming program could see *to_p
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 538d798a70d..bd4ce3933e6 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -2184,7 +2184,7 @@ expand_assign_tm (struct tm_region *region, gimple_stmt_iterator *gsi)
/* ??? Figure out if there's any possible overlap between the LHS
and the RHS and if not, use MEMCPY. */
- if (load_p && is_gimple_non_addressable (lhs))
+ if (load_p && is_gimple_reg (lhs))
{
tmp = create_tmp_var (TREE_TYPE (lhs), NULL);
lhs_addr = build_fold_addr_expr (tmp);