Commit 9c5c5f2c by Mark Mitchell Committed by Mark Mitchell

c-common.c (c_expand_expr): Remove code to return a value different from that…

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
parent d4de0221
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> 2003-12-31 Kazu Hirata <kazu@cs.umass.edu>
* config/v850/lib1funcs.asm: Fix comment formatting. * config/v850/lib1funcs.asm: Fix comment formatting.
......
...@@ -4064,7 +4064,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier) ...@@ -4064,7 +4064,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
tree rtl_expr; tree rtl_expr;
rtx result; rtx result;
bool preserve_result = false; bool preserve_result = false;
bool return_target = false;
if (STMT_EXPR_WARN_UNUSED_RESULT (exp) && target == const0_rtx) 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) ...@@ -4112,20 +4111,10 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
if (TREE_CODE (last) == SCOPE_STMT if (TREE_CODE (last) == SCOPE_STMT
&& TREE_CODE (expr) == EXPR_STMT) && TREE_CODE (expr) == EXPR_STMT)
{ {
if (target && TREE_CODE (EXPR_STMT_EXPR (expr)) == VAR_DECL /* Otherwise, note that we want the value from the last
&& DECL_RTL_IF_SET (EXPR_STMT_EXPR (expr)) == target) expression. */
/* If the last expression is a variable whose RTL is the TREE_ADDRESSABLE (expr) = 1;
same as our target, just return the target; if it preserve_result = true;
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;
}
} }
} }
...@@ -4133,9 +4122,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier) ...@@ -4133,9 +4122,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
expand_end_stmt_expr (rtl_expr); expand_end_stmt_expr (rtl_expr);
result = expand_expr (rtl_expr, target, tmode, modifier); result = expand_expr (rtl_expr, target, tmode, modifier);
if (return_target) if (preserve_result && GET_CODE (result) == MEM)
result = target;
else if (preserve_result && GET_CODE (result) == MEM)
{ {
if (GET_MODE (result) != BLKmode) if (GET_MODE (result) != BLKmode)
result = copy_to_reg (result); result = copy_to_reg (result);
......
...@@ -4253,11 +4253,13 @@ store_expr (tree exp, rtx target, int want_value) ...@@ -4253,11 +4253,13 @@ store_expr (tree exp, rtx target, int want_value)
|| side_effects_p (target)))) || side_effects_p (target))))
&& TREE_CODE (exp) != ERROR_MARK && TREE_CODE (exp) != ERROR_MARK
&& ! dont_store_target && ! dont_store_target
/* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET, /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
but TARGET is not valid memory reference, TEMP will differ but TARGET is not valid memory reference, TEMP will differ
from TARGET although it is really the same location. */ from TARGET although it is really the same location. */
&& (TREE_CODE_CLASS (TREE_CODE (exp)) != 'd' && !(GET_CODE (target) == MEM
|| target != DECL_RTL_IF_SET (exp)) && 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 /* If there's nothing to copy, don't bother. Don't call expr_size
unless necessary, because some front-ends (C++) expr_size-hook unless necessary, because some front-ends (C++) expr_size-hook
aborts on objects that are not supposed to be bit-copied or aborts on objects that are not supposed to be bit-copied or
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment