aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-12-31 18:41:28 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-31 18:41:28 +0000
commit9c5c5f2cd1c780f85df07731c7e5547acce198db (patch)
treeca5892b65be66a80c4067e181a0309181e237a4f /gcc
parentd4de0221f3539de204f92443ca66a0e8b36de64b (diff)
downloadgcc-9c5c5f2cd1c780f85df07731c7e5547acce198db.zip
gcc-9c5c5f2cd1c780f85df07731c7e5547acce198db.tar.gz
gcc-9c5c5f2cd1c780f85df07731c7e5547acce198db.tar.bz2
c-common.c (c_expand_expr): Remove code to return a value different from that returned by expand_expr.
* c-common.c (c_expand_expr): Remove code to return a value different from that returned by expand_expr. * expr.c (store_expr): Use the validity of a target MEM, rather than checking DECL_RTL (exp), to figure out if a copy is required. From-SVN: r75273
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/c-common.c23
-rw-r--r--gcc/expr.c12
3 files changed, 20 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c747054..b27cd4c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-12-31 Mark Mitchell <mark@codesourcery.com>
+
+ * c-common.c (c_expand_expr): Remove code to return a value
+ different from that returned by expand_expr.
+ * expr.c (store_expr): Use the validity of a target MEM, rather
+ than checking DECL_RTL (exp), to figure out if a copy is
+ required.
+
2003-12-31 Kazu Hirata <kazu@cs.umass.edu>
* config/v850/lib1funcs.asm: Fix comment formatting.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 3ba73dd2..327a4dc 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -4064,7 +4064,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
tree rtl_expr;
rtx result;
bool preserve_result = false;
- bool return_target = false;
if (STMT_EXPR_WARN_UNUSED_RESULT (exp) && target == const0_rtx)
{
@@ -4112,20 +4111,10 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
if (TREE_CODE (last) == SCOPE_STMT
&& TREE_CODE (expr) == EXPR_STMT)
{
- if (target && TREE_CODE (EXPR_STMT_EXPR (expr)) == VAR_DECL
- && DECL_RTL_IF_SET (EXPR_STMT_EXPR (expr)) == target)
- /* If the last expression is a variable whose RTL is the
- same as our target, just return the target; if it
- isn't valid expanding the decl would produce different
- RTL, and store_expr would try to do a copy. */
- return_target = true;
- else
- {
- /* Otherwise, note that we want the value from the last
- expression. */
- TREE_ADDRESSABLE (expr) = 1;
- preserve_result = true;
- }
+ /* Otherwise, note that we want the value from the last
+ expression. */
+ TREE_ADDRESSABLE (expr) = 1;
+ preserve_result = true;
}
}
@@ -4133,9 +4122,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
expand_end_stmt_expr (rtl_expr);
result = expand_expr (rtl_expr, target, tmode, modifier);
- if (return_target)
- result = target;
- else if (preserve_result && GET_CODE (result) == MEM)
+ if (preserve_result && GET_CODE (result) == MEM)
{
if (GET_MODE (result) != BLKmode)
result = copy_to_reg (result);
diff --git a/gcc/expr.c b/gcc/expr.c
index 93ab7e0..a38dee1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4253,11 +4253,13 @@ store_expr (tree exp, rtx target, int want_value)
|| side_effects_p (target))))
&& TREE_CODE (exp) != ERROR_MARK
&& ! dont_store_target
- /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
- but TARGET is not valid memory reference, TEMP will differ
- from TARGET although it is really the same location. */
- && (TREE_CODE_CLASS (TREE_CODE (exp)) != 'd'
- || target != DECL_RTL_IF_SET (exp))
+ /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
+ but TARGET is not valid memory reference, TEMP will differ
+ from TARGET although it is really the same location. */
+ && !(GET_CODE (target) == MEM
+ && GET_CODE (XEXP (target, 0)) != QUEUED
+ && (!memory_address_p (GET_MODE (target), XEXP (target, 0))
+ || (flag_force_addr && !REG_P (XEXP (target, 0)))))
/* If there's nothing to copy, don't bother. Don't call expr_size
unless necessary, because some front-ends (C++) expr_size-hook
aborts on objects that are not supposed to be bit-copied or