function.h revision 117395
118334Speter/* Structure for saving state for a nested function. 290075Sobrien Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 390075Sobrien 1999, 2000 Free Software Foundation, Inc. 418334Speter 590075SobrienThis file is part of GCC. 618334Speter 790075SobrienGCC is free software; you can redistribute it and/or modify it under 890075Sobrienthe terms of the GNU General Public License as published by the Free 990075SobrienSoftware Foundation; either version 2, or (at your option) any later 1090075Sobrienversion. 1118334Speter 1290075SobrienGCC is distributed in the hope that it will be useful, but WITHOUT ANY 1390075SobrienWARRANTY; without even the implied warranty of MERCHANTABILITY or 1490075SobrienFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1590075Sobrienfor more details. 1618334Speter 1718334SpeterYou should have received a copy of the GNU General Public License 1890075Sobrienalong with GCC; see the file COPYING. If not, write to the Free 1990075SobrienSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA 2090075Sobrien02111-1307, USA. */ 2118334Speter 22117395Skanstruct var_refs_queue GTY(()) 2318334Speter{ 2418334Speter rtx modified; 2518334Speter enum machine_mode promoted_mode; 2618334Speter int unsignedp; 2718334Speter struct var_refs_queue *next; 2818334Speter}; 2918334Speter 3018334Speter/* Stack of pending (incomplete) sequences saved by `start_sequence'. 3118334Speter Each element describes one pending sequence. 3218334Speter The main insn-chain is saved in the last element of the chain, 3318334Speter unless the chain is empty. */ 3418334Speter 35117395Skanstruct sequence_stack GTY(()) 3618334Speter{ 3718334Speter /* First and last insns in the chain of the saved sequence. */ 38117395Skan rtx first; 39117395Skan rtx last; 4018334Speter tree sequence_rtl_expr; 4118334Speter struct sequence_stack *next; 4218334Speter}; 4318334Speter 4418334Speterextern struct sequence_stack *sequence_stack; 4518334Speter 4618334Speter/* Stack of single obstacks. */ 4718334Speter 4818334Speterstruct simple_obstack_stack 4918334Speter{ 5018334Speter struct obstack *obstack; 5118334Speter struct simple_obstack_stack *next; 5218334Speter}; 5318334Speter 54117395Skanstruct emit_status GTY(()) 5590075Sobrien{ 5690075Sobrien /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function. 5790075Sobrien After rtl generation, it is 1 plus the largest register number used. */ 5890075Sobrien int x_reg_rtx_no; 5990075Sobrien 6090075Sobrien /* Lowest label number in current function. */ 6190075Sobrien int x_first_label_num; 6290075Sobrien 6390075Sobrien /* The ends of the doubly-linked chain of rtl for the current function. 6490075Sobrien Both are reset to null at the start of rtl generation for the function. 6590075Sobrien 6690075Sobrien start_sequence saves both of these on `sequence_stack' along with 6790075Sobrien `sequence_rtl_expr' and then starts a new, nested sequence of insns. */ 6890075Sobrien rtx x_first_insn; 6990075Sobrien rtx x_last_insn; 7090075Sobrien 7190075Sobrien /* RTL_EXPR within which the current sequence will be placed. Use to 7290075Sobrien prevent reuse of any temporaries within the sequence until after the 7390075Sobrien RTL_EXPR is emitted. */ 7490075Sobrien tree sequence_rtl_expr; 7590075Sobrien 7690075Sobrien /* Stack of pending (incomplete) sequences saved by `start_sequence'. 7790075Sobrien Each element describes one pending sequence. 7890075Sobrien The main insn-chain is saved in the last element of the chain, 7990075Sobrien unless the chain is empty. */ 8090075Sobrien struct sequence_stack *sequence_stack; 8190075Sobrien 8290075Sobrien /* INSN_UID for next insn emitted. 8390075Sobrien Reset to 1 for each function compiled. */ 8490075Sobrien int x_cur_insn_uid; 8590075Sobrien 8690075Sobrien /* Line number and source file of the last line-number NOTE emitted. 8790075Sobrien This is used to avoid generating duplicates. */ 8890075Sobrien int x_last_linenum; 8990075Sobrien const char *x_last_filename; 9090075Sobrien 9190075Sobrien /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx 9290075Sobrien vectors. Since these vectors are needed during the expansion phase when 9390075Sobrien the total number of registers in the function is not yet known, the 9490075Sobrien vectors are copied and made bigger when necessary. */ 9590075Sobrien int regno_pointer_align_length; 9690075Sobrien 9790075Sobrien /* Indexed by pseudo register number, if nonzero gives the known alignment 9890075Sobrien for that pseudo (if REG_POINTER is set in x_regno_reg_rtx). 9990075Sobrien Allocated in parallel with x_regno_reg_rtx. */ 100117395Skan unsigned char * GTY ((length ("%h.regno_pointer_align_length"))) 101117395Skan regno_pointer_align; 10290075Sobrien 10390075Sobrien /* Indexed by pseudo register number, if nonzero gives the decl 10490075Sobrien corresponding to that register. */ 105117395Skan tree * GTY ((length ("%h.regno_pointer_align_length"))) regno_decl; 10690075Sobrien 10790075Sobrien /* Indexed by pseudo register number, gives the rtx for that pseudo. 108117395Skan Allocated in parallel with regno_pointer_align. 109117395Skan 110117395Skan Note MEM expressions can appear in this array due to the actions 111117395Skan of put_var_into_stack. */ 112117395Skan rtx * GTY ((length ("%h.regno_pointer_align_length"))) x_regno_reg_rtx; 11390075Sobrien}; 11490075Sobrien 11590075Sobrien/* For backward compatibility... eventually these should all go away. */ 11690075Sobrien#define reg_rtx_no (cfun->emit->x_reg_rtx_no) 11790075Sobrien#define seq_rtl_expr (cfun->emit->sequence_rtl_expr) 11890075Sobrien#define regno_reg_rtx (cfun->emit->x_regno_reg_rtx) 11990075Sobrien#define seq_stack (cfun->emit->sequence_stack) 12090075Sobrien 12190075Sobrien#define REGNO_POINTER_ALIGN(REGNO) (cfun->emit->regno_pointer_align[REGNO]) 12290075Sobrien#define REGNO_DECL(REGNO) (cfun->emit->regno_decl[REGNO]) 12390075Sobrien 124117395Skanstruct expr_status GTY(()) 12590075Sobrien{ 12690075Sobrien /* Number of units that we should eventually pop off the stack. 12790075Sobrien These are the arguments to function calls that have already returned. */ 12890075Sobrien int x_pending_stack_adjust; 12990075Sobrien 13090075Sobrien /* Under some ABIs, it is the caller's responsibility to pop arguments 13190075Sobrien pushed for function calls. A naive implementation would simply pop 13290075Sobrien the arguments immediately after each call. However, if several 13390075Sobrien function calls are made in a row, it is typically cheaper to pop 13490075Sobrien all the arguments after all of the calls are complete since a 13590075Sobrien single pop instruction can be used. Therefore, GCC attempts to 13690075Sobrien defer popping the arguments until absolutely necessary. (For 13790075Sobrien example, at the end of a conditional, the arguments must be popped, 13890075Sobrien since code outside the conditional won't know whether or not the 13990075Sobrien arguments need to be popped.) 14090075Sobrien 141117395Skan When INHIBIT_DEFER_POP is nonzero, however, the compiler does not 14290075Sobrien attempt to defer pops. Instead, the stack is popped immediately 14390075Sobrien after each call. Rather then setting this variable directly, use 14490075Sobrien NO_DEFER_POP and OK_DEFER_POP. */ 14590075Sobrien int x_inhibit_defer_pop; 14690075Sobrien 14790075Sobrien /* If PREFERRED_STACK_BOUNDARY and PUSH_ROUNDING are defined, the stack 148117395Skan boundary can be momentarily unaligned while pushing the arguments. 14990075Sobrien Record the delta since last aligned boundary here in order to get 15090075Sobrien stack alignment in the nested function calls working right. */ 15190075Sobrien int x_stack_pointer_delta; 15290075Sobrien 15390075Sobrien /* Nonzero means __builtin_saveregs has already been done in this function. 15490075Sobrien The value is the pseudoreg containing the value __builtin_saveregs 15590075Sobrien returned. */ 15690075Sobrien rtx x_saveregs_value; 15790075Sobrien 15890075Sobrien /* Similarly for __builtin_apply_args. */ 15990075Sobrien rtx x_apply_args_value; 16090075Sobrien 16190075Sobrien /* List of labels that must never be deleted. */ 16290075Sobrien rtx x_forced_labels; 16390075Sobrien 16490075Sobrien /* Postincrements that still need to be expanded. */ 16590075Sobrien rtx x_pending_chain; 16690075Sobrien}; 16790075Sobrien 16890075Sobrien#define pending_stack_adjust (cfun->expr->x_pending_stack_adjust) 16990075Sobrien#define inhibit_defer_pop (cfun->expr->x_inhibit_defer_pop) 17090075Sobrien#define saveregs_value (cfun->expr->x_saveregs_value) 17190075Sobrien#define apply_args_value (cfun->expr->x_apply_args_value) 17290075Sobrien#define forced_labels (cfun->expr->x_forced_labels) 17390075Sobrien#define pending_chain (cfun->expr->x_pending_chain) 17490075Sobrien#define stack_pointer_delta (cfun->expr->x_stack_pointer_delta) 17590075Sobrien 17618334Speter/* This structure can save all the important global and static variables 17718334Speter describing the status of the current function. */ 17818334Speter 179117395Skanstruct function GTY(()) 18018334Speter{ 18190075Sobrien struct eh_status *eh; 18290075Sobrien struct stmt_status *stmt; 18390075Sobrien struct expr_status *expr; 18490075Sobrien struct emit_status *emit; 18590075Sobrien struct varasm_status *varasm; 18618334Speter 18718334Speter /* For function.c. */ 18890075Sobrien 18990075Sobrien /* Name of this function. */ 19090075Sobrien const char *name; 19190075Sobrien 19290075Sobrien /* Points to the FUNCTION_DECL of this function. */ 19318334Speter tree decl; 19490075Sobrien 19590075Sobrien /* Function containing this function, if any. */ 19690075Sobrien struct function *outer; 19790075Sobrien 19890075Sobrien /* Number of bytes of args popped by function being compiled on its return. 19990075Sobrien Zero if no bytes are to be popped. 20090075Sobrien May affect compilation of return insn or of function epilogue. */ 20118334Speter int pops_args; 20290075Sobrien 20390075Sobrien /* If function's args have a fixed size, this is that size, in bytes. 20490075Sobrien Otherwise, it is -1. 20590075Sobrien May affect compilation of return insn or of function epilogue. */ 20618334Speter int args_size; 20790075Sobrien 20890075Sobrien /* # bytes the prologue should push and pretend that the caller pushed them. 20990075Sobrien The prologue must do this, but only if parms can be passed in 21090075Sobrien registers. */ 21118334Speter int pretend_args_size; 21290075Sobrien 21390075Sobrien /* # of bytes of outgoing arguments. If ACCUMULATE_OUTGOING_ARGS is 21490075Sobrien defined, the needed space is pushed by the prologue. */ 21590075Sobrien int outgoing_args_size; 21690075Sobrien 21790075Sobrien /* This is the offset from the arg pointer to the place where the first 21890075Sobrien anonymous arg can be found, if there is one. */ 21918334Speter rtx arg_offset_rtx; 22090075Sobrien 22190075Sobrien /* Quantities of various kinds of registers 22290075Sobrien used for the current function's args. */ 22390075Sobrien CUMULATIVE_ARGS args_info; 22490075Sobrien 225117395Skan /* If nonzero, an RTL expression for the location at which the current 22690075Sobrien function returns its result. If the current function returns its 22790075Sobrien result in a register, current_function_return_rtx will always be 22890075Sobrien the hard register containing the result. */ 22918334Speter rtx return_rtx; 23090075Sobrien 23190075Sobrien /* The arg pointer hard register, or the pseudo into which it was copied. */ 23218334Speter rtx internal_arg_pointer; 23318334Speter 23490075Sobrien /* Language-specific reason why the current function cannot be made 23590075Sobrien inline. */ 23690075Sobrien const char *cannot_inline; 23718334Speter 23890075Sobrien /* Opaque pointer used by get_hard_reg_initial_val and 23990075Sobrien has_hard_reg_initial_val (see integrate.[hc]). */ 24090075Sobrien struct initial_value_struct *hard_reg_initial_vals; 24150397Sobrien 24290075Sobrien /* Number of function calls seen so far in current function. */ 24390075Sobrien int x_function_call_count; 24418334Speter 24590075Sobrien /* List (chain of TREE_LIST) of LABEL_DECLs for all nonlocal labels 24690075Sobrien (labels to which there can be nonlocal gotos from nested functions) 24790075Sobrien in this function. */ 24890075Sobrien tree x_nonlocal_labels; 24918334Speter 25090075Sobrien /* List (chain of EXPR_LIST) of stack slots that hold the current handlers 25190075Sobrien for nonlocal gotos. There is one for every nonlocal label in the 25290075Sobrien function; this list matches the one in nonlocal_labels. 25390075Sobrien Zero when function does not have nonlocal labels. */ 25490075Sobrien rtx x_nonlocal_goto_handler_slots; 25518334Speter 25690075Sobrien /* List (chain of EXPR_LIST) of labels heading the current handlers for 25790075Sobrien nonlocal gotos. */ 25890075Sobrien rtx x_nonlocal_goto_handler_labels; 25918334Speter 26090075Sobrien /* RTX for stack slot that holds the stack pointer value to restore 26190075Sobrien for a nonlocal goto. 26290075Sobrien Zero when function does not have nonlocal labels. */ 26390075Sobrien rtx x_nonlocal_goto_stack_level; 26490075Sobrien 26590075Sobrien /* Label that will go on parm cleanup code, if any. 26690075Sobrien Jumping to this label runs cleanup code for parameters, if 26790075Sobrien such code must be run. Following this code is the logical return 26890075Sobrien label. */ 26990075Sobrien rtx x_cleanup_label; 27090075Sobrien 27190075Sobrien /* Label that will go on function epilogue. 27290075Sobrien Jumping to this label serves as a "return" instruction 27390075Sobrien on machines which require execution of the epilogue on all returns. */ 27490075Sobrien rtx x_return_label; 27590075Sobrien 276117395Skan /* Label and register for unswitching computed gotos. */ 277117395Skan rtx computed_goto_common_label; 278117395Skan rtx computed_goto_common_reg; 279117395Skan 28090075Sobrien /* List (chain of EXPR_LISTs) of pseudo-regs of SAVE_EXPRs. 28190075Sobrien So we can mark them all live at the end of the function, if nonopt. */ 28290075Sobrien rtx x_save_expr_regs; 28390075Sobrien 28490075Sobrien /* List (chain of EXPR_LISTs) of all stack slots in this function. 28590075Sobrien Made for the sake of unshare_all_rtl. */ 28690075Sobrien rtx x_stack_slot_list; 28790075Sobrien 28890075Sobrien /* Chain of all RTL_EXPRs that have insns in them. */ 28990075Sobrien tree x_rtl_expr_chain; 29090075Sobrien 29190075Sobrien /* Label to jump back to for tail recursion, or 0 if we have 29290075Sobrien not yet needed one for this function. */ 29390075Sobrien rtx x_tail_recursion_label; 29490075Sobrien 29590075Sobrien /* Place after which to insert the tail_recursion_label if we need one. */ 29690075Sobrien rtx x_tail_recursion_reentry; 29790075Sobrien 29890075Sobrien /* Location at which to save the argument pointer if it will need to be 29990075Sobrien referenced. There are two cases where this is done: if nonlocal gotos 30090075Sobrien exist, or if vars stored at an offset from the argument pointer will be 30190075Sobrien needed by inner routines. */ 30290075Sobrien rtx x_arg_pointer_save_area; 30390075Sobrien 30490075Sobrien /* If the function returns non-void, we will emit a clobber of the 30590075Sobrien return registers just in case the user fell off the end without 30690075Sobrien returning a proper value. This is that insn. */ 30790075Sobrien rtx x_clobber_return_insn; 30890075Sobrien 30990075Sobrien /* Offset to end of allocated area of stack frame. 31090075Sobrien If stack grows down, this is the address of the last stack slot allocated. 31190075Sobrien If stack grows up, this is the address for the next slot. */ 31290075Sobrien HOST_WIDE_INT x_frame_offset; 31390075Sobrien 31490075Sobrien /* List (chain of TREE_LISTs) of static chains for containing functions. 31590075Sobrien Each link has a FUNCTION_DECL in the TREE_PURPOSE and a reg rtx 31690075Sobrien in an RTL_EXPR in the TREE_VALUE. */ 31790075Sobrien tree x_context_display; 31890075Sobrien 31990075Sobrien /* List (chain of TREE_LISTs) of trampolines for nested functions. 32090075Sobrien The trampoline sets up the static chain and jumps to the function. 32190075Sobrien We supply the trampoline's address when the function's address is 32290075Sobrien requested. 32390075Sobrien 32490075Sobrien Each link has a FUNCTION_DECL in the TREE_PURPOSE and a reg rtx 32590075Sobrien in an RTL_EXPR in the TREE_VALUE. */ 32690075Sobrien tree x_trampoline_list; 32790075Sobrien 32890075Sobrien /* Insn after which register parms and SAVE_EXPRs are born, if nonopt. */ 32990075Sobrien rtx x_parm_birth_insn; 33090075Sobrien 33190075Sobrien /* Last insn of those whose job was to put parms into their nominal 33290075Sobrien homes. */ 33390075Sobrien rtx x_last_parm_insn; 33490075Sobrien 33590075Sobrien /* 1 + last pseudo register number possibly used for loading a copy 33690075Sobrien of a parameter of this function. */ 33790075Sobrien unsigned int x_max_parm_reg; 33890075Sobrien 33990075Sobrien /* Vector indexed by REGNO, containing location on stack in which 34090075Sobrien to put the parm which is nominally in pseudo register REGNO, 34190075Sobrien if we discover that that parm must go in the stack. The highest 34290075Sobrien element in this vector is one less than MAX_PARM_REG, above. */ 343117395Skan rtx * GTY ((length ("%h.x_max_parm_reg"))) x_parm_reg_stack_loc; 34490075Sobrien 34590075Sobrien /* List of all temporaries allocated, both available and in use. */ 34690075Sobrien struct temp_slot *x_temp_slots; 34790075Sobrien 34890075Sobrien /* Current nesting level for temporaries. */ 34990075Sobrien int x_temp_slot_level; 35090075Sobrien 35190075Sobrien /* Current nesting level for variables in a block. */ 35290075Sobrien int x_var_temp_slot_level; 35390075Sobrien 35490075Sobrien /* When temporaries are created by TARGET_EXPRs, they are created at 35590075Sobrien this level of temp_slot_level, so that they can remain allocated 35690075Sobrien until no longer needed. CLEANUP_POINT_EXPRs define the lifetime 35790075Sobrien of TARGET_EXPRs. */ 35890075Sobrien int x_target_temp_slot_level; 35990075Sobrien 36090075Sobrien /* This slot is initialized as 0 and is added to 36190075Sobrien during the nested function. */ 36290075Sobrien struct var_refs_queue *fixup_var_refs_queue; 36390075Sobrien 36418334Speter /* For integrate.c. */ 36590075Sobrien int inlinable; 36690075Sobrien int no_debugging_symbols; 367117395Skan rtvec original_arg_vector; 36890075Sobrien tree original_decl_initial; 36990075Sobrien /* Last insn of those whose job was to put parms into their nominal 37090075Sobrien homes. */ 37190075Sobrien rtx inl_last_parm_insn; 37290075Sobrien /* Highest label number in current function. */ 37390075Sobrien int inl_max_label_num; 37418334Speter 375117395Skan /* Function sequence number for profiling, debugging, etc. */ 376117395Skan int funcdef_no; 37796263Sobrien 37818334Speter /* For md files. */ 37990075Sobrien 38018334Speter /* tm.h can use this to store whatever it likes. */ 381117395Skan struct machine_function * GTY ((maybe_undef (""))) machine; 38290075Sobrien /* The largest alignment of slot allocated on the stack. */ 38390075Sobrien int stack_alignment_needed; 38490075Sobrien /* Preferred alignment of the end of stack frame. */ 38590075Sobrien int preferred_stack_boundary; 38618334Speter 38790075Sobrien /* Language-specific code can use this to store whatever it likes. */ 388117395Skan struct language_function * language; 38990075Sobrien 39018334Speter /* For reorg. */ 39190075Sobrien 39290075Sobrien /* If some insns can be deferred to the delay slots of the epilogue, the 39390075Sobrien delay list for them is recorded here. */ 39418334Speter rtx epilogue_delay_list; 39518334Speter 39690075Sobrien /* Collected bit flags. */ 39718334Speter 39890075Sobrien /* Nonzero if function being compiled needs to be given an address 39990075Sobrien where the value should be stored. */ 40090075Sobrien unsigned int returns_struct : 1; 40118334Speter 40290075Sobrien /* Nonzero if function being compiled needs to 40390075Sobrien return the address of where it has put a structure value. */ 40490075Sobrien unsigned int returns_pcc_struct : 1; 40590075Sobrien 40690075Sobrien /* Nonzero if the current function returns a pointer type. */ 40790075Sobrien unsigned int returns_pointer : 1; 40852284Sobrien 40990075Sobrien /* Nonzero if function being compiled needs to be passed a static chain. */ 41090075Sobrien unsigned int needs_context : 1; 41152284Sobrien 41290075Sobrien /* Nonzero if function being compiled can call setjmp. */ 41390075Sobrien unsigned int calls_setjmp : 1; 41452284Sobrien 41590075Sobrien /* Nonzero if function being compiled can call longjmp. */ 41690075Sobrien unsigned int calls_longjmp : 1; 41790075Sobrien 41890075Sobrien /* Nonzero if function being compiled can call alloca, 41990075Sobrien either as a subroutine or builtin. */ 42090075Sobrien unsigned int calls_alloca : 1; 42118334Speter 42290075Sobrien /* Nonzero if the function calls __builtin_eh_return. */ 42390075Sobrien unsigned int calls_eh_return : 1; 42452284Sobrien 42590075Sobrien /* Nonzero if function being compiled receives nonlocal gotos 42690075Sobrien from nested functions. */ 42790075Sobrien unsigned int has_nonlocal_label : 1; 42852284Sobrien 42990075Sobrien /* Nonzero if function being compiled has nonlocal gotos to parent 43090075Sobrien function. */ 43190075Sobrien unsigned int has_nonlocal_goto : 1; 43252284Sobrien 43390075Sobrien /* Nonzero if function being compiled contains nested functions. */ 43490075Sobrien unsigned int contains_functions : 1; 43552284Sobrien 43690075Sobrien /* Nonzero if the function being compiled issues a computed jump. */ 43790075Sobrien unsigned int has_computed_jump : 1; 43852284Sobrien 43990075Sobrien /* Nonzero if the current function is a thunk (a lightweight function that 44090075Sobrien just adjusts one of its arguments and forwards to another function), so 44190075Sobrien we should try to cut corners where we can. */ 44290075Sobrien unsigned int is_thunk : 1; 44352284Sobrien 444117395Skan /* This bit is used by the exception handling logic. It is set if all 445117395Skan calls (if any) are sibling calls. Such functions do not have to 446117395Skan have EH tables generated, as they cannot throw. A call to such a 447117395Skan function, however, should be treated as throwing if any of its callees 448117395Skan can throw. */ 449117395Skan unsigned int all_throwers_are_sibcalls : 1; 450117395Skan 45190075Sobrien /* Nonzero if instrumentation calls for function entry and exit should be 45290075Sobrien generated. */ 45390075Sobrien unsigned int instrument_entry_exit : 1; 45418334Speter 455117395Skan /* Nonzero if arc profiling should be done for the function. */ 456117395Skan unsigned int arc_profile : 1; 457117395Skan 45890075Sobrien /* Nonzero if profiling code should be generated. */ 45990075Sobrien unsigned int profile : 1; 46090075Sobrien 46190075Sobrien /* Nonzero if stack limit checking should be enabled in the current 46290075Sobrien function. */ 46390075Sobrien unsigned int limit_stack : 1; 46490075Sobrien 465117395Skan /* Nonzero if current function uses stdarg.h or equivalent. */ 46690075Sobrien unsigned int stdarg : 1; 46790075Sobrien 46890075Sobrien /* Nonzero if this function is being processed in function-at-a-time 46990075Sobrien mode. In other words, if all tree structure for this function, 47090075Sobrien including the BLOCK tree, is created before RTL generation 47190075Sobrien commences. */ 47290075Sobrien unsigned int x_whole_function_mode_p : 1; 47390075Sobrien 47490075Sobrien /* Nonzero if the back-end should not keep track of expressions that 47590075Sobrien determine the size of variable-sized objects. Normally, such 47690075Sobrien expressions are saved away, and then expanded when the next 47790075Sobrien function is started. For example, if a parameter has a 47890075Sobrien variable-sized type, then the size of the parameter is computed 47990075Sobrien when the function body is entered. However, some front-ends do 48090075Sobrien not desire this behavior. */ 48190075Sobrien unsigned int x_dont_save_pending_sizes_p : 1; 48290075Sobrien 48390075Sobrien /* Nonzero if the current function uses the constant pool. */ 48490075Sobrien unsigned int uses_const_pool : 1; 48590075Sobrien 48690075Sobrien /* Nonzero if the current function uses pic_offset_table_rtx. */ 48790075Sobrien unsigned int uses_pic_offset_table : 1; 48890075Sobrien 48990075Sobrien /* Nonzero if the current function needs an lsda for exception handling. */ 49090075Sobrien unsigned int uses_eh_lsda : 1; 49190075Sobrien 49290075Sobrien /* Nonzero if code to initialize arg_pointer_save_area has been emited. */ 49390075Sobrien unsigned int arg_pointer_save_area_init : 1; 494117395Skan 495117395Skan /* How commonly executed the function is. Initialized during branch 496117395Skan probabilities pass. */ 497117395Skan enum function_frequency { 498117395Skan /* This function most likely won't be executed at all. 499117395Skan (set only when profile feedback is available). */ 500117395Skan FUNCTION_FREQUENCY_UNLIKELY_EXECUTED, 501117395Skan /* The default value. */ 502117395Skan FUNCTION_FREQUENCY_NORMAL, 503117395Skan /* Optimize this function hard 504117395Skan (set only when profile feedback is available). */ 505117395Skan FUNCTION_FREQUENCY_HOT 506117395Skan } function_frequency; 507117395Skan 508117395Skan /* Maximal number of entities in the single jumptable. Used to estimate 509117395Skan final flowgraph size. */ 510117395Skan int max_jumptable_ents; 51190075Sobrien}; 51290075Sobrien 51390075Sobrien/* The function currently being compiled. */ 514117395Skanextern GTY(()) struct function *cfun; 51590075Sobrien 51690075Sobrien/* Nonzero if we've already converted virtual regs to hard regs. */ 51790075Sobrienextern int virtuals_instantiated; 51890075Sobrien 51990075Sobrien/* For backward compatibility... eventually these should all go away. */ 52090075Sobrien#define current_function_name (cfun->name) 52190075Sobrien#define current_function_pops_args (cfun->pops_args) 52290075Sobrien#define current_function_returns_struct (cfun->returns_struct) 52390075Sobrien#define current_function_returns_pcc_struct (cfun->returns_pcc_struct) 52490075Sobrien#define current_function_returns_pointer (cfun->returns_pointer) 52590075Sobrien#define current_function_needs_context (cfun->needs_context) 52690075Sobrien#define current_function_calls_setjmp (cfun->calls_setjmp) 52790075Sobrien#define current_function_calls_alloca (cfun->calls_alloca) 52890075Sobrien#define current_function_calls_longjmp (cfun->calls_longjmp) 52990075Sobrien#define current_function_calls_eh_return (cfun->calls_eh_return) 53090075Sobrien#define current_function_has_computed_jump (cfun->has_computed_jump) 53190075Sobrien#define current_function_contains_functions (cfun->contains_functions) 53290075Sobrien#define current_function_is_thunk (cfun->is_thunk) 53390075Sobrien#define current_function_args_info (cfun->args_info) 53490075Sobrien#define current_function_args_size (cfun->args_size) 53590075Sobrien#define current_function_pretend_args_size (cfun->pretend_args_size) 53690075Sobrien#define current_function_outgoing_args_size (cfun->outgoing_args_size) 53790075Sobrien#define current_function_arg_offset_rtx (cfun->arg_offset_rtx) 53890075Sobrien#define current_function_stdarg (cfun->stdarg) 53990075Sobrien#define current_function_internal_arg_pointer (cfun->internal_arg_pointer) 54090075Sobrien#define current_function_return_rtx (cfun->return_rtx) 54190075Sobrien#define current_function_instrument_entry_exit (cfun->instrument_entry_exit) 54290075Sobrien#define current_function_profile (cfun->profile) 543117395Skan#define current_function_funcdef_no (cfun->funcdef_no) 54490075Sobrien#define current_function_limit_stack (cfun->limit_stack) 54590075Sobrien#define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table) 54690075Sobrien#define current_function_uses_const_pool (cfun->uses_const_pool) 54790075Sobrien#define current_function_cannot_inline (cfun->cannot_inline) 54890075Sobrien#define current_function_epilogue_delay_list (cfun->epilogue_delay_list) 54990075Sobrien#define current_function_has_nonlocal_label (cfun->has_nonlocal_label) 55090075Sobrien#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto) 55190075Sobrien 55290075Sobrien#define max_parm_reg (cfun->x_max_parm_reg) 55390075Sobrien#define parm_reg_stack_loc (cfun->x_parm_reg_stack_loc) 55490075Sobrien#define cleanup_label (cfun->x_cleanup_label) 55590075Sobrien#define return_label (cfun->x_return_label) 55690075Sobrien#define save_expr_regs (cfun->x_save_expr_regs) 55790075Sobrien#define stack_slot_list (cfun->x_stack_slot_list) 55890075Sobrien#define parm_birth_insn (cfun->x_parm_birth_insn) 55990075Sobrien#define frame_offset (cfun->x_frame_offset) 56090075Sobrien#define tail_recursion_label (cfun->x_tail_recursion_label) 56190075Sobrien#define tail_recursion_reentry (cfun->x_tail_recursion_reentry) 56290075Sobrien#define arg_pointer_save_area (cfun->x_arg_pointer_save_area) 56390075Sobrien#define rtl_expr_chain (cfun->x_rtl_expr_chain) 56490075Sobrien#define last_parm_insn (cfun->x_last_parm_insn) 56590075Sobrien#define context_display (cfun->x_context_display) 56690075Sobrien#define trampoline_list (cfun->x_trampoline_list) 56790075Sobrien#define function_call_count (cfun->x_function_call_count) 56890075Sobrien#define temp_slots (cfun->x_temp_slots) 56990075Sobrien#define temp_slot_level (cfun->x_temp_slot_level) 57090075Sobrien#define target_temp_slot_level (cfun->x_target_temp_slot_level) 57190075Sobrien#define var_temp_slot_level (cfun->x_var_temp_slot_level) 57290075Sobrien#define nonlocal_labels (cfun->x_nonlocal_labels) 57390075Sobrien#define nonlocal_goto_handler_slots (cfun->x_nonlocal_goto_handler_slots) 57490075Sobrien#define nonlocal_goto_handler_labels (cfun->x_nonlocal_goto_handler_labels) 57590075Sobrien#define nonlocal_goto_stack_level (cfun->x_nonlocal_goto_stack_level) 57690075Sobrien 57790075Sobrien/* The FUNCTION_DECL for an inline function currently being expanded. */ 57890075Sobrienextern tree inline_function_decl; 57990075Sobrien 58018334Speter/* Given a function decl for a containing function, 58118334Speter return the `struct function' for it. */ 58290075Sobrienstruct function *find_function_data PARAMS ((tree)); 58318334Speter 58490075Sobrien/* Set NOTE_BLOCK for each block note in the current function. */ 58590075Sobrienextern void identify_blocks PARAMS ((void)); 58618334Speter 58790075Sobrien/* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END}, 58890075Sobrien and create duplicate blocks. */ 58990075Sobrienextern void reorder_blocks PARAMS ((void)); 59018334Speter 59190075Sobrien/* Set BLOCK_NUMBER for all the blocks in FN. */ 59290075Sobrienextern void number_blocks PARAMS ((tree)); 59390075Sobrien 59450397Sobrien/* Return size needed for stack frame based on slots so far allocated. 59550397Sobrien This size counts from zero. It is not rounded to STACK_BOUNDARY; 59650397Sobrien the caller may have to do that. */ 59790075Sobrienextern HOST_WIDE_INT get_frame_size PARAMS ((void)); 59890075Sobrien/* Likewise, but for a different than the current function. */ 59990075Sobrienextern HOST_WIDE_INT get_func_frame_size PARAMS ((struct function *)); 60050397Sobrien 601117395Skan/* A pointer to a function to create target specific, per-function 602117395Skan data structures. */ 603117395Skanextern struct machine_function * (*init_machine_status) PARAMS ((void)); 60418334Speter 60550397Sobrien/* Save and restore status information for a nested function. */ 60690075Sobrienextern void restore_emit_status PARAMS ((struct function *)); 60790075Sobrienextern void free_after_parsing PARAMS ((struct function *)); 60890075Sobrienextern void free_after_compilation PARAMS ((struct function *)); 60918334Speter 61090075Sobrienextern void init_varasm_status PARAMS ((struct function *)); 61150397Sobrien 61290075Sobrienextern rtx get_first_block_beg PARAMS ((void)); 61390075Sobrien 61490075Sobrien#ifdef RTX_CODE 61590075Sobrienextern void diddle_return_value PARAMS ((void (*)(rtx, void*), void*)); 61690075Sobrienextern void clobber_return_register PARAMS ((void)); 61790075Sobrienextern void use_return_register PARAMS ((void)); 61818334Speter#endif 61918334Speter 62090075Sobrienextern rtx get_arg_pointer_save_area PARAMS ((struct function *)); 62190075Sobrien 62290075Sobrienextern void init_virtual_regs PARAMS ((struct emit_status *)); 62390075Sobrien 62490075Sobrien/* Called once, at initialization, to initialize function.c. */ 62590075Sobrienextern void init_function_once PARAMS ((void)); 626