[patch] Remove the last argument of expand_assignment.
Kazu Hirata
kazu@cs.umass.edu
Tue Oct 19 13:13:00 GMT 2004
Hi,
Attached is a patch to remove the last argument of
expand_assignment as it is always 0.
At the same time, the patch removes the return value of
expand_assignment as no caller looks at it.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
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.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.729
diff -u -p -r1.729 expr.c
--- expr.c 19 Oct 2004 12:51:05 -0000 1.729
+++ expr.c 19 Oct 2004 12:52:55 -0000
@@ -3405,13 +3405,10 @@ get_subtarget (rtx x)
? 0 : x);
}
-/* 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. */
+/* Expand an assignment that stores the value of FROM into TO. */
-rtx
-expand_assignment (tree to, tree from, int want_value)
+void
+expand_assignment (tree to, tree from)
{
rtx to_rtx = 0;
rtx result;
@@ -3421,7 +3418,7 @@ expand_assignment (tree to, tree from, i
if (TREE_CODE (to) == ERROR_MARK)
{
result = expand_expr (from, NULL_RTX, VOIDmode, 0);
- return want_value ? result : NULL_RTX;
+ return;
}
/* Assignment of a structure component needs special treatment
@@ -3449,9 +3446,6 @@ expand_assignment (tree to, tree from, i
/* If we are going to use store_bit_field and extract_bit_field,
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);
if (offset != 0)
@@ -3513,7 +3507,7 @@ expand_assignment (tree to, tree from, i
}
/* Optimize bitfld op= val in certain cases. */
- while (mode1 == VOIDmode && !want_value
+ while (mode1 == VOIDmode
&& bitsize > 0 && bitsize < BITS_PER_WORD
&& GET_MODE_BITSIZE (GET_MODE (to_rtx)) <= BITS_PER_WORD
&& !TREE_SIDE_EFFECTS (to)
@@ -3616,7 +3610,7 @@ expand_assignment (tree to, tree from, i
emit_move_insn (str_rtx, result);
free_temp_slots ();
pop_temp_slots ();
- return NULL_RTX;
+ return;
default:
break;
@@ -3626,11 +3620,7 @@ expand_assignment (tree to, tree from, i
}
result = store_field (to_rtx, bitsize, bitpos, mode1, from,
- (want_value
- /* Spurious cast for HPUX compiler. */
- ? ((enum machine_mode)
- TYPE_MODE (TREE_TYPE (to)))
- : VOIDmode),
+ VOIDmode,
unsignedp, TREE_TYPE (tem), get_alias_set (to));
preserve_temp_slots (result);
@@ -3639,11 +3629,7 @@ expand_assignment (tree to, tree from, i
/* If the value is meaningful, convert RESULT to the proper mode.
Otherwise, return nothing. */
- return (want_value ? convert_modes (TYPE_MODE (TREE_TYPE (to)),
- TYPE_MODE (TREE_TYPE (from)),
- result,
- TYPE_UNSIGNED (TREE_TYPE (to)))
- : NULL_RTX);
+ return;
}
/* If the rhs is a function call and its value is not an aggregate,
@@ -3684,7 +3670,7 @@ expand_assignment (tree to, tree from, i
preserve_temp_slots (to_rtx);
free_temp_slots ();
pop_temp_slots ();
- return want_value ? to_rtx : NULL_RTX;
+ return;
}
/* Ordinary treatment. Expand TO to get a REG or MEM rtx.
@@ -3711,7 +3697,7 @@ expand_assignment (tree to, tree from, i
preserve_temp_slots (to_rtx);
free_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
@@ -3737,17 +3723,17 @@ expand_assignment (tree to, tree from, i
preserve_temp_slots (to_rtx);
free_temp_slots ();
pop_temp_slots ();
- return want_value ? to_rtx : NULL_RTX;
+ return;
}
/* Compute FROM and store the value in the rtx we got. */
push_temp_slots ();
- result = store_expr (from, to_rtx, want_value);
+ result = store_expr (from, to_rtx, 0);
preserve_temp_slots (result);
free_temp_slots ();
pop_temp_slots ();
- return want_value ? result : NULL_RTX;
+ return;
}
/* Generate code for computing expression EXP,
@@ -4732,7 +4718,7 @@ store_constructor (tree exp, rtx target,
the loop. */
expand_assignment (index,
build2 (PLUS_EXPR, TREE_TYPE (index),
- index, integer_one_node), 0);
+ index, integer_one_node));
emit_jump (loop_start);
@@ -8093,14 +8079,13 @@ expand_expr_real_1 (tree exp, rtx target
expand_assignment (lhs, convert (TREE_TYPE (rhs),
(TREE_CODE (rhs) == BIT_IOR_EXPR
? integer_one_node
- : integer_zero_node)),
- 0);
+ : integer_zero_node)));
do_pending_stack_adjust ();
emit_label (label);
return const0_rtx;
}
- expand_assignment (lhs, rhs, 0);
+ expand_assignment (lhs, rhs);
return const0_rtx;
}
Index: expr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.h,v
retrieving revision 1.172
diff -u -p -r1.172 expr.h
--- expr.h 18 Oct 2004 22:06:36 -0000 1.172
+++ expr.h 19 Oct 2004 12:52:55 -0000
@@ -466,7 +466,7 @@ extern void emit_push_insn (rtx, enum ma
int, rtx, int, rtx, rtx, int, rtx);
/* 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,
and storing the value into TARGET.
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.583
diff -u -p -r1.583 function.c
--- function.c 13 Oct 2004 23:25:13 -0000 1.583
+++ function.c 19 Oct 2004 12:52:56 -0000
@@ -2730,7 +2730,7 @@ assign_parm_setup_reg (struct assign_par
/* TREE_USED gets set erroneously during expand_assignment. */
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;
all->conversion_insns = get_insns ();
end_sequence ();
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.399
diff -u -p -r1.399 stmt.c
--- stmt.c 14 Oct 2004 22:01:45 -0000 1.399
+++ stmt.c 19 Oct 2004 12:52:58 -0000
@@ -1108,7 +1108,7 @@ expand_asm_expr (tree exp)
{
if (o[i] != TREE_VALUE (tail))
{
- expand_assignment (o[i], TREE_VALUE (tail), 0);
+ expand_assignment (o[i], TREE_VALUE (tail));
free_temp_slots ();
/* Restore the original value so that it's correct the next
More information about the Gcc-patches
mailing list