summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/expr.c47
-rw-r--r--gcc/expr.h2
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/stmt.c2
5 files changed, 28 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 284cb61bc85..13d0ae467c8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
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
unnecessary assignments to temp. Return const0_rtx.
diff --git a/gcc/expr.c b/gcc/expr.c
index ffcf078916a..1309868b1e3 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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, int want_value)
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, int want_value)
/* 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, int want_value)
}
/* 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, int want_value)
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, int want_value)
}
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, int want_value)
/* 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, int want_value)
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, int want_value)
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, int want_value)
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, int cleared, HOST_WIDE_INT size)
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, enum machine_mode tmode,
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;
}
diff --git a/gcc/expr.h b/gcc/expr.h
index dc66239f240..54b04c2eb60 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -466,7 +466,7 @@ extern void emit_push_insn (rtx, enum machine_mode, tree, rtx, unsigned int,
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.
diff --git a/gcc/function.c b/gcc/function.c
index 8d6f8fb3586..d6fe2f5f4af 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2730,7 +2730,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
/* 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 ();
diff --git a/gcc/stmt.c b/gcc/stmt.c
index a9bb3e6682a..38646a35459 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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