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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75273
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
tree rtl_expr;
rtx result;
bool preserve_result = false;
- bool return_target = false;
if (STMT_EXPR_WARN_UNUSED_RESULT (exp) && target == const0_rtx)
{
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;
}
}
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);
|| 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