aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-03-15 02:51:03 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-03-15 02:51:03 +0000
commit19e7881c81752c856edb9f71db93805ce0416be6 (patch)
treee937810f6aadde94067b96c8f65cc56fba667d87 /gcc/stmt.c
parentb894530e6d9633fc6497b3c404a3ec1bd1a341df (diff)
downloadgcc-19e7881c81752c856edb9f71db93805ce0416be6.zip
gcc-19e7881c81752c856edb9f71db93805ce0416be6.tar.gz
gcc-19e7881c81752c856edb9f71db93805ce0416be6.tar.bz2
varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME...
* varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME, not the contents of the RTL, to determine the name of the object. * tree.h (DECL_RTL): Allocate RTL lazily. (SET_DECL_RTL): New macro. (DECL_RTL_SET_P): Likewise. (COPY_DECL_RTL): Likewise. (DECL_RTL_IF_SET): Likewise. * varasm.c (make_decl_rtl): Add assertions about the kind of declaration we are processing. * c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (start_decl): Likewise. (finish_decl): Likewise. * c-semantics.c (emit_local_var): Likewise. * calls.c (expand_call): Likewise. * dbxout.c (dbxout_symbol): Likewise. * emit-rtl.c (unshare_all_rtl): Likewise. (unshare_all_decls): Likewise. (reset_used_decls): Likewise. * expr.c (store_constructor): Likewise. (safe_from_p): Likewise. (expand_expr): Likewise. * function.c (put_var_into_stack): Likewise. (instantiate_decls_1): Likewise. (assign_parms): Likewise. (expand_function_start): Likewise. (expand_function_end): Likewise. * ggc-common.c (gcc_mark_trees): Likewise. * integrate.c (function_cannot_inline_p): Likewise. (copy_decl_for_inlining): Likewise. (expand_inline_function): Likewise. (integrate_parm_decls): Likewise. (integrate_decl_tree): Likewise. * print-tree.c (print_node): Likewise. * reg-stack.c (stack_result): Likewise. * stmt.c (label_rtx): Likewise. (expand_return): Likewise. (expand_decl): Likewise. (expand_decl_cleanup): Likewise. (expand_anon_union_decl): Likewise. * toplev.c (check_global_declarations): Likewise. (rest_of_decl_compilation): Likewise. * tree.c (simple_cst_equal): Likewise. * objc/objc-act.c (generate_static_references): Likewise. * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * cp-tree.h (DECL_IN_MEMORY_P): Likewise. * decl.c (duplicate_decls): Likewise. (builtin_function): Likewise. (build_library_fn): Likewise. (build_cp_library_fn): Likewise. (check_initializer): Likewise. (cp_finish_decl): Likewise. * decl2.c (grokfield): Likewise. (grok_function_init): Remove #if 0'd code. (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * friend.c (do_friend): Likewise. * init.c (get_temp_regvar): Likewise. * method.c (make_thunk): Likewise. * pt.c (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Likewise. * semantics.c (genrtl_named_return_value): Likewise. (expand_body): Likewise. (genrtl_finish_function): Likewise. * tree.c (cp_tree_equal): Likewise. * com.c (ffecom_member_phase_2): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (duplicate_decls): Likewise. (start_decl): Likewise. * class.c (build_static_field_ref): Likewise. (make_method_value): Likewise. (get_dispatch_table): Likewise. * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. From-SVN: r40482
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 4ca2c97..1786c20 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -675,12 +675,13 @@ label_rtx (label)
if (TREE_CODE (label) != LABEL_DECL)
abort ();
- if (DECL_RTL (label))
- return DECL_RTL (label);
+ if (!DECL_RTL_SET_P (label))
+ SET_DECL_RTL (label, gen_label_rtx ());
- return DECL_RTL (label) = gen_label_rtx ();
+ return DECL_RTL (label);
}
+
/* Add an unconditional jump to LABEL as the next sequential instruction. */
void
@@ -2920,7 +2921,7 @@ expand_return (retval)
run destructors on variables that might be used in the subsequent
computation of the return value. */
rtx last_insn = 0;
- rtx result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+ rtx result_rtl;
register rtx val = 0;
tree retval_rhs;
int cleanups;
@@ -3000,6 +3001,8 @@ expand_return (retval)
return;
}
+ result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+
/* If the result is an aggregate that is being returned in one (or more)
registers, load the registers here. The compiler currently can't handle
copying a BLKmode value into registers. We could put this code in a
@@ -3838,18 +3841,18 @@ expand_decl (decl)
/* Create the RTL representation for the variable. */
if (type == error_mark_node)
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
+ SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
else if (DECL_SIZE (decl) == 0)
/* Variable with incomplete type. */
{
if (DECL_INITIAL (decl) == 0)
/* Error message was already done; now avoid a crash. */
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
+ SET_DECL_RTL (decl, 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. */
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode));
+ SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode)));
set_mem_attributes (DECL_RTL (decl), decl, 1);
}
@@ -3868,7 +3871,7 @@ expand_decl (decl)
enum machine_mode reg_mode
= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
- DECL_RTL (decl) = gen_reg_rtx (reg_mode);
+ SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
mark_user_reg (DECL_RTL (decl));
if (POINTER_TYPE_P (type))
@@ -3895,7 +3898,7 @@ expand_decl (decl)
whose size was determined by the initializer.
The old address was a register; set that register now
to the proper address. */
- if (DECL_RTL (decl) != 0)
+ if (DECL_RTL_SET_P (decl))
{
if (GET_CODE (DECL_RTL (decl)) != MEM
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != REG)
@@ -3903,7 +3906,8 @@ expand_decl (decl)
oldaddr = XEXP (DECL_RTL (decl), 0);
}
- DECL_RTL (decl) = assign_temp (TREE_TYPE (decl), 1, 1, 1);
+ SET_DECL_RTL (decl,
+ assign_temp (TREE_TYPE (decl), 1, 1, 1));
/* Set alignment we actually gave this decl. */
DECL_ALIGN (decl) = (DECL_MODE (decl) == BLKmode ? BIGGEST_ALIGNMENT
@@ -3945,7 +3949,7 @@ expand_decl (decl)
TYPE_ALIGN (TREE_TYPE (decl)));
/* Reference the variable indirect through that rtx. */
- DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), address);
+ SET_DECL_RTL (decl, gen_rtx_MEM (DECL_MODE (decl), address));
set_mem_attributes (DECL_RTL (decl), decl, 1);
@@ -4061,7 +4065,7 @@ expand_decl_cleanup (decl, cleanup)
emit_move_insn (flag, const1_rtx);
cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
- DECL_RTL (cond) = flag;
+ SET_DECL_RTL (cond, flag);
/* Conditionalize the cleanup. */
cleanup = build (COND_EXPR, void_type_node,
@@ -4262,19 +4266,20 @@ expand_anon_union_decl (decl, cleanup, decl_elts)
if (GET_CODE (x) == MEM)
{
if (mode == GET_MODE (x))
- DECL_RTL (decl_elt) = x;
+ SET_DECL_RTL (decl_elt, x);
else
{
- DECL_RTL (decl_elt) = gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0)));
+ SET_DECL_RTL (decl_elt,
+ gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0))));
MEM_COPY_ATTRIBUTES (DECL_RTL (decl_elt), x);
}
}
else if (GET_CODE (x) == REG)
{
if (mode == GET_MODE (x))
- DECL_RTL (decl_elt) = x;
+ SET_DECL_RTL (decl_elt, x);
else
- DECL_RTL (decl_elt) = gen_rtx_SUBREG (mode, x, 0);
+ SET_DECL_RTL (decl_elt, gen_rtx_SUBREG (mode, x, 0));
}
else
abort ();