Commit e836a5a2 by Kazu Hirata Committed by Kazu Hirata

expr.c (expand_assignment): Remove the last argument.

	* expr.c (expand_assignment): Remove the last argument.
	Change the return type to void.
	* expr.h: Update the prototype of expand_assignment.
	* function.c (assign_parm_setup_reg): Update a call to
	expand_assignment.
	* stmt.c (expand_asm_expr): Likewise.

From-SVN: r89275
parent 88e9994a
2004-10-19 Kazu Hirata <kazu@cs.umass.edu> 2004-10-19 Kazu Hirata <kazu@cs.umass.edu>
* expr.c (expand_assignment): Remove the last argument.
Change the return type to void.
* expr.h: Update the prototype of expand_assignment.
* function.c (assign_parm_setup_reg): Update a call to
expand_assignment.
* stmt.c (expand_asm_expr): Likewise.
2004-10-19 Kazu Hirata <kazu@cs.umass.edu>
* expr.c (expand_expr_real_1) <MODIFY_EXPR>: Remove * expr.c (expand_expr_real_1) <MODIFY_EXPR>: Remove
unnecessary assignments to temp. Return const0_rtx. unnecessary assignments to temp. Return const0_rtx.
......
...@@ -3405,13 +3405,10 @@ get_subtarget (rtx x) ...@@ -3405,13 +3405,10 @@ get_subtarget (rtx x)
? 0 : x); ? 0 : x);
} }
/* Expand an assignment that stores the value of FROM into TO. /* Expand an assignment that stores the value of FROM into TO. */
If WANT_VALUE is nonzero, return an rtx for the value of TO.
(If the value is constant, this rtx is a constant.)
Otherwise, the returned value is NULL_RTX. */
rtx void
expand_assignment (tree to, tree from, int want_value) expand_assignment (tree to, tree from)
{ {
rtx to_rtx = 0; rtx to_rtx = 0;
rtx result; rtx result;
...@@ -3421,7 +3418,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3421,7 +3418,7 @@ expand_assignment (tree to, tree from, int want_value)
if (TREE_CODE (to) == ERROR_MARK) if (TREE_CODE (to) == ERROR_MARK)
{ {
result = expand_expr (from, NULL_RTX, VOIDmode, 0); result = expand_expr (from, NULL_RTX, VOIDmode, 0);
return want_value ? result : NULL_RTX; return;
} }
/* Assignment of a structure component needs special treatment /* Assignment of a structure component needs special treatment
...@@ -3449,9 +3446,6 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3449,9 +3446,6 @@ expand_assignment (tree to, tree from, int want_value)
/* If we are going to use store_bit_field and extract_bit_field, /* If we are going to use store_bit_field and extract_bit_field,
make sure to_rtx will be safe for multiple use. */ make sure to_rtx will be safe for multiple use. */
if (mode1 == VOIDmode && want_value)
tem = stabilize_reference (tem);
orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0); orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0);
if (offset != 0) if (offset != 0)
...@@ -3513,7 +3507,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3513,7 +3507,7 @@ expand_assignment (tree to, tree from, int want_value)
} }
/* Optimize bitfld op= val in certain cases. */ /* Optimize bitfld op= val in certain cases. */
while (mode1 == VOIDmode && !want_value while (mode1 == VOIDmode
&& bitsize > 0 && bitsize < BITS_PER_WORD && bitsize > 0 && bitsize < BITS_PER_WORD
&& GET_MODE_BITSIZE (GET_MODE (to_rtx)) <= BITS_PER_WORD && GET_MODE_BITSIZE (GET_MODE (to_rtx)) <= BITS_PER_WORD
&& !TREE_SIDE_EFFECTS (to) && !TREE_SIDE_EFFECTS (to)
...@@ -3616,7 +3610,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3616,7 +3610,7 @@ expand_assignment (tree to, tree from, int want_value)
emit_move_insn (str_rtx, result); emit_move_insn (str_rtx, result);
free_temp_slots (); free_temp_slots ();
pop_temp_slots (); pop_temp_slots ();
return NULL_RTX; return;
default: default:
break; break;
...@@ -3626,11 +3620,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3626,11 +3620,7 @@ expand_assignment (tree to, tree from, int want_value)
} }
result = store_field (to_rtx, bitsize, bitpos, mode1, from, result = store_field (to_rtx, bitsize, bitpos, mode1, from,
(want_value VOIDmode,
/* Spurious cast for HPUX compiler. */
? ((enum machine_mode)
TYPE_MODE (TREE_TYPE (to)))
: VOIDmode),
unsignedp, TREE_TYPE (tem), get_alias_set (to)); unsignedp, TREE_TYPE (tem), get_alias_set (to));
preserve_temp_slots (result); preserve_temp_slots (result);
...@@ -3639,11 +3629,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3639,11 +3629,7 @@ expand_assignment (tree to, tree from, int want_value)
/* If the value is meaningful, convert RESULT to the proper mode. /* If the value is meaningful, convert RESULT to the proper mode.
Otherwise, return nothing. */ Otherwise, return nothing. */
return (want_value ? convert_modes (TYPE_MODE (TREE_TYPE (to)), return;
TYPE_MODE (TREE_TYPE (from)),
result,
TYPE_UNSIGNED (TREE_TYPE (to)))
: NULL_RTX);
} }
/* If the rhs is a function call and its value is not an aggregate, /* If the rhs is a function call and its value is not an aggregate,
...@@ -3684,7 +3670,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3684,7 +3670,7 @@ expand_assignment (tree to, tree from, int want_value)
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots (); pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return;
} }
/* Ordinary treatment. Expand TO to get a REG or MEM rtx. /* Ordinary treatment. Expand TO to get a REG or MEM rtx.
...@@ -3711,7 +3697,7 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3711,7 +3697,7 @@ expand_assignment (tree to, tree from, int want_value)
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots (); pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return;
} }
/* In case we are returning the contents of an object which overlaps /* In case we are returning the contents of an object which overlaps
...@@ -3737,17 +3723,17 @@ expand_assignment (tree to, tree from, int want_value) ...@@ -3737,17 +3723,17 @@ expand_assignment (tree to, tree from, int want_value)
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots (); pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return;
} }
/* Compute FROM and store the value in the rtx we got. */ /* Compute FROM and store the value in the rtx we got. */
push_temp_slots (); push_temp_slots ();
result = store_expr (from, to_rtx, want_value); result = store_expr (from, to_rtx, 0);
preserve_temp_slots (result); preserve_temp_slots (result);
free_temp_slots (); free_temp_slots ();
pop_temp_slots (); pop_temp_slots ();
return want_value ? result : NULL_RTX; return;
} }
/* Generate code for computing expression EXP, /* Generate code for computing expression EXP,
...@@ -4732,7 +4718,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4732,7 +4718,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
the loop. */ the loop. */
expand_assignment (index, expand_assignment (index,
build2 (PLUS_EXPR, TREE_TYPE (index), build2 (PLUS_EXPR, TREE_TYPE (index),
index, integer_one_node), 0); index, integer_one_node));
emit_jump (loop_start); emit_jump (loop_start);
...@@ -8093,14 +8079,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8093,14 +8079,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
expand_assignment (lhs, convert (TREE_TYPE (rhs), expand_assignment (lhs, convert (TREE_TYPE (rhs),
(TREE_CODE (rhs) == BIT_IOR_EXPR (TREE_CODE (rhs) == BIT_IOR_EXPR
? integer_one_node ? integer_one_node
: integer_zero_node)), : integer_zero_node)));
0);
do_pending_stack_adjust (); do_pending_stack_adjust ();
emit_label (label); emit_label (label);
return const0_rtx; return const0_rtx;
} }
expand_assignment (lhs, rhs, 0); expand_assignment (lhs, rhs);
return const0_rtx; return const0_rtx;
} }
......
...@@ -466,7 +466,7 @@ extern void emit_push_insn (rtx, enum machine_mode, tree, rtx, unsigned int, ...@@ -466,7 +466,7 @@ extern void emit_push_insn (rtx, enum machine_mode, tree, rtx, unsigned int,
int, rtx, int, rtx, rtx, int, rtx); int, rtx, int, rtx, rtx, int, rtx);
/* Expand an assignment that stores the value of FROM into TO. */ /* Expand an assignment that stores the value of FROM into TO. */
extern rtx expand_assignment (tree, tree, int); extern void expand_assignment (tree, tree);
/* Generate code for computing expression EXP, /* Generate code for computing expression EXP,
and storing the value into TARGET. and storing the value into TARGET.
......
...@@ -2730,7 +2730,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, ...@@ -2730,7 +2730,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
/* TREE_USED gets set erroneously during expand_assignment. */ /* TREE_USED gets set erroneously during expand_assignment. */
save_tree_used = TREE_USED (parm); save_tree_used = TREE_USED (parm);
expand_assignment (parm, make_tree (data->nominal_type, tempreg), 0); expand_assignment (parm, make_tree (data->nominal_type, tempreg));
TREE_USED (parm) = save_tree_used; TREE_USED (parm) = save_tree_used;
all->conversion_insns = get_insns (); all->conversion_insns = get_insns ();
end_sequence (); end_sequence ();
......
...@@ -1108,7 +1108,7 @@ expand_asm_expr (tree exp) ...@@ -1108,7 +1108,7 @@ expand_asm_expr (tree exp)
{ {
if (o[i] != TREE_VALUE (tail)) if (o[i] != TREE_VALUE (tail))
{ {
expand_assignment (o[i], TREE_VALUE (tail), 0); expand_assignment (o[i], TREE_VALUE (tail));
free_temp_slots (); free_temp_slots ();
/* Restore the original value so that it's correct the next /* Restore the original value so that it's correct the next
......
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