Home | History | Annotate | Line # | Download | only in gcc
      1 /* Structure for saving state for a nested function.
      2    Copyright (C) 1989-2022 Free Software Foundation, Inc.
      3 
      4 This file is part of GCC.
      5 
      6 GCC is free software; you can redistribute it and/or modify it under
      7 the terms of the GNU General Public License as published by the Free
      8 Software Foundation; either version 3, or (at your option) any later
      9 version.
     10 
     11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14 for more details.
     15 
     16 You should have received a copy of the GNU General Public License
     17 along with GCC; see the file COPYING3.  If not see
     18 <http://www.gnu.org/licenses/>.  */
     19 
     20 #ifndef GCC_FUNCTION_H
     21 #define GCC_FUNCTION_H
     22 
     23 
     24 /* Stack of pending (incomplete) sequences saved by `start_sequence'.
     25    Each element describes one pending sequence.
     26    The main insn-chain is saved in the last element of the chain,
     27    unless the chain is empty.  */
     28 
     29 struct GTY(()) sequence_stack {
     30   /* First and last insns in the chain of the saved sequence.  */
     31   rtx_insn *first;
     32   rtx_insn *last;
     33   struct sequence_stack *next;
     34 };
     35 
     36 struct GTY(()) emit_status {
     38   void ensure_regno_capacity ();
     39 
     40   /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
     41      After rtl generation, it is 1 plus the largest register number used.  */
     42   int x_reg_rtx_no;
     43 
     44   /* Lowest label number in current function.  */
     45   int x_first_label_num;
     46 
     47   /* seq.first and seq.last are the ends of the doubly-linked chain of
     48      rtl for the current function.  Both are reset to null at the
     49      start of rtl generation for the function.
     50 
     51      start_sequence saves both of these on seq.next and then starts
     52      a new, nested sequence of insns.
     53 
     54      seq.next is a stack of pending (incomplete) sequences saved by
     55      start_sequence.  Each element describes one pending sequence.
     56      The main insn-chain is the last element of the chain.  */
     57   struct sequence_stack seq;
     58 
     59   /* INSN_UID for next insn emitted.
     60      Reset to 1 for each function compiled.  */
     61   int x_cur_insn_uid;
     62 
     63   /* INSN_UID for next debug insn emitted.  Only used if
     64      --param min-nondebug-insn-uid=<value> is given with nonzero value.  */
     65   int x_cur_debug_insn_uid;
     66 
     67   /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
     68      vectors.  Since these vectors are needed during the expansion phase when
     69      the total number of registers in the function is not yet known, the
     70      vectors are copied and made bigger when necessary.  */
     71   int regno_pointer_align_length;
     72 
     73   /* Indexed by pseudo register number, if nonzero gives the known alignment
     74      for that pseudo (if REG_POINTER is set in x_regno_reg_rtx).
     75      Allocated in parallel with x_regno_reg_rtx.  */
     76   unsigned char * GTY((skip)) regno_pointer_align;
     77 };
     78 
     79 
     80 /* Indexed by register number, gives an rtx for that register (and only
     81    that register).  For pseudo registers, it is the unique rtx for
     82    that pseudo.  For hard registers, it is an rtx of the mode specified
     83    by reg_raw_mode.
     84 
     85    FIXME: We could put it into emit_status struct, but gengtype is not
     86    able to deal with length attribute nested in top level structures.  */
     87 
     88 extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx;
     89 
     90 /* For backward compatibility... eventually these should all go away.  */
     91 #define reg_rtx_no (crtl->emit.x_reg_rtx_no)
     92 
     93 #define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO])
     94 
     95 struct GTY(()) expr_status {
     96   /* Number of units that we should eventually pop off the stack.
     97      These are the arguments to function calls that have already returned.  */
     98   poly_int64_pod x_pending_stack_adjust;
     99 
    100   /* Under some ABIs, it is the caller's responsibility to pop arguments
    101      pushed for function calls.  A naive implementation would simply pop
    102      the arguments immediately after each call.  However, if several
    103      function calls are made in a row, it is typically cheaper to pop
    104      all the arguments after all of the calls are complete since a
    105      single pop instruction can be used.  Therefore, GCC attempts to
    106      defer popping the arguments until absolutely necessary.  (For
    107      example, at the end of a conditional, the arguments must be popped,
    108      since code outside the conditional won't know whether or not the
    109      arguments need to be popped.)
    110 
    111      When INHIBIT_DEFER_POP is nonzero, however, the compiler does not
    112      attempt to defer pops.  Instead, the stack is popped immediately
    113      after each call.  Rather then setting this variable directly, use
    114      NO_DEFER_POP and OK_DEFER_POP.  */
    115   int x_inhibit_defer_pop;
    116 
    117   /* If PREFERRED_STACK_BOUNDARY and PUSH_ROUNDING are defined, the stack
    118      boundary can be momentarily unaligned while pushing the arguments.
    119      Record the delta since last aligned boundary here in order to get
    120      stack alignment in the nested function calls working right.  */
    121   poly_int64_pod x_stack_pointer_delta;
    122 
    123   /* Nonzero means __builtin_saveregs has already been done in this function.
    124      The value is the pseudoreg containing the value __builtin_saveregs
    125      returned.  */
    126   rtx x_saveregs_value;
    127 
    128   /* Similarly for __builtin_apply_args.  */
    129   rtx x_apply_args_value;
    130 
    131   /* List of labels that must never be deleted.  */
    132   vec<rtx_insn *, va_gc> *x_forced_labels;
    133 };
    134 
    135 typedef struct call_site_record_d *call_site_record;
    136 
    137 /* RTL representation of exception handling.  */
    138 struct GTY(()) rtl_eh {
    139   rtx ehr_stackadj;
    140   rtx ehr_handler;
    141   rtx_code_label *ehr_label;
    142 
    143   rtx sjlj_fc;
    144   rtx_insn *sjlj_exit_after;
    145 
    146   vec<uchar, va_gc> *action_record_data;
    147 
    148   vec<call_site_record, va_gc> *call_site_record_v[2];
    149 };
    150 
    151 #define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
    152 #define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop)
    153 #define saveregs_value (crtl->expr.x_saveregs_value)
    154 #define apply_args_value (crtl->expr.x_apply_args_value)
    155 #define forced_labels (crtl->expr.x_forced_labels)
    156 #define stack_pointer_delta (crtl->expr.x_stack_pointer_delta)
    157 
    158 struct gimple_df;
    159 struct call_site_record_d;
    160 struct dw_fde_node;
    161 class range_query;
    162 
    163 struct GTY(()) varasm_status {
    164   /* If we're using a per-function constant pool, this is it.  */
    165   struct rtx_constant_pool *pool;
    166 
    167   /* Number of tree-constants deferred during the expansion of this
    168      function.  */
    169   unsigned int deferred_constants;
    170 };
    171 
    172 
    173 /* Data for function partitioning.  */
    174 struct GTY(()) function_subsections {
    175   /* Assembly labels for the hot and cold text sections, to
    176      be used by debugger functions for determining the size of text
    177      sections.  */
    178 
    179   const char *hot_section_label;
    180   const char *cold_section_label;
    181   const char *hot_section_end_label;
    182   const char *cold_section_end_label;
    183 };
    184 
    185 /* Describe an empty area of space in the stack frame.  These can be chained
    186    into a list; this is used to keep track of space wasted for alignment
    187    reasons.  */
    188 class GTY(()) frame_space
    189 {
    190 public:
    191   class frame_space *next;
    192 
    193   poly_int64 start;
    194   poly_int64 length;
    195 };
    196 
    197 /* Describe emitted calls for -fcallgraph-info.  */
    198 struct GTY(()) callinfo_callee
    199 {
    200   location_t location;
    201   tree decl;
    202 };
    203 
    204 /* Describe dynamic allocation for -fcallgraph-info=da.  */
    205 struct GTY(()) callinfo_dalloc
    206 {
    207   location_t location;
    208   char const *name;
    209 };
    210 
    211 class GTY(()) stack_usage
    212 {
    213 public:
    214   /* # of bytes of static stack space allocated by the function.  */
    215   HOST_WIDE_INT static_stack_size;
    216 
    217   /* # of bytes of dynamic stack space allocated by the function.  This is
    218      meaningful only if has_unbounded_dynamic_stack_size is zero.  */
    219   HOST_WIDE_INT dynamic_stack_size;
    220 
    221   /* Upper bound on the number of bytes pushed onto the stack after the
    222      prologue.  If !ACCUMULATE_OUTGOING_ARGS, it contains the outgoing
    223      arguments.  */
    224   poly_int64 pushed_stack_size;
    225 
    226   /* Nonzero if the amount of stack space allocated dynamically cannot
    227      be bounded at compile-time.  */
    228   unsigned int has_unbounded_dynamic_stack_size : 1;
    229 
    230   /* Functions called within the function, if callgraph is enabled.  */
    231   vec<callinfo_callee, va_gc> *callees;
    232 
    233   /* Dynamic allocations encountered within the function, if callgraph
    234      da is enabled.  */
    235   vec<callinfo_dalloc, va_gc> *dallocs;
    236 };
    237 
    238 #define current_function_static_stack_size (cfun->su->static_stack_size)
    239 #define current_function_dynamic_stack_size (cfun->su->dynamic_stack_size)
    240 #define current_function_pushed_stack_size (cfun->su->pushed_stack_size)
    241 #define current_function_has_unbounded_dynamic_stack_size \
    242   (cfun->su->has_unbounded_dynamic_stack_size)
    243 #define current_function_allocates_dynamic_stack_space    \
    244   (current_function_dynamic_stack_size != 0               \
    245    || current_function_has_unbounded_dynamic_stack_size)
    246 
    247 /* This structure can save all the important global and static variables
    248    describing the status of the current function.  */
    249 
    250 struct GTY(()) function {
    251   struct eh_status *eh;
    252 
    253   /* The control flow graph for this function.  */
    254   struct control_flow_graph *cfg;
    255 
    256   /* GIMPLE body for this function.  */
    257   gimple_seq gimple_body;
    258 
    259   /* SSA and dataflow information.  */
    260   struct gimple_df *gimple_df;
    261 
    262   /* The loops in this function.  */
    263   struct loops *x_current_loops;
    264 
    265   /* Filled by the GIMPLE and RTL FEs, pass to start compilation with.  */
    266   char *pass_startwith;
    267 
    268   /* The stack usage of this function.  */
    269   class stack_usage *su;
    270 
    271   /* Value histograms attached to particular statements.  */
    272   htab_t GTY((skip)) value_histograms;
    273 
    274   /* For function.cc.  */
    275 
    276   /* Points to the FUNCTION_DECL of this function.  */
    277   tree decl;
    278 
    279   /* A PARM_DECL that should contain the static chain for this function.
    280      It will be initialized at the beginning of the function.  */
    281   tree static_chain_decl;
    282 
    283   /* An expression that contains the non-local goto save area.  The first
    284      word is the saved frame pointer and the second is the saved stack
    285      pointer.  */
    286   tree nonlocal_goto_save_area;
    287 
    288   /* Vector of function local variables, functions, types and constants.  */
    289   vec<tree, va_gc> *local_decls;
    290 
    291   /* For md files.  */
    292 
    293   /* tm.h can use this to store whatever it likes.  */
    294   struct machine_function * GTY ((maybe_undef)) machine;
    295 
    296   /* Language-specific code can use this to store whatever it likes.  */
    297   struct language_function * language;
    298 
    299   /* Used types hash table.  */
    300   hash_set<tree> *GTY (()) used_types_hash;
    301 
    302   /* Dwarf2 Frame Description Entry, containing the Call Frame Instructions
    303      used for unwinding.  Only set when either dwarf2 unwinding or dwarf2
    304      debugging is enabled.  */
    305   struct dw_fde_node *fde;
    306 
    307   /* Range query mechanism for functions.  The default is to pick up
    308      global ranges.  If a pass wants on-demand ranges OTOH, it must
    309      call enable/disable_ranger().  The pointer is never null.  It
    310      should be queried by calling get_range_query().  */
    311   range_query * GTY ((skip)) x_range_query;
    312 
    313   /* Last statement uid.  */
    314   int last_stmt_uid;
    315 
    316   /* Debug marker counter.  Count begin stmt markers.  We don't have
    317      to keep it exact, it's more of a rough estimate to enable us to
    318      decide whether they are too many to copy during inlining, or when
    319      expanding to RTL.  */
    320   int debug_marker_count;
    321 
    322   /* Function sequence number for profiling, debugging, etc.  */
    323   int funcdef_no;
    324 
    325   /* Line number of the start of the function for debugging purposes.  */
    326   location_t function_start_locus;
    327 
    328   /* Line number of the end of the function.  */
    329   location_t function_end_locus;
    330 
    331   /* Properties used by the pass manager.  */
    332   unsigned int curr_properties;
    333   unsigned int last_verified;
    334 
    335   /* Different from normal TODO_flags which are handled right at the
    336      beginning or the end of one pass execution, the pending_TODOs
    337      are passed down in the pipeline until one of its consumers can
    338      perform the requested action.  Consumers should then clear the
    339      flags for the actions that they have taken.  */
    340   unsigned int pending_TODOs;
    341 
    342   /* Non-null if the function does something that would prevent it from
    343      being copied; this applies to both versioning and inlining.  Set to
    344      a string describing the reason for failure.  */
    345   const char * GTY((skip)) cannot_be_copied_reason;
    346 
    347   /* Last assigned dependence info clique.  */
    348   unsigned short last_clique;
    349 
    350   /* Collected bit flags.  */
    351 
    352   /* Number of units of general registers that need saving in stdarg
    353      function.  What unit is depends on the backend, either it is number
    354      of bytes, or it can be number of registers.  */
    355   unsigned int va_list_gpr_size : 8;
    356 
    357   /* Number of units of floating point registers that need saving in stdarg
    358      function.  */
    359   unsigned int va_list_fpr_size : 8;
    360 
    361   /* Nonzero if function being compiled can call setjmp.  */
    362   unsigned int calls_setjmp : 1;
    363 
    364   /* Nonzero if function being compiled can call alloca,
    365      either as a subroutine or builtin.  */
    366   unsigned int calls_alloca : 1;
    367 
    368   /* Nonzero if function being compiled can call __builtin_eh_return.  */
    369   unsigned int calls_eh_return : 1;
    370 
    371   /* Nonzero if function being compiled receives nonlocal gotos
    372      from nested functions.  */
    373   unsigned int has_nonlocal_label : 1;
    374 
    375   /* Nonzero if function being compiled has a forced label
    376      placed into static storage.  */
    377   unsigned int has_forced_label_in_static : 1;
    378 
    379   /* Nonzero if we've set cannot_be_copied_reason.  I.e. if
    380      (cannot_be_copied_set && !cannot_be_copied_reason), the function
    381      can in fact be copied.  */
    382   unsigned int cannot_be_copied_set : 1;
    383 
    384   /* Nonzero if current function uses stdarg.h or equivalent.  */
    385   unsigned int stdarg : 1;
    386 
    387   unsigned int after_inlining : 1;
    388   unsigned int always_inline_functions_inlined : 1;
    389 
    390   /* Nonzero if function being compiled can throw synchronous non-call
    391      exceptions.  */
    392   unsigned int can_throw_non_call_exceptions : 1;
    393 
    394   /* Nonzero if instructions that may throw exceptions but don't otherwise
    395      contribute to the execution of the program can be deleted.  */
    396   unsigned int can_delete_dead_exceptions : 1;
    397 
    398   /* Fields below this point are not set for abstract functions; see
    399      allocate_struct_function.  */
    400 
    401   /* Nonzero if function being compiled needs to be given an address
    402      where the value should be stored.  */
    403   unsigned int returns_struct : 1;
    404 
    405   /* Nonzero if function being compiled needs to
    406      return the address of where it has put a structure value.  */
    407   unsigned int returns_pcc_struct : 1;
    408 
    409   /* Nonzero if this function has local DECL_HARD_REGISTER variables.
    410      In this case code motion has to be done more carefully.  */
    411   unsigned int has_local_explicit_reg_vars : 1;
    412 
    413   /* Nonzero if the current function is a thunk, i.e., a lightweight
    414      function implemented by the output_mi_thunk hook) that just
    415      adjusts one of its arguments and forwards to another
    416      function.  */
    417   unsigned int is_thunk : 1;
    418 
    419   /* Nonzero if the current function contains any loops with
    420      loop->force_vectorize set.  */
    421   unsigned int has_force_vectorize_loops : 1;
    422 
    423   /* Nonzero if the current function contains any loops with
    424      nonzero value in loop->simduid.  */
    425   unsigned int has_simduid_loops : 1;
    426 
    427   /* Nonzero when the tail call has been identified.  */
    428   unsigned int tail_call_marked : 1;
    429 
    430   /* Nonzero if the current function contains a #pragma GCC unroll.  */
    431   unsigned int has_unroll : 1;
    432 
    433   /* Set when the function was compiled with generation of debug
    434      (begin stmt, inline entry, ...) markers enabled.  */
    435   unsigned int debug_nonbind_markers : 1;
    436 
    437   /* Set if this is a coroutine-related function.  */
    438   unsigned int coroutine_component : 1;
    439 
    440   /* Set if there are any OMP_TARGET regions in the function.  */
    441   unsigned int has_omp_target : 1;
    442 };
    443 
    444 /* Add the decl D to the local_decls list of FUN.  */
    445 
    446 void add_local_decl (struct function *fun, tree d);
    447 
    448 #define FOR_EACH_LOCAL_DECL(FUN, I, D)		\
    449   FOR_EACH_VEC_SAFE_ELT_REVERSE ((FUN)->local_decls, I, D)
    450 
    451 /* Record a final call to CALLEE at LOCATION.  */
    452 void record_final_call (tree callee, location_t location);
    453 
    454 /* Record a dynamic allocation made for DECL_OR_EXP.  */
    455 void record_dynamic_alloc (tree decl_or_exp);
    456 
    457 /* If va_list_[gf]pr_size is set to this, it means we don't know how
    458    many units need to be saved.  */
    459 #define VA_LIST_MAX_GPR_SIZE	255
    460 #define VA_LIST_MAX_FPR_SIZE	255
    461 
    462 /* The function currently being compiled.  */
    463 extern GTY(()) struct function *cfun;
    464 
    465 /* In order to ensure that cfun is not set directly, we redefine it so
    466    that it is not an lvalue.  Rather than assign to cfun, use
    467    push_cfun or set_cfun.  */
    468 #define cfun (cfun + 0)
    469 
    470 /* Nonzero if we've already converted virtual regs to hard regs.  */
    471 extern int virtuals_instantiated;
    472 
    473 /* Nonzero if at least one trampoline has been created.  */
    474 extern int trampolines_created;
    475 
    476 struct GTY((for_user)) types_used_by_vars_entry {
    477   tree type;
    478   tree var_decl;
    479 };
    480 
    481 struct used_type_hasher : ggc_ptr_hash<types_used_by_vars_entry>
    482 {
    483   static hashval_t hash (types_used_by_vars_entry *);
    484   static bool equal (types_used_by_vars_entry *, types_used_by_vars_entry *);
    485 };
    486 
    487 /* Hash table making the relationship between a global variable
    488    and the types it references in its initializer. The key of the
    489    entry is a referenced type, and the value is the DECL of the global
    490    variable. types_use_by_vars_do_hash and types_used_by_vars_eq below are
    491    the hash and equality functions to use for this hash table.  */
    492 extern GTY(()) hash_table<used_type_hasher> *types_used_by_vars_hash;
    493 
    494 void types_used_by_var_decl_insert (tree type, tree var_decl);
    495 
    496 /* During parsing of a global variable, this vector contains the types
    497    referenced by the global variable.  */
    498 extern GTY(()) vec<tree, va_gc> *types_used_by_cur_var_decl;
    499 
    500 
    501 /* Return the loop tree of FN.  */
    502 
    503 inline struct loops *
    504 loops_for_fn (struct function *fn)
    505 {
    506   return fn->x_current_loops;
    507 }
    508 
    509 /* Set the loop tree of FN to LOOPS.  */
    510 
    511 inline void
    512 set_loops_for_fn (struct function *fn, struct loops *loops)
    513 {
    514   gcc_checking_assert (fn->x_current_loops == NULL || loops == NULL);
    515   fn->x_current_loops = loops;
    516 }
    517 
    518 /* For backward compatibility... eventually these should all go away.  */
    519 #define current_function_funcdef_no (cfun->funcdef_no)
    520 
    521 #define current_loops (cfun->x_current_loops)
    522 #define dom_computed (cfun->cfg->x_dom_computed)
    523 #define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree)
    524 #define VALUE_HISTOGRAMS(fun) (fun)->value_histograms
    525 
    526 /* A pointer to a function to create target specific, per-function
    527    data structures.  */
    528 extern struct machine_function * (*init_machine_status) (void);
    529 
    530 /* Structure to record the size of a sequence of arguments
    531    as the sum of a tree-expression and a constant.  This structure is
    532    also used to store offsets from the stack, which might be negative,
    533    so the variable part must be ssizetype, not sizetype.  */
    534 
    535 struct args_size
    536 {
    537   poly_int64_pod constant;
    538   tree var;
    539 };
    540 
    541 /* Package up various arg related fields of struct args for
    542    locate_and_pad_parm.  */
    543 struct locate_and_pad_arg_data
    544 {
    545   /* Size of this argument on the stack, rounded up for any padding it
    546      gets.  If REG_PARM_STACK_SPACE is defined, then register parms are
    547      counted here, otherwise they aren't.  */
    548   struct args_size size;
    549   /* Offset of this argument from beginning of stack-args.  */
    550   struct args_size offset;
    551   /* Offset to the start of the stack slot.  Different from OFFSET
    552      if this arg pads downward.  */
    553   struct args_size slot_offset;
    554   /* The amount that the stack pointer needs to be adjusted to
    555      force alignment for the next argument.  */
    556   struct args_size alignment_pad;
    557   /* Which way we should pad this arg.  */
    558   pad_direction where_pad;
    559   /* slot_offset is at least this aligned.  */
    560   unsigned int boundary;
    561 };
    562 
    563 /* Add the value of the tree INC to the `struct args_size' TO.  */
    564 
    565 #define ADD_PARM_SIZE(TO, INC)					\
    566 do {								\
    567   tree inc = (INC);						\
    568   if (tree_fits_shwi_p (inc))					\
    569     (TO).constant += tree_to_shwi (inc);			\
    570   else if ((TO).var == 0)					\
    571     (TO).var = fold_convert (ssizetype, inc);			\
    572   else								\
    573     (TO).var = size_binop (PLUS_EXPR, (TO).var,			\
    574 			   fold_convert (ssizetype, inc));	\
    575 } while (0)
    576 
    577 #define SUB_PARM_SIZE(TO, DEC)					\
    578 do {								\
    579   tree dec = (DEC);						\
    580   if (tree_fits_shwi_p (dec))					\
    581     (TO).constant -= tree_to_shwi (dec);			\
    582   else if ((TO).var == 0)					\
    583     (TO).var = size_binop (MINUS_EXPR, ssize_int (0),		\
    584 			   fold_convert (ssizetype, dec));	\
    585   else								\
    586     (TO).var = size_binop (MINUS_EXPR, (TO).var,		\
    587 			   fold_convert (ssizetype, dec));	\
    588 } while (0)
    589 
    590 /* Convert the implicit sum in a `struct args_size' into a tree
    591    of type ssizetype.  */
    592 #define ARGS_SIZE_TREE(SIZE)					\
    593 ((SIZE).var == 0 ? ssize_int ((SIZE).constant)			\
    594  : size_binop (PLUS_EXPR, fold_convert (ssizetype, (SIZE).var),	\
    595 	       ssize_int ((SIZE).constant)))
    596 
    597 /* Convert the implicit sum in a `struct args_size' into an rtx.  */
    598 #define ARGS_SIZE_RTX(SIZE)					\
    599 ((SIZE).var == 0 ? gen_int_mode ((SIZE).constant, Pmode)	\
    600  : expand_normal (ARGS_SIZE_TREE (SIZE)))
    601 
    602 #define ASLK_REDUCE_ALIGN 1
    603 #define ASLK_RECORD_PAD 2
    604 
    605 /* If pointers to member functions use the least significant bit to
    606    indicate whether a function is virtual, ensure a pointer
    607    to this function will have that bit clear.  */
    608 #define MINIMUM_METHOD_BOUNDARY \
    609   ((TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)	     \
    610    ? MAX (FUNCTION_BOUNDARY, 2 * BITS_PER_UNIT) : FUNCTION_BOUNDARY)
    611 
    612 enum stack_clash_probes {
    613   NO_PROBE_NO_FRAME,
    614   NO_PROBE_SMALL_FRAME,
    615   PROBE_INLINE,
    616   PROBE_LOOP
    617 };
    618 
    619 extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);
    620 
    621 
    623 extern void push_function_context (void);
    624 extern void pop_function_context (void);
    625 
    626 /* Save and restore status information for a nested function.  */
    627 extern void free_after_parsing (struct function *);
    628 extern void free_after_compilation (struct function *);
    629 
    630 /* Return size needed for stack frame based on slots so far allocated.
    631    This size counts from zero.  It is not rounded to STACK_BOUNDARY;
    632    the caller may have to do that.  */
    633 extern poly_int64 get_frame_size (void);
    634 
    635 /* Issue an error message and return TRUE if frame OFFSET overflows in
    636    the signed target pointer arithmetics for function FUNC.  Otherwise
    637    return FALSE.  */
    638 extern bool frame_offset_overflow (poly_int64, tree);
    639 
    640 extern unsigned int spill_slot_alignment (machine_mode);
    641 
    642 extern rtx assign_stack_local_1 (machine_mode, poly_int64, int, int);
    643 extern rtx assign_stack_local (machine_mode, poly_int64, int);
    644 extern rtx assign_stack_temp_for_type (machine_mode, poly_int64, tree);
    645 extern rtx assign_stack_temp (machine_mode, poly_int64);
    646 extern rtx assign_temp (tree, int, int);
    647 extern void update_temp_slot_address (rtx, rtx);
    648 extern void preserve_temp_slots (rtx);
    649 extern void free_temp_slots (void);
    650 extern void push_temp_slots (void);
    651 extern void pop_temp_slots (void);
    652 extern void init_temp_slots (void);
    653 extern rtx get_hard_reg_initial_reg (rtx);
    654 extern rtx get_hard_reg_initial_val (machine_mode, unsigned int);
    655 extern rtx has_hard_reg_initial_val (machine_mode, unsigned int);
    656 
    657 /* Called from gimple_expand_cfg.  */
    658 extern unsigned int emit_initial_value_sets (void);
    659 
    660 extern bool initial_value_entry (int i, rtx *, rtx *);
    661 extern void instantiate_decl_rtl (rtx x);
    662 extern int aggregate_value_p (const_tree, const_tree);
    663 extern bool use_register_for_decl (const_tree);
    664 extern gimple_seq gimplify_parameters (gimple_seq *);
    665 extern void locate_and_pad_parm (machine_mode, tree, int, int, int,
    666 				 tree, struct args_size *,
    667 				 struct locate_and_pad_arg_data *);
    668 extern void generate_setjmp_warnings (void);
    669 
    670 /* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END},
    671    and create duplicate blocks.  */
    672 extern void reorder_blocks (void);
    673 extern void clear_block_marks (tree);
    674 extern tree blocks_nreverse (tree);
    675 extern tree block_chainon (tree, tree);
    676 
    677 /* Set BLOCK_NUMBER for all the blocks in FN.  */
    678 extern void number_blocks (tree);
    679 
    680 /* cfun shouldn't be set directly; use one of these functions instead.  */
    681 extern void set_cfun (struct function *new_cfun, bool force = false);
    682 extern void push_cfun (struct function *new_cfun);
    683 extern void pop_cfun (void);
    684 
    685 extern int get_next_funcdef_no (void);
    686 extern int get_last_funcdef_no (void);
    687 extern void allocate_struct_function (tree, bool);
    688 extern void push_struct_function (tree fndecl, bool = false);
    689 extern void push_dummy_function (bool);
    690 extern void pop_dummy_function (void);
    691 extern void init_dummy_function_start (void);
    692 extern void init_function_start (tree);
    693 extern void stack_protect_epilogue (void);
    694 extern void expand_function_start (tree);
    695 extern void expand_dummy_function_end (void);
    696 
    697 extern void thread_prologue_and_epilogue_insns (void);
    698 extern void diddle_return_value (void (*)(rtx, void*), void*);
    699 extern void clobber_return_register (void);
    700 extern void expand_function_end (void);
    701 extern rtx get_arg_pointer_save_area (void);
    702 extern void maybe_copy_prologue_epilogue_insn (rtx, rtx);
    703 extern int prologue_contains (const rtx_insn *);
    704 extern int epilogue_contains (const rtx_insn *);
    705 extern int prologue_epilogue_contains (const rtx_insn *);
    706 extern void record_prologue_seq (rtx_insn *);
    707 extern void record_epilogue_seq (rtx_insn *);
    708 extern void emit_return_into_block (bool simple_p, basic_block bb);
    709 extern void set_return_jump_label (rtx_insn *);
    710 extern bool active_insn_between (rtx_insn *head, rtx_insn *tail);
    711 extern vec<edge> convert_jumps_to_returns (basic_block last_bb, bool simple_p,
    712 					   vec<edge> unconverted);
    713 extern basic_block emit_return_for_exit (edge exit_fallthru_edge,
    714 					 bool simple_p);
    715 extern void reposition_prologue_and_epilogue_notes (void);
    716 
    717 /* Returns the name of the current function.  */
    718 extern const char *fndecl_name (tree);
    719 extern const char *function_name (struct function *);
    720 extern const char *current_function_name (void);
    721 
    722 extern void used_types_insert (tree);
    723 
    724 extern bool currently_expanding_function_start;
    725 
    726 #endif  /* GCC_FUNCTION_H */
    727