Commit 0088fcb1 by Richard Kenner

(expand_assignment, expand_expr, do_jumps): Push and pop temp slots

around making new temp slots and freeing them.

From-SVN: r5524
parent 0eb20297
...@@ -2316,7 +2316,10 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2316,7 +2316,10 @@ expand_assignment (to, from, want_value, suggest_reg)
tree offset; tree offset;
int unsignedp; int unsignedp;
int volatilep = 0; int volatilep = 0;
tree tem = get_inner_reference (to, &bitsize, &bitpos, &offset, tree tem;
push_temp_slots ();
tem = get_inner_reference (to, &bitsize, &bitpos, &offset,
&mode1, &unsignedp, &volatilep); &mode1, &unsignedp, &volatilep);
/* 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,
...@@ -2359,6 +2362,7 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2359,6 +2362,7 @@ expand_assignment (to, from, want_value, suggest_reg)
int_size_in_bytes (TREE_TYPE (tem))); int_size_in_bytes (TREE_TYPE (tem)));
preserve_temp_slots (result); preserve_temp_slots (result);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
/* 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. */
...@@ -2376,12 +2380,16 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2376,12 +2380,16 @@ expand_assignment (to, from, want_value, suggest_reg)
requires loading up part of an address in a separate insn. */ requires loading up part of an address in a separate insn. */
if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from)) if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from))
{ {
rtx value = expand_expr (from, NULL_RTX, VOIDmode, 0); rtx value;
push_temp_slots ();
value = expand_expr (from, NULL_RTX, VOIDmode, 0);
if (to_rtx == 0) if (to_rtx == 0)
to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0); to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0);
emit_move_insn (to_rtx, value); emit_move_insn (to_rtx, value);
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return want_value ? to_rtx : NULL_RTX;
} }
...@@ -2394,10 +2402,14 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2394,10 +2402,14 @@ expand_assignment (to, from, want_value, suggest_reg)
/* Don't move directly into a return register. */ /* Don't move directly into a return register. */
if (TREE_CODE (to) == RESULT_DECL && GET_CODE (to_rtx) == REG) if (TREE_CODE (to) == RESULT_DECL && GET_CODE (to_rtx) == REG)
{ {
rtx temp = expand_expr (from, 0, GET_MODE (to_rtx), 0); rtx temp;
push_temp_slots ();
temp = expand_expr (from, 0, GET_MODE (to_rtx), 0);
emit_move_insn (to_rtx, temp); emit_move_insn (to_rtx, temp);
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return want_value ? to_rtx : NULL_RTX;
} }
...@@ -2408,8 +2420,11 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2408,8 +2420,11 @@ expand_assignment (to, from, want_value, suggest_reg)
&& current_function_returns_struct && current_function_returns_struct
&& !current_function_returns_pcc_struct) && !current_function_returns_pcc_struct)
{ {
rtx from_rtx = expand_expr (from, NULL_RTX, VOIDmode, 0); rtx from_rtx, size;
rtx size = expr_size (from);
push_temp_slots ();
from_rtx = expr_size (from);
size = expand_expr (from, NULL_RTX, VOIDmode, 0);
#ifdef TARGET_MEM_FUNCTIONS #ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcpy_libfunc, 0, emit_library_call (memcpy_libfunc, 0,
...@@ -2429,14 +2444,17 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -2429,14 +2444,17 @@ expand_assignment (to, from, want_value, suggest_reg)
preserve_temp_slots (to_rtx); preserve_temp_slots (to_rtx);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
return want_value ? to_rtx : NULL_RTX; return want_value ? to_rtx : NULL_RTX;
} }
/* 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 ();
result = store_expr (from, to_rtx, want_value); result = store_expr (from, to_rtx, want_value);
preserve_temp_slots (result); preserve_temp_slots (result);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
return want_value ? result : NULL_RTX; return want_value ? result : NULL_RTX;
} }
...@@ -3834,9 +3852,11 @@ expand_expr (exp, target, tmode, modifier) ...@@ -3834,9 +3852,11 @@ expand_expr (exp, target, tmode, modifier)
return const0_rtx; return const0_rtx;
case LOOP_EXPR: case LOOP_EXPR:
push_temp_slots ();
expand_start_loop (1); expand_start_loop (1);
expand_expr_stmt (TREE_OPERAND (exp, 0)); expand_expr_stmt (TREE_OPERAND (exp, 0));
expand_end_loop (); expand_end_loop ();
pop_temp_slots ();
return const0_rtx; return const0_rtx;
...@@ -8078,8 +8098,10 @@ do_jump (exp, if_false_label, if_true_label) ...@@ -8078,8 +8098,10 @@ do_jump (exp, if_false_label, if_true_label)
break; break;
case COMPOUND_EXPR: case COMPOUND_EXPR:
push_temp_slots ();
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0); expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
free_temp_slots (); free_temp_slots ();
pop_temp_slots ();
emit_queue (); emit_queue ();
do_pending_stack_adjust (); do_pending_stack_adjust ();
do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label);
...@@ -8251,8 +8273,6 @@ do_jump (exp, if_false_label, if_true_label) ...@@ -8251,8 +8273,6 @@ do_jump (exp, if_false_label, if_true_label)
else if (comparison) else if (comparison)
do_jump_for_compare (comparison, if_false_label, if_true_label); do_jump_for_compare (comparison, if_false_label, if_true_label);
free_temp_slots ();
if (drop_through_label) if (drop_through_label)
{ {
/* If do_jump produces code that might be jumped around, /* If do_jump produces code that might be jumped around,
......
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