+2012-05-29 Michael Matz <matz@suse.de>
+
+ * rtl.h (assign_stack_temp, assign_stack_temp_for_type,
+ assign_temp): Remove 'keep' argument.
+ (mark_temp_addr_taken): Remove prototype.
+ * tree.h (expand_decl): Remove prototype.
+ * function.c (struct temp_slot): Remove addr_taken and keep
+ member.
+ (assign_stack_temp_for_type) Don't initialize above, remove
+ keep argument.
+ (assign_stack_temp, assign_temp): Remove keep argument.
+ (mark_temp_addr_taken): Remove.
+ (preserve_temp_slots): Remove handling of addr_taken and keep
+ members.
+ (free_temp_slots): Ditto.
+ * expr.c (expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Remove
+ dead code.
+ * stmt.c (expand_asm_operands): Remove dead code.
+ (expand_decl): Remove.
+ * c-decl.c (finish_struct): Don't call expand_decl.
+ * builtins.c (expand_builtin_cexpi): Adjust calls to assign_temp
+ and assign_stack_temp.
+ * calls.c (save_fixed_argument_area, initialize_argument_information,
+ expand_call, emit_library_call_value_1, store_one_arg): Ditto.
+ * expmed.c (extract_bit_field_1): Ditto.
+ * expr.c (emit_group_load_1, emit_group_store,
+ copy_blkmode_from_reg, emit_push_insn, expand_assignment,
+ store_field, expand_constructor, expand_cond_expr_using_cmove,
+ expand_expr_real_2, expand_expr_real_1): Ditto.
+ * stmt.c (expand_asm_operands, expand_return): Ditto.
+
+ * function.c (pop_temp_slots): Call free_temp_slots.
+ * calls.c (store_one_arg): Don't call preserve_temp_slots or
+ free_temp_slots.
+ * expr.c (expand_assignment): Don't call free_temp_slots.
+
+ * config/arm/arm.c (neon_expand_vector_init): Ditto.
+ * config/i386/i386.c (ix86_expand_vector_set): Ditto.
+ (ix86_expand_vector_extract): Ditto.
+ * config/ia64/ia64.c (spill_xfmode_rfmode_operand,
+ ia64_expand_movxf_movrf): Ditto.
+ * config/mips/mips.c (mips_expand_vi_general): Ditto.
+ * config/mmix/mmix.md (floatdisf2, floatunsdisf2, truncdfsf2,
+ extendsfdf2): Ditto.
+ * config/rs6000/rs6000.c (rs6000_expand_vector_init,
+ rs6000_expand_vector_set, rs6000_expand_vector_extract,
+ rs6000_allocate_stack_temp): Ditto.
+ * config/rs6000/rs6000.md (fix_trunctfsi2_fprs): Ditto.
+ * config/sparc/sparc.c (emit_soft_tfmode_libcall,
+ sparc_emit_float_lib_cmp, sparc_emit_float_lib_cmp,
+ sparc_expand_vector_init): Ditto.
+
2012-05-29 Michael Matz <matz@suse.de>
* c-tree.h (c_expand_decl): Remove prototype.
else
gcc_unreachable ();
- op1 = assign_temp (TREE_TYPE (arg), 0, 1, 1);
- op2 = assign_temp (TREE_TYPE (arg), 0, 1, 1);
+ op1 = assign_temp (TREE_TYPE (arg), 1, 1);
+ op2 = assign_temp (TREE_TYPE (arg), 1, 1);
op1a = copy_addr_to_reg (XEXP (op1, 0));
op2a = copy_addr_to_reg (XEXP (op2, 0));
top1 = make_tree (build_pointer_type (TREE_TYPE (arg)), op1a);
if (c_dialect_objc ())
objc_check_decl (decl);
rest_of_decl_compilation (decl, toplevel, 0);
- if (!toplevel)
- expand_decl (decl);
}
}
C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t)) = 0;
set_mem_align (stack_area, PARM_BOUNDARY);
if (save_mode == BLKmode)
{
- save_area = assign_stack_temp (BLKmode, num_to_save, 0);
+ save_area = assign_stack_temp (BLKmode, num_to_save);
emit_block_move (validize_mem (save_area), stack_area,
GEN_INT (num_to_save), BLOCK_OP_CALL_PARM);
}
set_mem_attributes (copy, type, 1);
}
else
- copy = assign_temp (type, 0, 1, 0);
+ copy = assign_temp (type, 1, 0);
store_expr (args[i].tree_value, copy, 0, false);
/* For variable-sized objects, we must be called with a target
specified. If we were to allocate space on the stack here,
we would have no way of knowing when to free it. */
- rtx d = assign_temp (rettype, 0, 1, 1);
+ rtx d = assign_temp (rettype, 1, 1);
structure_value_addr = XEXP (d, 0);
target = 0;
}
(TYPE_QUALS (rettype)
| TYPE_QUAL_CONST));
- target = assign_temp (nt, 0, 1, 1);
+ target = assign_temp (nt, 1, 1);
}
if (! rtx_equal_p (target, valreg))
if (value != 0 && MEM_P (value))
mem_value = value;
else
- mem_value = assign_temp (tfom, 0, 1, 1);
+ mem_value = assign_temp (tfom, 1, 1);
#endif
/* This call returns a big structure. */
flags &= ~(ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE);
else
{
slot = assign_temp (lang_hooks.types.type_for_mode (mode, 0),
- 0, 1, 1);
+ 1, 1);
emit_move_insn (slot, val);
}
{
argvec[argnum].save_area
= assign_stack_temp (BLKmode,
- argvec[argnum].locate.size.constant,
- 0);
+ argvec[argnum].locate.size.constant
+ );
emit_block_move (validize_mem (argvec[argnum].save_area),
stack_area,
tree nt = build_qualified_type (ot, (TYPE_QUALS (ot)
| TYPE_QUAL_CONST));
- arg->save_area = assign_temp (nt, 0, 1, 1);
+ arg->save_area = assign_temp (nt, 1, 1);
preserve_temp_slots (arg->save_area);
emit_block_move (validize_mem (arg->save_area), stack_area,
GEN_INT (arg->locate.size.constant),
be deferred during the rest of the arguments. */
NO_DEFER_POP;
- /* Free any temporary slots made in processing this argument. Show
- that we might have taken the address of something and pushed that
- as an operand. */
- preserve_temp_slots (NULL_RTX);
- free_temp_slots ();
+ /* Free any temporary slots made in processing this argument. */
pop_temp_slots ();
return sibcall_failure;
/* Construct the vector in memory one field at a time
and load the whole vector. */
- mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
for (i = 0; i < n_elts; i++)
emit_move_insn (adjust_address_nv (mem, inner_mode,
i * GET_MODE_SIZE (inner_mode)),
}
else
{
- rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), false);
+ rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
emit_move_insn (mem, target);
}
else
{
- rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), false);
+ rtx mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
emit_move_insn (mem, vec);
&& GET_MODE (SUBREG_REG (in)) == TImode
&& GET_CODE (SUBREG_REG (in)) == REG)
{
- rtx memt = assign_stack_temp (TImode, 16, 0);
+ rtx memt = assign_stack_temp (TImode, 16);
emit_move_insn (memt, SUBREG_REG (in));
return adjust_address (memt, mode, 0);
}
else if (force && GET_CODE (in) == REG)
{
- rtx memx = assign_stack_temp (mode, 16, 0);
+ rtx memx = assign_stack_temp (mode, 16);
emit_move_insn (memx, in);
return memx;
}
memt = adjust_address (in, TImode, 0);
else
{
- memt = assign_stack_temp (TImode, 16, 0);
+ memt = assign_stack_temp (TImode, 16);
memx = adjust_address (memt, mode, 0);
emit_move_insn (memx, in);
}
mips_expand_vi_general (enum machine_mode vmode, enum machine_mode imode,
unsigned nelt, unsigned nvar, rtx target, rtx vals)
{
- rtx mem = assign_stack_temp (vmode, GET_MODE_SIZE (vmode), 0);
+ rtx mem = assign_stack_temp (vmode, GET_MODE_SIZE (vmode));
unsigned int i, isize = GET_MODE_SIZE (imode);
if (nvar < nelt)
better way. */
stack_slot
= validize_mem (assign_stack_temp (SFmode,
- GET_MODE_SIZE (SFmode), 0));
+ GET_MODE_SIZE (SFmode)));
emit_insn (gen_floatdisf2 (stack_slot, operands[1]));
emit_move_insn (operands[0], stack_slot);
DONE;
way. */
stack_slot
= validize_mem (assign_stack_temp (SFmode,
- GET_MODE_SIZE (SFmode), 0));
+ GET_MODE_SIZE (SFmode)));
emit_insn (gen_floatunsdisf2 (stack_slot, operands[1]));
emit_move_insn (operands[0], stack_slot);
DONE;
way. */
stack_slot
= validize_mem (assign_stack_temp (SFmode,
- GET_MODE_SIZE (SFmode), 0));
+ GET_MODE_SIZE (SFmode)));
emit_insn (gen_truncdfsf2 (stack_slot, operands[1]));
emit_move_insn (operands[0], stack_slot);
DONE;
better way. */
stack_slot
= validize_mem (assign_stack_temp (SFmode,
- GET_MODE_SIZE (SFmode), 0));
+ GET_MODE_SIZE (SFmode)));
emit_move_insn (stack_slot, operands[1]);
emit_insn (gen_extendsfdf2 (operands[0], stack_slot));
DONE;
of 64-bit items is not supported on Altivec. */
if (all_same && GET_MODE_SIZE (inner_mode) <= 4)
{
- mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode));
emit_move_insn (adjust_address_nv (mem, inner_mode, 0),
XVECEXP (vals, 0, 0));
x = gen_rtx_UNSPEC (VOIDmode,
/* Construct the vector in memory one field at a time
and load the whole vector. */
- mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
for (i = 0; i < n_elts; i++)
emit_move_insn (adjust_address_nv (mem, inner_mode,
i * GET_MODE_SIZE (inner_mode)),
}
/* Load single variable value. */
- mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (inner_mode));
emit_move_insn (adjust_address_nv (mem, inner_mode, 0), val);
x = gen_rtx_UNSPEC (VOIDmode,
gen_rtvec (1, const0_rtx), UNSPEC_LVE);
}
/* Allocate mode-sized buffer. */
- mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
emit_move_insn (mem, vec);
bool offsettable_p,
bool reg_reg_p)
{
- rtx stack = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
+ rtx stack = assign_stack_temp (mode, GET_MODE_SIZE (mode));
rtx addr = XEXP (stack, 0);
int strict_p = (reload_in_progress || reload_completed);
operands[2] = gen_reg_rtx (DFmode);
operands[3] = gen_reg_rtx (DFmode);
operands[4] = gen_reg_rtx (DImode);
- operands[5] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
+ operands[5] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode));
})
(define_insn_and_split "*fix_trunctfsi2_internal"
lab_false = create_artificial_label (UNKNOWN_LOCATION);
lab_over = create_artificial_label (UNKNOWN_LOCATION);
addr = create_tmp_var (ptr_type_node, "addr");
+ mark_sym_for_renaming (addr);
t = fold_convert (TREE_TYPE (reg), size_int (max_reg));
t = build2 (GT_EXPR, boolean_type_node, reg, t);
}
else
{
- this_slot = assign_stack_temp (TFmode, GET_MODE_SIZE (TFmode), 0);
+ this_slot = assign_stack_temp (TFmode, GET_MODE_SIZE (TFmode));
/* Operand 0 is the return value. We'll copy it out later. */
if (i > 0)
}
else
{
- slot0 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0);
+ slot0 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode));
emit_move_insn (slot0, x);
}
}
else
{
- slot1 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0);
+ slot1 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode));
emit_move_insn (slot1, y);
}
}
}
- mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
+ mem = assign_stack_temp (mode, GET_MODE_SIZE (mode));
for (i = 0; i < n_elts; i++)
emit_move_insn (adjust_address_nv (mem, inner_mode,
i * GET_MODE_SIZE (inner_mode)),
else
{
rtx mem = assign_stack_temp (GET_MODE (op0),
- GET_MODE_SIZE (GET_MODE (op0)), 0);
+ GET_MODE_SIZE (GET_MODE (op0)));
emit_move_insn (mem, op0);
op0 = adjust_address (mem, BLKmode, 0);
}
{
enum machine_mode imode = int_mode_for_mode (GET_MODE (orig_src));
if (imode == BLKmode)
- src = assign_stack_temp (GET_MODE (orig_src), ssize, 0);
+ src = assign_stack_temp (GET_MODE (orig_src), ssize);
else
src = gen_reg_rtx (imode);
if (imode != BLKmode)
rtx mem;
gcc_assert (!bytepos);
- mem = assign_stack_temp (GET_MODE (src), slen, 0);
+ mem = assign_stack_temp (GET_MODE (src), slen);
emit_move_insn (mem, src);
tmps[i] = extract_bit_field (mem, bytelen * BITS_PER_UNIT,
0, 1, false, NULL_RTX, mode, mode);
int slen = GET_MODE_SIZE (GET_MODE (src));
rtx mem;
- mem = assign_stack_temp (GET_MODE (src), slen, 0);
+ mem = assign_stack_temp (GET_MODE (src), slen);
emit_move_insn (mem, src);
tmps[i] = adjust_address (mem, mode, (int) bytepos);
}
{
enum machine_mode imode = int_mode_for_mode (GET_MODE (orig_dst));
if (imode == BLKmode)
- dst = assign_stack_temp (GET_MODE (orig_dst), ssize, 0);
+ dst = assign_stack_temp (GET_MODE (orig_dst), ssize);
else
dst = gen_reg_rtx (imode);
emit_group_store (dst, src, type, ssize);
it. Allocate a temporary, and split this into a store/load to/from
the temporary. */
- temp = assign_stack_temp (GET_MODE (dst), ssize, 0);
+ temp = assign_stack_temp (GET_MODE (dst), ssize);
emit_group_store (temp, src, type, ssize);
emit_group_load (dst, temp, type, ssize);
return;
>= GET_MODE_ALIGNMENT (tmp_mode))
{
dest = assign_stack_temp (dest_mode,
- GET_MODE_SIZE (dest_mode),
- 0);
+ GET_MODE_SIZE (dest_mode));
emit_move_insn (adjust_address (dest,
tmp_mode,
bytepos),
else
{
dest = assign_stack_temp (tmp_mode,
- GET_MODE_SIZE (tmp_mode),
- 0);
+ GET_MODE_SIZE (tmp_mode));
emit_move_insn (dest, tmps[i]);
dst = adjust_address (dest, dest_mode, bytepos);
}
tgtblk = assign_temp (build_qualified_type (type,
(TYPE_QUALS (type)
| TYPE_QUAL_CONST)),
- 0, 1, 1);
+ 1, 1);
preserve_temp_slots (tgtblk);
}
size = GEN_INT (GET_MODE_SIZE (mode));
if (!MEM_P (xinner))
{
- temp = assign_temp (type, 0, 1, 1);
+ temp = assign_temp (type, 1, 1);
emit_move_insn (temp, xinner);
xinner = temp;
}
else
{
rtx temp = assign_stack_temp (GET_MODE (to_rtx),
- GET_MODE_SIZE (GET_MODE (to_rtx)),
- 0);
+ GET_MODE_SIZE (GET_MODE (to_rtx)));
write_complex_part (temp, XEXP (to_rtx, 0), false);
write_complex_part (temp, XEXP (to_rtx, 1), true);
result = store_field (temp, bitsize, bitpos,
if (result)
preserve_temp_slots (result);
- free_temp_slots ();
pop_temp_slots ();
return;
}
emit_move_insn (to_rtx, value);
}
preserve_temp_slots (to_rtx);
- free_temp_slots ();
pop_temp_slots ();
return;
}
emit_move_insn (to_rtx, temp);
preserve_temp_slots (to_rtx);
- free_temp_slots ();
pop_temp_slots ();
return;
}
TYPE_MODE (sizetype));
preserve_temp_slots (to_rtx);
- free_temp_slots ();
pop_temp_slots ();
return;
}
push_temp_slots ();
result = store_expr (from, to_rtx, 0, nontemporal);
preserve_temp_slots (result);
- free_temp_slots ();
pop_temp_slots ();
return;
}
if (mode == BLKmode
&& (REG_P (target) || GET_CODE (target) == SUBREG))
{
- rtx object = assign_temp (type, 0, 1, 1);
+ rtx object = assign_temp (type, 1, 1);
rtx blk_object = adjust_address (object, BLKmode, 0);
if (bitsize != (HOST_WIDE_INT) GET_MODE_BITSIZE (GET_MODE (target)))
= assign_temp (build_qualified_type (type, (TYPE_QUALS (type)
| (TREE_READONLY (exp)
* TYPE_QUAL_CONST))),
- 0, TREE_ADDRESSABLE (exp), 1);
+ TREE_ADDRESSABLE (exp), 1);
}
store_constructor (exp, target, 0, int_expr_size (exp));
int unsignedp = TYPE_UNSIGNED (type);
enum machine_mode mode = TYPE_MODE (type);
- temp = assign_temp (type, 0, 0, 1);
+ temp = assign_temp (type, 0, 1);
/* If we cannot do a conditional move on the mode, try doing it
with the promoted mode. */
if (TYPE_MODE (type) != BLKmode)
target = gen_reg_rtx (TYPE_MODE (type));
else
- target = assign_temp (type, 0, 1, 1);
+ target = assign_temp (type, 1, 1);
}
if (MEM_P (target))
&& !MEM_P (original_target))
temp = original_target;
else
- temp = assign_temp (type, 0, 0, 1);
+ temp = assign_temp (type, 0, 1);
do_pending_stack_adjust ();
NO_DEFER_POP;
/* This is the case of an array whose size is to be determined
from its initializer, while the initializer is still being parsed.
- See expand_decl. */
+ ??? We aren't parsing while expanding anymore. */
if (MEM_P (decl_rtl) && REG_P (XEXP (decl_rtl, 0)))
temp = validize_mem (decl_rtl);
else
{
temp = assign_stack_temp (DECL_MODE (base),
- GET_MODE_SIZE (DECL_MODE (base)),
- 0);
+ GET_MODE_SIZE (DECL_MODE (base)));
store_expr (base, temp, 0, false);
temp = adjust_address (temp, BLKmode, offset);
set_mem_size (temp, int_size_in_bytes (TREE_TYPE (exp)));
tree nt = build_qualified_type (TREE_TYPE (tem),
(TYPE_QUALS (TREE_TYPE (tem))
| TYPE_QUAL_CONST));
- memloc = assign_temp (nt, 0, 1, 1);
+ memloc = assign_temp (nt, 1, 1);
emit_move_insn (memloc, op0);
op0 = memloc;
mem_attrs_from_type = true;
if (ext_mode == BLKmode)
{
if (target == 0)
- target = assign_temp (type, 0, 1, 1);
+ target = assign_temp (type, 1, 1);
if (bitsize == 0)
return target;
new_rtx = assign_stack_temp_for_type (ext_mode,
GET_MODE_BITSIZE (ext_mode),
- 0, type);
+ type);
emit_move_insn (new_rtx, op0);
op0 = copy_rtx (new_rtx);
PUT_MODE (op0, BLKmode);
target
= assign_stack_temp_for_type
(TYPE_MODE (inner_type),
- GET_MODE_SIZE (TYPE_MODE (inner_type)), 0, inner_type);
+ GET_MODE_SIZE (TYPE_MODE (inner_type)), inner_type);
emit_move_insn (target, op0);
op0 = target;
= MAX (int_size_in_bytes (inner_type),
(HOST_WIDE_INT) GET_MODE_SIZE (mode));
rtx new_rtx
- = assign_stack_temp_for_type (mode, temp_size, 0, type);
+ = assign_stack_temp_for_type (mode, temp_size, type);
rtx new_with_op0_mode
= adjust_address (new_rtx, GET_MODE (op0), 0);
return expand_expr_real (treeop0, original_target, tmode,
modifier, alt_rtl);
-#if 0
- {
- /* Initialize the anonymous variable declared in the compound
- literal, then return the variable. */
- tree decl = COMPOUND_LITERAL_EXPR_DECL (exp);
-
- /* Create RTL for this variable. */
- if (!DECL_RTL_SET_P (decl))
- {
- if (DECL_HARD_REGISTER (decl))
- /* The user specified an assembler name for this variable.
- Set that up now. */
- rest_of_decl_compilation (decl, 0, 0);
- else
- expand_decl (decl);
- }
-
- return expand_expr_real (decl, original_target, tmode,
- modifier, alt_rtl);
- }
-#endif
-
default:
return expand_expr_real_2 (&ops, target, tmode, modifier);
}
return assign_stack_local_1 (mode, size, align, ASLK_RECORD_PAD);
}
\f
-\f
/* In order to evaluate some expressions, such as function calls returning
structures in memory, we need to temporarily allocate stack locations.
We record each allocated temporary in the following structure.
result could be in a temporary, we preserve it if we can determine which
one it is in. If we cannot determine which temporary may contain the
result, all temporaries are preserved. A temporary is preserved by
- pretending it was allocated at the previous nesting level.
-
- Automatic variables are also assigned temporary slots, at the nesting
- level where they are defined. They are marked a "kept" so that
- free_temp_slots will not free them. */
+ pretending it was allocated at the previous nesting level. */
struct GTY(()) temp_slot {
/* Points to next temporary slot. */
unsigned int align;
/* Nonzero if this temporary is currently in use. */
char in_use;
- /* Nonzero if this temporary has its address taken. */
- char addr_taken;
/* Nesting level at which this slot is being used. */
int level;
- /* Nonzero if this should survive a call to free_temp_slots. */
- int keep;
/* The offset of the slot from the frame_pointer, including extra space
for alignment. This info is for combine_temp_slots. */
HOST_WIDE_INT base_offset;
SIZE is the size in units of the space required. We do no rounding here
since assign_stack_local will do any required rounding.
- KEEP is 1 if this slot is to be retained after a call to
- free_temp_slots. Automatic variables for a block are allocated
- with this flag. KEEP values of 2 or 3 were needed respectively
- for variables whose lifetime is controlled by CLEANUP_POINT_EXPRs
- or for SAVE_EXPRs, but they are now unused.
-
TYPE is the type that will be used for the stack slot. */
rtx
assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size,
- int keep, tree type)
+ tree type)
{
unsigned int align;
struct temp_slot *p, *best_p = 0, *selected = NULL, **pp;
of a variable size. */
gcc_assert (size != -1);
- /* These are now unused. */
- gcc_assert (keep <= 1);
-
align = get_stack_local_alignment (type, mode);
/* Try to find an available, already-allocated temporary of the proper
if (best_p->size - rounded_size >= alignment)
{
p = ggc_alloc_temp_slot ();
- p->in_use = p->addr_taken = 0;
+ p->in_use = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
p->full_size = best_p->full_size - rounded_size;
p = selected;
p->in_use = 1;
- p->addr_taken = 0;
p->type = type;
p->level = temp_slot_level;
- p->keep = keep;
pp = temp_slots_at_level (p->level);
insert_slot_to_list (p, pp);
}
/* Allocate a temporary stack slot and record it for possible later
- reuse. First three arguments are same as in preceding function. */
+ reuse. First two arguments are same as in preceding function. */
rtx
-assign_stack_temp (enum machine_mode mode, HOST_WIDE_INT size, int keep)
+assign_stack_temp (enum machine_mode mode, HOST_WIDE_INT size)
{
- return assign_stack_temp_for_type (mode, size, keep, NULL_TREE);
+ return assign_stack_temp_for_type (mode, size, NULL_TREE);
}
\f
/* Assign a temporary.
If TYPE_OR_DECL is a decl, then we are doing it on behalf of the decl
and so that should be used in error messages. In either case, we
allocate of the given type.
- KEEP is as for assign_stack_temp.
MEMORY_REQUIRED is 1 if the result must be addressable stack memory;
it is 0 if a register is OK.
DONT_PROMOTE is 1 if we should not promote values in register
to wider modes. */
rtx
-assign_temp (tree type_or_decl, int keep, int memory_required,
+assign_temp (tree type_or_decl, int memory_required,
int dont_promote ATTRIBUTE_UNUSED)
{
tree type, decl;
size = 1;
}
- tmp = assign_stack_temp_for_type (mode, size, keep, type);
+ tmp = assign_stack_temp_for_type (mode, size, type);
return tmp;
}
insert_temp_slot_address (new_rtx, p);
}
-/* If X could be a reference to a temporary slot, mark the fact that its
- address was taken. */
-
-void
-mark_temp_addr_taken (rtx x)
-{
- struct temp_slot *p;
-
- if (x == 0)
- return;
-
- /* If X is not in memory or is at a constant address, it cannot be in
- a temporary slot. */
- if (!MEM_P (x) || CONSTANT_P (XEXP (x, 0)))
- return;
-
- p = find_temp_slot_from_address (XEXP (x, 0));
- if (p != 0)
- p->addr_taken = 1;
-}
-
/* If X could be a reference to a temporary slot, mark that slot as
belonging to the to one level higher than the current level. If X
matched one of our slots, just mark that one. Otherwise, we can't
- easily predict which it is, so upgrade all of them. Kept slots
- need not be touched.
+ easily predict which it is, so upgrade all of them.
This is called when an ({...}) construct occurs and a statement
returns a value in memory. */
{
struct temp_slot *p = 0, *next;
- /* If there is no result, we still might have some objects whose address
- were taken, so we need to make sure they stay around. */
if (x == 0)
- {
- for (p = *temp_slots_at_level (temp_slot_level); p; p = next)
- {
- next = p->next;
-
- if (p->addr_taken)
- move_slot_to_level (p, temp_slot_level - 1);
- }
-
- return;
- }
+ return;
/* If X is a register that is being used as a pointer, see if we have
- a temporary slot we know it points to. To be consistent with
- the code below, we really should preserve all non-kept slots
- if we can't find a match, but that seems to be much too costly. */
+ a temporary slot we know it points to. */
if (REG_P (x) && REG_POINTER (x))
p = find_temp_slot_from_address (x);
/* If X is not in memory or is at a constant address, it cannot be in
- a temporary slot, but it can contain something whose address was
- taken. */
+ a temporary slot. */
if (p == 0 && (!MEM_P (x) || CONSTANT_P (XEXP (x, 0))))
- {
- for (p = *temp_slots_at_level (temp_slot_level); p; p = next)
- {
- next = p->next;
-
- if (p->addr_taken)
- move_slot_to_level (p, temp_slot_level - 1);
- }
-
- return;
- }
+ return;
/* First see if we can find a match. */
if (p == 0)
if (p != 0)
{
- /* Move everything at our level whose address was taken to our new
- level in case we used its address. */
- struct temp_slot *q;
-
if (p->level == temp_slot_level)
- {
- for (q = *temp_slots_at_level (temp_slot_level); q; q = next)
- {
- next = q->next;
-
- if (p != q && q->addr_taken)
- move_slot_to_level (q, temp_slot_level - 1);
- }
-
- move_slot_to_level (p, temp_slot_level - 1);
- p->addr_taken = 0;
- }
+ move_slot_to_level (p, temp_slot_level - 1);
return;
}
for (p = *temp_slots_at_level (temp_slot_level); p; p = next)
{
next = p->next;
-
- if (!p->keep)
- move_slot_to_level (p, temp_slot_level - 1);
+ move_slot_to_level (p, temp_slot_level - 1);
}
}
for (p = *temp_slots_at_level (temp_slot_level); p; p = next)
{
next = p->next;
-
- if (!p->keep)
- {
- make_slot_available (p);
- some_available = true;
- }
+ make_slot_available (p);
+ some_available = true;
}
if (some_available)
void
pop_temp_slots (void)
{
- struct temp_slot *p, *next;
- bool some_available = false;
-
- for (p = *temp_slots_at_level (temp_slot_level); p; p = next)
- {
- next = p->next;
- make_slot_available (p);
- some_available = true;
- }
-
- if (some_available)
- {
- remove_unused_temp_slot_addresses ();
- combine_temp_slots ();
- }
-
+ free_temp_slots ();
temp_slot_level--;
}
#define ASLK_REDUCE_ALIGN 1
#define ASLK_RECORD_PAD 2
extern rtx assign_stack_local_1 (enum machine_mode, HOST_WIDE_INT, int, int);
-extern rtx assign_stack_temp (enum machine_mode, HOST_WIDE_INT, int);
-extern rtx assign_stack_temp_for_type (enum machine_mode,
- HOST_WIDE_INT, int, tree);
-extern rtx assign_temp (tree, int, int, int);
+extern rtx assign_stack_temp (enum machine_mode, HOST_WIDE_INT);
+extern rtx assign_stack_temp_for_type (enum machine_mode, HOST_WIDE_INT, tree);
+extern rtx assign_temp (tree, int, int);
/* In emit-rtl.c */
extern rtx emit_insn_before (rtx, rtx);
extern void reposition_prologue_and_epilogue_notes (void);
extern int prologue_epilogue_contains (const_rtx);
extern int sibcall_epilogue_contains (const_rtx);
-extern void mark_temp_addr_taken (rtx);
extern void update_temp_slot_address (rtx, rtx);
extern void maybe_copy_prologue_epilogue_insn (rtx, rtx);
extern void set_return_jump_label (rtx);
}
else
{
- op = assign_temp (type, 0, 0, 1);
+ op = assign_temp (type, 0, 1);
op = validize_mem (op);
if (!MEM_P (op) && TREE_CODE (TREE_VALUE (tail)) == SSA_NAME)
set_reg_attrs_for_decl_rtl (SSA_NAME_VAR (TREE_VALUE (tail)), op);
}
else
gcc_unreachable ();
-#if 0
- {
- warning (0, "use of memory input without lvalue in "
- "asm operand %d is deprecated", i + noutputs);
-
- if (CONSTANT_P (op))
- {
- rtx mem = force_const_mem (TYPE_MODE (type), op);
- if (mem)
- op = validize_mem (mem);
- else
- op = force_reg (TYPE_MODE (type), op);
- }
- if (REG_P (op)
- || GET_CODE (op) == SUBREG
- || GET_CODE (op) == CONCAT)
- {
- tree qual_type = build_qualified_type (type,
- (TYPE_QUALS (type)
- | TYPE_QUAL_CONST));
- rtx memloc = assign_temp (qual_type, 1, 1, 1);
- memloc = validize_mem (memloc);
- emit_move_insn (memloc, op);
- op = memloc;
- }
- }
-#endif
}
generating_concat_p = old_generating_concat_p;
tree ot = TREE_TYPE (DECL_RESULT (current_function_decl));
tree nt = build_qualified_type (ot, TYPE_QUALS (ot) | TYPE_QUAL_CONST);
- val = assign_temp (nt, 0, 0, 1);
+ val = assign_temp (nt, 0, 1);
val = expand_expr (retval_rhs, val, GET_MODE (val), EXPAND_NORMAL);
val = force_not_mem (val);
/* Return the calculated value. */
emit_insn (gen_blockage ());
}
\f
-/* Generate RTL for the automatic variable declaration DECL.
- (Other kinds of declarations are simply ignored if seen here.) */
-
-void
-expand_decl (tree decl)
-{
- tree type;
-
- type = TREE_TYPE (decl);
-
- /* For a CONST_DECL, set mode, alignment, and sizes from those of the
- type in case this node is used in a reference. */
- if (TREE_CODE (decl) == CONST_DECL)
- {
- gcc_unreachable ();
- DECL_MODE (decl) = TYPE_MODE (type);
- DECL_ALIGN (decl) = TYPE_ALIGN (type);
- DECL_SIZE (decl) = TYPE_SIZE (type);
- DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (type);
- return;
- }
-
- /* Otherwise, only automatic variables need any expansion done. Static and
- external variables, and external functions, will be handled by
- `assemble_variable' (called from finish_decl). TYPE_DECL requires
- nothing. PARM_DECLs are handled in `assign_parms'. */
- if (TREE_CODE (decl) != VAR_DECL)
- return;
-
- if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
- return;
-
- gcc_unreachable ();
- /* Create the RTL representation for the variable. */
-
- if (type == error_mark_node)
- SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
-
- else if (DECL_SIZE (decl) == 0)
- {
- /* Variable with incomplete type. */
- rtx x;
- if (DECL_INITIAL (decl) == 0)
- /* Error message was already done; now avoid a crash. */
- x = gen_rtx_MEM (BLKmode, const0_rtx);
- else
- /* An initializer is going to decide the size of this array.
- Until we know the size, represent its address with a reg. */
- x = gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode));
-
- set_mem_attributes (x, decl, 1);
- SET_DECL_RTL (decl, x);
- }
- else if (use_register_for_decl (decl))
- {
- /* Automatic variable that can go in a register. */
- enum machine_mode reg_mode = promote_decl_mode (decl, NULL);
-
- SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
-
- /* Note if the object is a user variable. */
- if (!DECL_ARTIFICIAL (decl))
- mark_user_reg (DECL_RTL (decl));
-
- if (POINTER_TYPE_P (type))
- mark_reg_pointer (DECL_RTL (decl),
- TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
- }
-
- else
- {
- rtx oldaddr = 0;
- rtx addr;
- rtx x;
-
- /* Variable-sized decls are dealt with in the gimplifier. */
- gcc_assert (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST);
-
- /* If we previously made RTL for this decl, it must be an array
- whose size was determined by the initializer.
- The old address was a register; set that register now
- to the proper address. */
- if (DECL_RTL_SET_P (decl))
- {
- gcc_assert (MEM_P (DECL_RTL (decl)));
- gcc_assert (REG_P (XEXP (DECL_RTL (decl), 0)));
- oldaddr = XEXP (DECL_RTL (decl), 0);
- }
-
- /* Set alignment we actually gave this decl. */
- DECL_ALIGN (decl) = (DECL_MODE (decl) == BLKmode ? BIGGEST_ALIGNMENT
- : GET_MODE_BITSIZE (DECL_MODE (decl)));
- DECL_USER_ALIGN (decl) = 0;
-
- x = assign_temp (decl, 1, 1, 1);
- set_mem_attributes (x, decl, 1);
- SET_DECL_RTL (decl, x);
-
- if (oldaddr)
- {
- addr = force_operand (XEXP (DECL_RTL (decl), 0), oldaddr);
- if (addr != oldaddr)
- emit_move_insn (oldaddr, addr);
- }
- }
-}
-\f
/* Emit code to save the current value of stack. */
rtx
expand_stack_save (void)
extern bool expand_switch_using_bit_tests_p (tree, tree, unsigned int,
unsigned int);
extern void expand_case (gimple);
-extern void expand_decl (tree);
#ifdef HARD_CONST
/* Silly ifdef to avoid having all includers depend on hard-reg-set.h. */
extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);