From: Steven Bosscher Date: Tue, 17 Feb 2004 21:33:43 +0000 (+0000) Subject: (c-decl.c, [...]): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION. X-Git-Tag: releases/gcc-4.0.0~10059 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1da326c33559e8a114bc379ec7c8f805dd37aef6;p=thirdparty%2Fgcc.git (c-decl.c, [...]): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION. * (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c, function.c, integrate.c, print-tree.c, toplev.c, tree-optimize.c, tree.h): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION. * ada/utils.c: Likewise. * cp/decl.c: Likewise. * f/com.c: Likewise. * java/class.c: Likewise. From-SVN: r77985 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 109347a01a19..5ece10cfede4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-02017 Steven Bosscher + + * (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c, + function.c, integrate.c, print-tree.c, toplev.c, tree-optimize.c, + tree.h): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION. + * ada/utils.c: Likewise. + * cp/decl.c: Likewise. + * f/com.c: Likewise. + * java/class.c: Likewise. + 2004-02-17 Kazu Hirata * config/h8300/h8300.md: Fix comment typos. diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 94176917836e..30939d66c6a9 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -1929,7 +1929,7 @@ end_subprog_body (void) cico_list != 0; cico_list = TREE_CHAIN (cico_list)) TREE_VALUE (cico_list) = 0; - if (DECL_SAVED_INSNS (current_function_decl) == 0) + if (DECL_STRUCT_FUNCTION (current_function_decl) == 0) { /* Throw away DECL_RTL in any PARM_DECLs unless this function was saved for inline, in which case the DECL_RTLs are in diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 685a9c80dfd0..0f76b88eaf9d 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1441,7 +1441,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) { DECL_RESULT (newdecl) = DECL_RESULT (olddecl); DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); - DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl); + DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl); DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl); DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl); @@ -6066,8 +6066,9 @@ finish_function (void) && current_function_returns_null) warning ("this function may return with or without a value"); - /* We're leaving the context of this function, so zap cfun. It's still in - DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */ + /* We're leaving the context of this function, so zap cfun. + It's still in DECL_STRUCT_FUNCTION , and we'll restore it in + tree_rest_of_compilation. */ cfun = NULL; /* ??? Objc emits functions after finalizing the compilation unit. @@ -6240,7 +6241,7 @@ c_pop_function_context (struct function *f) { struct language_function *p = f->language; - if (DECL_SAVED_INSNS (current_function_decl) == 0 + if (DECL_STRUCT_FUNCTION (current_function_decl) == 0 && DECL_SAVED_TREE (current_function_decl) == NULL_TREE) { /* Stop pointing to the local nodes about to be freed. */ diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 38c4021d6cf1..17a301cffffe 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -640,8 +640,8 @@ genrtl_scope_stmt (tree t) { if (TREE_CODE (fn) == FUNCTION_DECL && DECL_CONTEXT (fn) == current_function_decl - && DECL_SAVED_INSNS (fn) - && DECL_SAVED_INSNS (fn)->saved_for_inline + && DECL_STRUCT_FUNCTION (fn) + && DECL_STRUCT_FUNCTION (fn)->saved_for_inline && !TREE_ASM_WRITTEN (fn) && TREE_ADDRESSABLE (fn)) { diff --git a/gcc/calls.c b/gcc/calls.c index c6675758a730..82664b5232c4 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1778,11 +1778,11 @@ try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore, rtx insn = NULL_RTX, seq; /* Look for a call in the inline function code. - If DECL_SAVED_INSNS (fndecl)->outgoing_args_size is + If DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size is nonzero then there is a call and it is not necessary to scan the insns. */ - if (DECL_SAVED_INSNS (fndecl)->outgoing_args_size == 0) + if (DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size == 0) for (insn = first_insn; insn; insn = NEXT_INSN (insn)) if (GET_CODE (insn) == CALL_INSN) break; @@ -1806,8 +1806,9 @@ try_to_integrate (tree fndecl, tree actparms, rtx target, int ignore, value of reg_parm_stack_space is wrong, but gives correct results on all supported machines. */ - int adjust = (DECL_SAVED_INSNS (fndecl)->outgoing_args_size - + reg_parm_stack_space); + int adjust = + (DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size + + reg_parm_stack_space); start_sequence (); emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX); @@ -2194,8 +2195,8 @@ expand_call (tree exp, rtx target, int ignore) if (!flag_no_inline && fndecl != current_function_decl && DECL_INLINE (fndecl) - && DECL_SAVED_INSNS (fndecl) - && DECL_SAVED_INSNS (fndecl)->inlinable) + && DECL_STRUCT_FUNCTION (fndecl) + && DECL_STRUCT_FUNCTION (fndecl)->inlinable) is_integrable = 1; else if (! TREE_ADDRESSABLE (fndecl)) { diff --git a/gcc/cgraph.c b/gcc/cgraph.c index e9d0b243bc4c..8cee3dfbffb7 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -235,7 +235,7 @@ cgraph_remove_node (struct cgraph_node *node) if (node->next) node->next->previous = node->previous; DECL_SAVED_TREE (node->decl) = NULL; - DECL_SAVED_INSNS (node->decl) = NULL; + DECL_STRUCT_FUNCTION (node->decl) = NULL; DECL_ARGUMENTS (node->decl) = NULL; DECL_INITIAL (node->decl) = error_mark_node; slot = diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 78b566f5c68c..79bbe6d3e0fd 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -232,7 +232,7 @@ cgraph_finalize_function (tree decl, bool nested) /* We will never really output the function body, clear the SAVED_INSNS array early then. */ if (DECL_EXTERNAL (decl)) - DECL_SAVED_INSNS (decl) = NULL; + DECL_STRUCT_FUNCTION (decl) = NULL; } /* Walk tree and record all calls. Called via walk_tree. */ @@ -481,7 +481,7 @@ cgraph_mark_functions_to_output (void) && !DECL_EXTERNAL (decl)) node->output = 1; else - DECL_SAVED_INSNS (decl) = NULL; + DECL_STRUCT_FUNCTION (decl) = NULL; } } @@ -861,7 +861,7 @@ cgraph_remove_unreachable_nodes (void) int local_insns; tree decl = node->decl; - if (DECL_SAVED_INSNS (decl)) + if (DECL_STRUCT_FUNCTION (decl)) local_insns = node->local.self_insns; else local_insns = 0; diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c07142915f6d..f3821c34a127 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1684,7 +1684,7 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_LANG_SPECIFIC (olddecl)) { DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl); - DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl); + DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl); } } @@ -10861,8 +10861,9 @@ finish_function (int flags) && (DECL_INLINE (fndecl) || processing_template_decl)) warning ("no return statement in function returning non-void"); - /* We're leaving the context of this function, so zap cfun. It's still in - DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation. */ + /* We're leaving the context of this function, so zap cfun. + It's still in DECL_STRUCT_FUNCTION, and we'll restore it in + tree_rest_of_compilation. */ cfun = NULL; current_function_decl = NULL; diff --git a/gcc/f/com.c b/gcc/f/com.c index 5309b84f4d2a..ebfce0a56701 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -13402,7 +13402,7 @@ duplicate_decls (tree newdecl, tree olddecl) DECL_RESULT (newdecl) = DECL_RESULT (olddecl); DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); - DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl); + DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl); DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl); } @@ -13599,7 +13599,7 @@ finish_function (int nested) if (TREE_CODE (fndecl) != ERROR_MARK && !nested - && DECL_SAVED_INSNS (fndecl) == 0) + && DECL_STRUCT_FUNCTION (fndecl) == 0) { /* Stop pointing to the local nodes about to be freed. */ /* But DECL_INITIAL must remain nonzero so we know this was an actual @@ -13755,7 +13755,7 @@ pop_f_function_context (void) = TREE_VALUE (link); if (current_function_decl != error_mark_node - && DECL_SAVED_INSNS (current_function_decl) == 0) + && DECL_STRUCT_FUNCTION (current_function_decl) == 0) { /* Stop pointing to the local nodes about to be freed. */ /* But DECL_INITIAL must remain nonzero so we know this was an actual @@ -14350,7 +14350,7 @@ poplevel (int keep, int reverse, int functionbody) if (DECL_ABSTRACT_ORIGIN (decl) != 0 && DECL_ABSTRACT_ORIGIN (decl) != decl) TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1; - else if (DECL_SAVED_INSNS (decl) != 0) + else if (DECL_STRUCT_FUNCTION (decl) != 0) { push_function_context (); output_inline_function (decl); diff --git a/gcc/function.c b/gcc/function.c index d51edde1a1ac..bbb9a51b0679 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6414,7 +6414,7 @@ allocate_struct_function (tree fndecl) if (fndecl == NULL) return; - DECL_SAVED_INSNS (fndecl) = cfun; + DECL_STRUCT_FUNCTION (fndecl) = cfun; cfun->decl = fndecl; result = DECL_RESULT (fndecl); @@ -6439,8 +6439,8 @@ allocate_struct_function (tree fndecl) static void prepare_function_start (tree fndecl) { - if (fndecl && DECL_SAVED_INSNS (fndecl)) - cfun = DECL_SAVED_INSNS (fndecl); + if (fndecl && DECL_STRUCT_FUNCTION (fndecl)) + cfun = DECL_STRUCT_FUNCTION (fndecl); else allocate_struct_function (fndecl); init_emit (); diff --git a/gcc/integrate.c b/gcc/integrate.c index 3e05934fbcf0..c50d36bdb424 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -414,8 +414,8 @@ copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn) } /* Make the insns and PARM_DECLs of the current function permanent - and record other information in DECL_SAVED_INSNS to allow inlining - of this function in subsequent calls. + and record other information in DECL_STRUCT_FUNCTION to allow + inlining of this function in subsequent calls. This routine need not copy any insns because we are not going to immediately compile the insns in the insn chain. There @@ -642,7 +642,7 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore, tree type, rtx structure_value_addr) { struct function *inlining_previous; - struct function *inl_f = DECL_SAVED_INSNS (fndecl); + struct function *inl_f = DECL_STRUCT_FUNCTION (fndecl); tree formal, actual, block; rtx parm_insns = inl_f->emit->x_first_insn; rtx insns = (inl_f->inl_last_parm_insn @@ -953,7 +953,7 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore, incoming arg rtx values are expanded now so that we can be sure we have enough slots in the const equiv map since the store_expr call can easily blow the size estimate. */ - if (DECL_SAVED_INSNS (fndecl)->args_size != 0) + if (DECL_STRUCT_FUNCTION (fndecl)->args_size != 0) copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0); } else if (GET_CODE (loc) == REG) @@ -1886,7 +1886,8 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs) regno = REGNO (orig); if (regno <= LAST_VIRTUAL_REGISTER || (map->integrating - && DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer == orig)) + && DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer + == orig)) { /* Some hard registers are also mapped, but others are not translated. */ @@ -1904,10 +1905,11 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs) else if (regno == VIRTUAL_STACK_VARS_REGNUM) { rtx loc, seq; - int size = get_func_frame_size (DECL_SAVED_INSNS (map->fndecl)); + int size + = get_func_frame_size (DECL_STRUCT_FUNCTION (map->fndecl)); #ifdef FRAME_GROWS_DOWNWARD int alignment - = (DECL_SAVED_INSNS (map->fndecl)->stack_alignment_needed + = (DECL_STRUCT_FUNCTION (map->fndecl)->stack_alignment_needed / BITS_PER_UNIT); /* In this case, virtual_stack_vars_rtx points to one byte @@ -1942,13 +1944,13 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs) } else if (regno == VIRTUAL_INCOMING_ARGS_REGNUM || (map->integrating - && (DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer + && (DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer == orig))) { /* Do the same for a block to contain any arguments referenced in memory. */ rtx loc, seq; - int size = DECL_SAVED_INSNS (map->fndecl)->args_size; + int size = DECL_STRUCT_FUNCTION (map->fndecl)->args_size; start_sequence (); loc = assign_stack_temp (BLKmode, size, 1); @@ -2956,8 +2958,8 @@ set_decl_abstract_flags (tree decl, int setting) } } -/* Output the assembly language code for the function FNDECL - from its DECL_SAVED_INSNS. Used for inline functions that are output +/* Output the assembly language code for the function FNDECL from + its DECL_STRUCT_FUNCTION. Used for inline functions that are output at end of compilation instead of where they came in the source. */ static GTY(()) struct function *old_cfun; @@ -2967,7 +2969,7 @@ output_inline_function (tree fndecl) { enum debug_info_type old_write_symbols = write_symbols; const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks; - struct function *f = DECL_SAVED_INSNS (fndecl); + struct function *f = DECL_STRUCT_FUNCTION (fndecl); old_cfun = cfun; cfun = f; diff --git a/gcc/java/class.c b/gcc/java/class.c index 58cf778ecba9..f6471ef5c490 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1710,7 +1710,7 @@ finish_class (void) /* Emit deferred inline methods. */ for (method = type_methods; method != NULL_TREE; ) { - if (! TREE_ASM_WRITTEN (method) && DECL_SAVED_INSNS (method) != 0) + if (! TREE_ASM_WRITTEN (method) && DECL_STRUCT_FUNCTION (method) != 0) { output_inline_function (method); /* Scan the list again to see if there are any earlier diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 2965d6ee5749..df566fbe6452 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -440,11 +440,11 @@ print_node (FILE *file, const char *prefix, tree node, int indent) } } else if (TREE_CODE (node) == FUNCTION_DECL - && DECL_SAVED_INSNS (node) != 0) + && DECL_STRUCT_FUNCTION (node) != 0) { indent_to (file, indent + 4); fprintf (file, "saved-insns " HOST_PTR_PRINTF, - (void *) DECL_SAVED_INSNS (node)); + (void *) DECL_STRUCT_FUNCTION (node)); } /* Print the decl chain only if decl is at second level. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 7473eade90a0..09978fccb5a3 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1658,8 +1658,8 @@ wrapup_global_declarations (tree *vec, int len) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl) != 0 - && DECL_SAVED_INSNS (decl) != 0 - && DECL_SAVED_INSNS (decl)->saved_for_inline + && DECL_STRUCT_FUNCTION (decl) != 0 + && DECL_STRUCT_FUNCTION (decl)->saved_for_inline && (flag_keep_inline_functions || (TREE_PUBLIC (decl) && !DECL_COMDAT (decl)) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) @@ -2677,7 +2677,8 @@ rest_of_handle_inlining (tree decl) if (open_dump_file (DFI_rtl, decl)) { - if (DECL_SAVED_INSNS (decl) && DECL_SAVED_INSNS (decl)->saved_for_inline) + if (DECL_STRUCT_FUNCTION (decl) + && DECL_STRUCT_FUNCTION (decl)->saved_for_inline) fprintf (rtl_dump_file, ";; (integrable)\n\n"); close_dump_file (DFI_rtl, print_rtl, insns); } @@ -2747,7 +2748,7 @@ rest_of_handle_inlining (tree decl) timevar_push (TV_INTEGRATION); save_for_inline (decl); timevar_pop (TV_INTEGRATION); - DECL_SAVED_INSNS (decl)->inlinable = inlinable; + DECL_STRUCT_FUNCTION (decl)->inlinable = inlinable; return true; } @@ -3678,7 +3679,7 @@ rest_of_compilation (tree decl) if (! DECL_DEFER_OUTPUT (decl)) { free_after_compilation (cfun); - DECL_SAVED_INSNS (decl) = 0; + DECL_STRUCT_FUNCTION (decl) = 0; } cfun = 0; diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index 9df5adbd79e4..35220167a952 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -208,7 +208,7 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) if (!cgraph_function_possibly_inlined_p (fndecl)) { DECL_SAVED_TREE (fndecl) = NULL; - if (DECL_SAVED_INSNS (fndecl) == 0 + if (DECL_STRUCT_FUNCTION (fndecl) == 0 && !cgraph_node (fndecl)->origin) { /* Stop pointing to the local nodes about to be freed. diff --git a/gcc/tree.h b/gcc/tree.h index 3399d30f200d..ee1f50c8c098 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1375,8 +1375,9 @@ struct tree_type GTY(()) where the data was actually passed. */ #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r) -/* For FUNCTION_DECL, if it is inline, holds the saved insn chain. */ -#define DECL_SAVED_INSNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f) +/* For FUNCTION_DECL, this holds a pointer to a structure ("struct function") + that describes the status of this function. */ +#define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f) /* For FUNCTION_DECL, if it is built-in, this identifies which built-in operation it is. */