home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / calls.c < prev    next >
C/C++ Source or Header  |  1992-03-17  |  58KB  |  1,787 lines

  1. /* Convert function calls to rtl insns, for GNU C compiler.
  2.    Copyright (C) 1989, 1990 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include "config.h"
  21. #include "rtl.h"
  22. #include "tree.h"
  23. #include "flags.h"
  24. #include "expr.h"
  25. #include "insn-flags.h"
  26.  
  27. #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
  28. #define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
  29.  
  30. /* Decide whether a function's arguments should be processed
  31.    from first to last or from last to first.  */
  32.  
  33. #ifdef STACK_GROWS_DOWNWARD
  34. #ifdef PUSH_ROUNDING
  35. #define PUSH_ARGS_REVERSED    /* If it's last to first */
  36. #endif
  37. #endif
  38.  
  39. /* Like STACK_BOUNDARY but in units of bytes, not bits.  */
  40. #define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
  41.  
  42. /* Data structure and subroutines used within expand_call.  */
  43.  
  44. struct arg_data
  45. {
  46.   /* Tree node for this argument.  */
  47.   tree tree_value;
  48.   /* Precomputed RTL value, or 0 if it isn't precomputed.  */
  49.   rtx value;
  50.   /* Register to pass this argument in, 0 if passed on stack, or an
  51.      EXPR_LIST if the arg is to be copied into multiple different
  52.      registers.  */
  53.   rtx reg;
  54.   /* Number of registers to use.  0 means put the whole arg in registers.
  55.      Also 0 if not passed in registers.  */
  56.   int partial;
  57.   /* Non-zero if argument must be passed on stack.  */
  58.   int pass_on_stack;
  59.   /* Offset of this argument from beginning of stack-args.  */
  60.   struct args_size offset;
  61.   /* Similar, but offset to the start of the stack slot.  Different from
  62.      OFFSET if this arg pads downward.  */
  63.   struct args_size slot_offset;
  64.   /* Size of this argument on the stack, rounded up for any padding it gets,
  65.      parts of the argument passed in registers do not count.
  66.      If REG_PARM_STACK_SPACE is defined, then register parms
  67.      are counted here as well.  */
  68.   struct args_size size;
  69.   /* Location on the stack at which parameter should be stored.  The store
  70.      has already been done if STACK == VALUE.  */
  71.   rtx stack;
  72.   /* Location on the stack of the start of this argument slot.  This can
  73.      differ from STACK if this arg pads downward.  This location is known
  74.      to be aligned to FUNCTION_ARG_BOUNDARY.  */
  75.   rtx stack_slot;
  76. #ifdef ACCUMULATE_OUTGOING_ARGS
  77.   /* Place that this stack area has been saved, if needed.  */
  78.   rtx save_area;
  79. #endif
  80. };
  81.  
  82. #ifdef ACCUMULATE_OUTGOING_ARGS
  83. /* A vector of one char per word of stack space.  A byte if non-zero if
  84.    the corresponding stack location has been used.
  85.    This vector is used to prevent a function call within an argument from
  86.    clobbering any stack already set up.  */
  87. static char *stack_usage_map;
  88.  
  89. /* Size of STACK_USAGE_MAP.  */
  90. static int highest_outgoing_arg_in_use;
  91. #endif
  92.  
  93. static void store_one_arg ();
  94. extern enum machine_mode mode_for_size ();
  95.  
  96. #ifdef NeXT
  97. /* Return 1 if EXP contains a call to the built-in function `alloca'.  */
  98.  
  99. static int
  100. calls_alloca (exp)
  101.      tree exp;
  102. {
  103.   register int i;
  104.   int type = TREE_CODE_CLASS (TREE_CODE (exp));
  105.   int length = tree_code_length[(int) TREE_CODE (exp)];
  106.  
  107.   /* Only expressions and references can contain calls.  */
  108.  
  109.   if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r')
  110.     return 0;
  111.  
  112.   switch (TREE_CODE (exp))
  113.     {
  114.     case CALL_EXPR:
  115.       if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
  116.       && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  117.           == FUNCTION_DECL)
  118.       && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  119.       && (DECL_FUNCTION_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
  120.           == BUILT_IN_ALLOCA))
  121.     return 1;
  122.  
  123.       /* Third operand is RTL.  */
  124.       length = 2;
  125.       break;
  126.  
  127.     case SAVE_EXPR:
  128.       if (SAVE_EXPR_RTL (exp) != 0)
  129.     return 0;
  130.       break;
  131.  
  132.     case BLOCK:
  133.       /* Must not look at BLOCK_SUPERCONTEXT since it will point back to
  134.      us.  */
  135.       length = 3;
  136.       break;
  137.  
  138.     case METHOD_CALL_EXPR:
  139.       length = 3;
  140.       break;
  141.  
  142.     case WITH_CLEANUP_EXPR:
  143.       length = 1;
  144.       break;
  145.  
  146.     case RTL_EXPR:
  147.       return 0;
  148.     }
  149.  
  150.   for (i = 0; i < length; i++)
  151.     if (TREE_OPERAND (exp, i) != 0
  152.     && calls_alloca (TREE_OPERAND (exp, i)))
  153.       return 1;
  154.  
  155.   return 0;
  156. }
  157. #endif /* NeXT */
  158.  
  159. /* Force FUNEXP into a form suitable for the address of a CALL,
  160.    and return that as an rtx.  Also load the static chain register
  161.    if FNDECL is a nested function.
  162.  
  163.    USE_INSNS is a chain of USE insns to which a USE of the static chain
  164.    register should be added, if required.  */
  165.  
  166. rtx
  167. prepare_call_address (funexp, fndecl, use_insns)
  168.      rtx funexp;
  169.      tree fndecl;
  170.      rtx use_insns;
  171. {
  172.   rtx static_chain_value = 0;
  173.  
  174.   funexp = protect_from_queue (funexp, 0);
  175.  
  176.   if (fndecl != 0)
  177.     /* Get possible static chain value for nested function in C. */
  178.     static_chain_value = lookup_static_chain (fndecl);
  179.  
  180.   /* Make a valid memory address and copy constants thru pseudo-regs,
  181.      but not for a constant address if -fno-function-cse.  */
  182.   if (GET_CODE (funexp) != SYMBOL_REF)
  183.     funexp = memory_address (FUNCTION_MODE, funexp);
  184.   else
  185.     {
  186. #ifndef NO_FUNCTION_CSE
  187.       if (optimize && ! flag_no_function_cse)
  188. #ifdef NO_RECURSIVE_FUNCTION_CSE
  189.     if (fndecl != current_function_decl)
  190. #endif
  191.       funexp = force_reg (Pmode, funexp);
  192. #endif
  193.     }
  194.  
  195.   if (static_chain_value != 0)
  196.     {
  197.       emit_move_insn (static_chain_rtx, static_chain_value);
  198.  
  199.       /* Put the USE insn in the chain we were passed.  It will later be
  200.      output immediately in front of the CALL insn.  */
  201.       push_to_sequence (use_insns);
  202.       emit_insn (gen_rtx (USE, VOIDmode, static_chain_rtx));
  203.       end_sequence ();
  204.     }
  205.  
  206.   return funexp;
  207. }
  208.  
  209. /* Generate instructions to call function FUNEXP,
  210.    and optionally pop the results.
  211.    The CALL_INSN is the first insn generated.
  212.  
  213.    FUNTYPE is the data type of the function, or, for a library call,
  214.    the identifier for the name of the call.  This is given to the
  215.    macro RETURN_POPS_ARGS to determine whether this function pops its own args.
  216.  
  217.    STACK_SIZE is the number of bytes of arguments on the stack,
  218.    rounded up to STACK_BOUNDARY; zero if the size is variable.
  219.    This is both to put into the call insn and
  220.    to generate explicit popping code if necessary.
  221.  
  222.    NEXT_ARG_REG is the rtx that results from executing
  223.      FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1)
  224.    just after all the args have had their registers assigned.
  225.    This could be whatever you like, but normally it is the first
  226.    arg-register beyond those used for args in this call,
  227.    or 0 if all the arg-registers are used in this call.
  228.    It is passed on to `gen_call' so you can put this info in the call insn.
  229.  
  230.    VALREG is a hard register in which a value is returned,
  231.    or 0 if the call does not return a value.
  232.  
  233.    OLD_INHIBIT_DEFER_POP is the value that `inhibit_defer_pop' had before
  234.    the args to this call were processed.
  235.    We restore `inhibit_defer_pop' to that value.
  236.  
  237.    USE_INSNS is a chain of USE insns to be emitted immediately before
  238.    the actual CALL insn.  */
  239.  
  240. void
  241. emit_call_1 (funexp, funtype, stack_size, next_arg_reg,
  242.          valreg, old_inhibit_defer_pop, use_insns)
  243.      rtx funexp;
  244.      tree funtype;
  245.      int stack_size;
  246.      rtx next_arg_reg;
  247.      rtx valreg;
  248.      int old_inhibit_defer_pop;
  249.      rtx use_insns;
  250. {
  251.   rtx stack_size_rtx = gen_rtx (CONST_INT, VOIDmode, stack_size);
  252.   rtx call_insn;
  253.   int already_popped = 0;
  254.  
  255.   /* Ensure address is valid.  SYMBOL_REF is already valid, so no need,
  256.      and we don't want to load it into a register as an optimization,
  257.      because prepare_call_address already did it if it should be done.  */
  258.   if (GET_CODE (funexp) != SYMBOL_REF)
  259.     funexp = memory_address (FUNCTION_MODE, funexp);
  260.  
  261. #ifndef ACCUMULATE_OUTGOING_ARGS
  262. #if defined (HAVE_call_pop) && defined (HAVE_call_value_pop)
  263.   if (HAVE_call_pop && HAVE_call_value_pop
  264.       && (RETURN_POPS_ARGS (funtype, stack_size) > 0 || stack_size == 0))
  265.     {
  266.       rtx n_pop = gen_rtx (CONST_INT, VOIDmode, 
  267.                RETURN_POPS_ARGS (funtype, stack_size));
  268.       rtx pat;
  269.  
  270.       /* If this subroutine pops its own args, record that in the call insn
  271.      if possible, for the sake of frame pointer elimination.  */
  272.       if (valreg)
  273.     pat = gen_call_value_pop (valreg,
  274.                   gen_rtx (MEM, FUNCTION_MODE, funexp),
  275.                   stack_size_rtx, next_arg_reg, n_pop);
  276.       else
  277.     pat = gen_call_pop (gen_rtx (MEM, FUNCTION_MODE, funexp),
  278.                 stack_size_rtx, next_arg_reg, n_pop);
  279.  
  280.       emit_call_insn (pat);
  281.       already_popped = 1;
  282.     }
  283.   else
  284. #endif
  285. #endif
  286.  
  287. #if defined (HAVE_call) && defined (HAVE_call_value)
  288.   if (HAVE_call && HAVE_call_value)
  289.     {
  290.       if (valreg)
  291.     emit_call_insn (gen_call_value (valreg,
  292.                     gen_rtx (MEM, FUNCTION_MODE, funexp),
  293.                     stack_size_rtx, next_arg_reg));
  294.       else
  295.     emit_call_insn (gen_call (gen_rtx (MEM, FUNCTION_MODE, funexp),
  296.                   stack_size_rtx, next_arg_reg));
  297.     }
  298.   else
  299. #endif
  300.     abort ();
  301.  
  302.   /* Find the CALL insn we just emitted and write the USE insns before it.  */
  303.   for (call_insn = get_last_insn ();
  304.        call_insn && GET_CODE (call_insn) != CALL_INSN;
  305.        call_insn = PREV_INSN (call_insn))
  306.     ;
  307.  
  308.   if (! call_insn)
  309.     abort ();
  310.  
  311.   /* Put the USE insns before the CALL.  */
  312.   emit_insns_before (use_insns, call_insn);
  313.  
  314.   inhibit_defer_pop = old_inhibit_defer_pop;
  315.  
  316. #ifndef ACCUMULATE_OUTGOING_ARGS
  317.   /* If returning from the subroutine does not automatically pop the args,
  318.      we need an instruction to pop them sooner or later.
  319.      Perhaps do it now; perhaps just record how much space to pop later.
  320.  
  321.      If returning from the subroutine does pop the args, indicate that the
  322.      stack pointer will be changed.  */
  323.  
  324.   if (stack_size != 0 && RETURN_POPS_ARGS (funtype, stack_size) > 0)
  325.     {
  326.       if (!already_popped)
  327.     emit_insn (gen_rtx (CLOBBER, VOIDmode, stack_pointer_rtx));
  328.       stack_size -= RETURN_POPS_ARGS (funtype, stack_size);
  329.       stack_size_rtx = gen_rtx (CONST_INT, VOIDmode, stack_size);
  330.     }
  331.  
  332.   if (stack_size != 0)
  333.     {
  334.       if (flag_defer_pop && inhibit_defer_pop == 0)
  335.     pending_stack_adjust += stack_size;
  336.       else
  337.     adjust_stack (stack_size_rtx);
  338.     }
  339. #endif
  340. }
  341.  
  342. /* Generate all the code for a function call
  343.    and return an rtx for its value.
  344.    Store the value in TARGET (specified as an rtx) if convenient.
  345.    If the value is stored in TARGET then TARGET is returned.
  346.    If IGNORE is nonzero, then we ignore the value of the function call.  */
  347.  
  348. rtx
  349. expand_call (exp, target, ignore, modifier)
  350.      tree exp;
  351.      rtx target;
  352.      int ignore;
  353.      enum expand_modifier modifier;
  354. {
  355.   /* List of actual parameters.  */
  356.   tree actparms = TREE_OPERAND (exp, 1);
  357.   /* RTX for the function to be called.  */
  358.   rtx funexp;
  359.   /* Data type of the function.  */
  360.   tree funtype;
  361.   /* Declaration of the function being called,
  362.      or 0 if the function is computed (not known by name).  */
  363.   tree fndecl = 0;
  364.   char *name = 0;
  365.  
  366.   /* Register in which non-BLKmode value will be returned,
  367.      or 0 if no value or if value is BLKmode.  */
  368.   rtx valreg;
  369.   /* Address where we should return a BLKmode value;
  370.      0 if value not BLKmode.  */
  371.   rtx structure_value_addr = 0;
  372.   /* Nonzero if that address is being passed by treating it as
  373.      an extra, implicit first parameter.  Otherwise,
  374.      it is passed by being copied directly into struct_value_rtx.  */
  375.   int structure_value_addr_parm = 0;
  376.   /* Nonzero if called function returns an aggregate in memory PCC style,
  377.      by returning the address of where to find it.  */
  378.   int pcc_struct_value = 0;
  379.  
  380.   /* Number of actual parameters in this call, including struct value addr.  */
  381.   int num_actuals;
  382.   /* Number of named args.  Args after this are anonymous ones
  383.      and they must all go on the stack.  */
  384.   int n_named_args;
  385.   /* Count arg position in order args appear.  */
  386.   int argpos;
  387.  
  388.   /* Vector of information about each argument.
  389.      Arguments are numbered in the order they will be pushed,
  390.      not the order they are written.  */
  391.   struct arg_data *args;
  392.  
  393.   /* Total size in bytes of all the stack-parms scanned so far.  */
  394.   struct args_size args_size;
  395.   /* Size of arguments before any adjustments (such as rounding).  */
  396.   struct args_size original_args_size;
  397.   /* Data on reg parms scanned so far.  */
  398.   CUMULATIVE_ARGS args_so_far;
  399.   /* Nonzero if a reg parm has been scanned.  */
  400.   int reg_parm_seen;
  401.  
  402.   /* Nonzero if we must avoid push-insns in the args for this call. 
  403.      If space space is allocated for register parameters, but not by the
  404.      caller, then it is preallocated in the fixed part of the stack frame.
  405.      So the entire argument block must then be preallocated (i.e., we
  406.      ignore PUSH_ROUNDING in that case).  */
  407.  
  408. #if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE)
  409.   int must_preallocate = 1;
  410. #else
  411. #ifdef PUSH_ROUNDING
  412.   int must_preallocate = 0;
  413. #else
  414.   int must_preallocate = 1;
  415. #endif
  416. #endif
  417.  
  418.   /* 1 if scanning parms front to back, -1 if scanning back to front.  */
  419.   int inc;
  420.   /* Address of space preallocated for stack parms
  421.      (on machines that lack push insns), or 0 if space not preallocated.  */
  422.   rtx argblock = 0;
  423.  
  424.   /* Nonzero if it is plausible that this is a call to alloca.  */
  425.   int may_be_alloca;
  426.   /* Nonzero if this is a call to setjmp or a related function.  */
  427.   int is_setjmp;
  428.   /* Nonzero if this is a call to an inline function.  */
  429.   int is_integrable = 0;
  430.   /* Nonzero if this is a call to __builtin_new.  */
  431.   int is_builtin_new;
  432.   /* Nonzero if this is a call to a `const' function.  */
  433.   int is_const = 0;
  434. #if defined(ACCUMULATE_OUTGOING_ARGS) && defined(REG_PARM_STACK_SPACE)
  435.   /* Define the boundary of the register parm stack space that needs to be
  436.      save, if any.  */
  437.   int low_to_save = -1, high_to_save;
  438.   rtx save_area = 0;        /* Place that it is saved */
  439. #endif
  440.  
  441.   /* The last insn before the things that are intrinsically part of the call.
  442.      The beginning reg-note goes on the insn after this one.  */
  443.   rtx insn_before;
  444.  
  445. #ifdef ACCUMULATE_OUTGOING_ARGS
  446.   int initial_highest_arg_in_use = highest_outgoing_arg_in_use;
  447.   char *initial_stack_usage_map = stack_usage_map;
  448. #endif
  449.  
  450.   rtx old_stack_level = 0;
  451.   int old_pending_adj;
  452.   int old_inhibit_defer_pop = inhibit_defer_pop;
  453.   tree old_cleanups = cleanups_this_call;
  454.  
  455.   rtx use_insns = 0;
  456.  
  457.   register tree p;
  458.   register int i;
  459.  
  460.   /* See if we can find a DECL-node for the actual function.
  461.      As a result, decide whether this is a call to an integrable function.  */
  462.  
  463.   p = TREE_OPERAND (exp, 0);
  464.   if (TREE_CODE (p) == ADDR_EXPR)
  465.     {
  466.       fndecl = TREE_OPERAND (p, 0);
  467.       if (TREE_CODE (fndecl) != FUNCTION_DECL)
  468.     {
  469.       /* May still be a `const' function if it is
  470.          a call through a const function.  */
  471.       fndecl = 0;
  472.     }
  473.       else
  474.     {
  475.       extern tree current_function_decl;
  476.  
  477.       if (!flag_no_inline
  478.           && fndecl != current_function_decl
  479.           && DECL_SAVED_INSNS (fndecl))
  480.         is_integrable = 1;
  481.       else if (! TREE_ADDRESSABLE (fndecl))
  482.         {
  483.           /* In case this function later becomes inlineable,
  484.          record that there was already a non-inline call to it.
  485.  
  486.          Use abstraction instead of setting TREE_ADDRESSABLE
  487.          directly.  */
  488.           if (TREE_INLINE (fndecl) && extra_warnings && !flag_no_inline)
  489.         warning_with_decl (fndecl, "can't inline call to `%s' which was declared inline");
  490.           mark_addressable (fndecl);
  491.         }
  492.  
  493.       if (TREE_READONLY (fndecl) && ! TREE_THIS_VOLATILE (fndecl))
  494.         is_const = 1;
  495.     }
  496.     }
  497.  
  498.   /* When calling a const function, we must pop the stack args right away,
  499.      so that the pop is deleted or moved with the call.  */
  500.   if (is_const)
  501.     NO_DEFER_POP;
  502.  
  503.   /* Set up a place to return a structure.  */
  504.  
  505.   /* Cater to broken compilers.  */
  506.   if (aggregate_value_p (exp))
  507.     {
  508.       /* This call returns a big structure.  */
  509. #ifdef PCC_STATIC_STRUCT_RETURN
  510.       if (flag_pcc_struct_return)
  511.     {
  512.       pcc_struct_value = 1;
  513.       is_integrable = 0;  /* Easier than making that case work right.  */
  514.     }
  515.       else
  516. #endif
  517.     {
  518.       if (target && GET_CODE (target) == MEM)
  519.         structure_value_addr = XEXP (target, 0);
  520.       else
  521.         {
  522.           /* Assign a temporary on the stack to hold the value.  */
  523.           int size = int_size_in_bytes (TREE_TYPE (exp));
  524.  
  525.           /* For variable-sized objects, we must be called with a target
  526.          specified.  If we were to allocate space on the stack here,
  527.          we would have no way of knowing when to free it.  */
  528.           if (size < 0)
  529.         abort ();
  530.  
  531.           structure_value_addr
  532.         = XEXP (assign_stack_temp (BLKmode, size, 1), 0);
  533.           target = 0;
  534.         }
  535.     }
  536.     }
  537.  
  538.   /* If called function is inline, try to integrate it.  */
  539.  
  540.   if (is_integrable)
  541.     {
  542.       extern rtx expand_inline_function ();
  543.       rtx temp;
  544.  
  545.       temp = expand_inline_function (fndecl, actparms, target,
  546.                      ignore, TREE_TYPE (exp),
  547.                      structure_value_addr);
  548.  
  549.       /* If inlining succeeded, return.  */
  550.       if ((int) temp != -1)
  551.     {
  552.       /* Perform all cleanups needed for the arguments of this call
  553.          (i.e. destructors in C++).  It is ok if these destructors
  554.          clobber RETURN_VALUE_REG, because the only time we care about
  555.          this is when TARGET is that register.  But in C++, we take
  556.          care to never return that register directly.  */
  557.       expand_cleanups_to (old_cleanups);
  558.  
  559.       /* If the result is equivalent to TARGET, return TARGET to simplify
  560.          checks in store_expr.  They can be equivalent but not equal in the
  561.          case of a function that returns BLKmode.  */
  562.       if (temp != target && rtx_equal_p (temp, target))
  563.         return target;
  564.       return temp;
  565.     }
  566.  
  567.       /* If inlining failed, mark FNDECL as needing to be compiled
  568.      separately after all.  */
  569.       mark_addressable (fndecl);
  570.     }
  571.  
  572.   function_call_count++;
  573.  
  574.   if (fndecl)
  575.     name = IDENTIFIER_POINTER (DECL_NAME (fndecl));
  576.  
  577. #if 0
  578.   /* Unless it's a call to a specific function that isn't alloca,
  579.      if it has one argument, we must assume it might be alloca.  */
  580.  
  581.   may_be_alloca =
  582.     (!(fndecl != 0 && strcmp (name, "alloca"))
  583.      && actparms != 0
  584.      && TREE_CHAIN (actparms) == 0);
  585. #else
  586.   /* We assume that alloca will always be called by name.  It
  587.      makes no sense to pass it as a pointer-to-function to
  588.      anything that does not understand its behavior.  */
  589.   may_be_alloca =
  590.     (fndecl && ((IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 6
  591.          && name[0] == 'a'
  592.          && ! strcmp (name, "alloca"))
  593.         || (IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 16
  594.             && name[0] == '_'
  595.             && ! strcmp (name, "__builtin_alloca"))));
  596. #endif
  597.  
  598.   /* See if this is a call to a function that can return more than once.  */
  599.   if (fndecl == 0
  600.       || IDENTIFIER_LENGTH (DECL_NAME (fndecl)) > 15)
  601.     is_setjmp = 0;
  602.   else
  603.     {
  604.       char *tname = name + (name[0] == '_');
  605.  
  606.       if (tname[0] == 's')
  607.     {
  608.       is_setjmp
  609.         = ((tname[1] == 'e'
  610.         && (!strcmp (tname, "setjmp")
  611.             || !strcmp (tname, "setjmp_syscall")))
  612.            || (tname[1] == 'i'
  613.            && !strcmp (tname, "sigsetjmp"))
  614.            || (tname[1] == 'a'
  615.            && !strcmp (tname, "savectx")));
  616.     }
  617.       else if (tname[0] == 'q' && tname[1] == 's')
  618.     {
  619.       is_setjmp = !strcmp (tname+1, "setjmp");
  620.     }
  621.       else
  622.     is_setjmp = 0;
  623.     }
  624.  
  625.   is_builtin_new
  626.     = (fndecl != 0
  627.        && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 13
  628.        && (!strcmp (name, "__builtin_new")));
  629.  
  630.   if (may_be_alloca)
  631.     current_function_calls_alloca = 1;
  632.  
  633.   /* Don't let pending stack adjusts add up to too much.
  634.      Also, do all pending adjustments now
  635.      if there is any chance this might be a call to alloca.  */
  636.  
  637.   if (pending_stack_adjust >= 32
  638.       || (pending_stack_adjust > 0 && may_be_alloca))
  639.     do_pending_stack_adjust ();
  640.  
  641.   /* Operand 0 is a pointer-to-function; get the type of the function.  */
  642.   funtype = TREE_TYPE (TREE_OPERAND (exp, 0));
  643.   if (TREE_CODE (funtype) != POINTER_TYPE)
  644.     abort ();
  645.   funtype = TREE_TYPE (funtype);
  646.  
  647.   /* Push the temporary stack slot level so that we can free temporaries used
  648.      by each of the arguments separately.  */
  649.   push_temp_slots ();
  650.  
  651.   /* Start updating where the next arg would go.  */
  652.   INIT_CUMULATIVE_ARGS (args_so_far, funtype, 0);
  653.  
  654.   /* If struct_value_rtx is 0, it means pass the address
  655.      as if it were an extra parameter.  */
  656.   if (structure_value_addr && struct_value_rtx == 0)
  657.     {
  658.       actparms
  659.     = tree_cons (error_mark_node,
  660.              make_tree (build_pointer_type (TREE_TYPE (funtype)),
  661.                 force_reg (Pmode, structure_value_addr)),
  662.              actparms);
  663.       structure_value_addr_parm = 1;
  664.     }
  665.  
  666.   /* Count the arguments and set NUM_ACTUALS.  */
  667.   for (p = actparms, i = 0; p; p = TREE_CHAIN (p)) i++;
  668.   num_actuals = i;
  669.  
  670.   /* Compute number of named args.
  671.      Normally, don't include the last named arg if anonymous args follow.
  672.      (If no anonymous args follow, the result of list_length
  673.      is actually one too large.)
  674.  
  675.      If SETUP_INCOMING_VARARGS is defined, this machine will be able to
  676.      place unnamed args that were passed in registers into the stack.  So
  677.      treat all args as named.  This allows the insns emitting for a specific
  678.      argument list to be independant of the function declaration.
  679.  
  680.      If SETUP_INCOMING_VARARGS is not defined, we do not have any reliable
  681.      way to pass unnamed args in registers, so we must force them into
  682.      memory.  */
  683. #ifndef SETUP_INCOMING_VARARGS
  684.   if (TYPE_ARG_TYPES (funtype) != 0)
  685.     n_named_args
  686.       = list_length (TYPE_ARG_TYPES (funtype)) - 1
  687.     /* Count the struct value address, if it is passed as a parm.  */
  688.     + structure_value_addr_parm;
  689.   else
  690. #endif
  691.     /* If we know nothing, treat all args as named.  */
  692.     n_named_args = num_actuals;
  693.  
  694.   /* Make a vector to hold all the information about each arg.  */
  695.   args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
  696.   bzero (args, num_actuals * sizeof (struct arg_data));
  697.  
  698.   args_size.constant = 0;
  699.   args_size.var = 0;
  700.  
  701.   /* In this loop, we consider args in the order they are written.
  702.      We fill up ARGS from the front of from the back if necessary
  703.      so that in any case the first arg to be pushed ends up at the front.  */
  704.  
  705. #ifdef PUSH_ARGS_REVERSED
  706.   i = num_actuals - 1, inc = -1;
  707.   /* In this case, must reverse order of args
  708.      so that we compute and push the last arg first.  */
  709. #else
  710.   i = 0, inc = 1;
  711. #endif
  712.  
  713.   /* I counts args in order (to be) pushed; ARGPOS counts in order written.  */
  714.   for (p = actparms, argpos = 0; p; p = TREE_CHAIN (p), i += inc, argpos++)
  715.     {
  716.       tree type = TREE_TYPE (TREE_VALUE (p));
  717.  
  718.       args[i].tree_value = TREE_VALUE (p);
  719.  
  720.       /* Replace erroneous argument with constant zero.  */
  721.       if (type == error_mark_node || TYPE_SIZE (type) == 0)
  722.     args[i].tree_value = integer_zero_node, type = integer_type_node;
  723.  
  724.       /* Decide where to pass this arg.
  725.  
  726.      args[i].reg is nonzero if all or part is passed in registers.
  727.  
  728.      args[i].partial is nonzero if part but not all is passed in registers,
  729.      and the exact value says how many words are passed in registers.
  730.  
  731.      args[i].pass_on_stack is nonzero if the argument must at least be
  732.      computed on the stack.  It may then be loaded back into registers
  733.      if args[i].reg is nonzero.
  734.  
  735.      These decisions are driven by the FUNCTION_... macros and must agree
  736.      with those made by function.c.  */
  737.  
  738. #ifdef FUNCTION_ARG_PASS_BY_REFERENCE
  739.       /* See if this argument should be passed by invisible reference.  */
  740.       if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, TYPE_MODE (type), type,
  741.                       argpos < n_named_args))
  742.     {
  743.       /* We make a copy of the object and pass the address to the function
  744.          being called.  */
  745.       int size = int_size_in_bytes (type);
  746.       rtx copy;
  747.  
  748.       if (size < 0)
  749.         {
  750.           /* This is a variable-sized object.  Make space on the stack
  751.          for it.  */
  752.           rtx size_rtx = expand_expr (size_in_bytes (type), 0,
  753.                       VOIDmode, 0);
  754.  
  755.           if (old_stack_level == 0)
  756.         {
  757.           old_stack_level = copy_to_mode_reg (Pmode, stack_pointer_rtx);
  758.           old_pending_adj = pending_stack_adjust;
  759.           pending_stack_adjust = 0;
  760.         }
  761.  
  762.           copy = gen_rtx (MEM, BLKmode,
  763.                   allocate_dynamic_stack_space (size_rtx, 0));
  764.         }
  765.       else
  766.         copy = assign_stack_temp (TYPE_MODE (type), size, 1);
  767.  
  768.       store_expr (args[i].tree_value, copy, 0);
  769.  
  770.       args[i].tree_value = build1 (ADDR_EXPR, build_pointer_type (type),
  771.                        make_tree (type, copy));
  772.       type = build_pointer_type (type);
  773.     }
  774. #endif
  775.  
  776.       args[i].reg = FUNCTION_ARG (args_so_far, TYPE_MODE (type), type,
  777.                   argpos < n_named_args);
  778. #ifdef FUNCTION_ARG_PARTIAL_NREGS
  779.       if (args[i].reg)
  780.     args[i].partial
  781.       = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, TYPE_MODE (type), type,
  782.                     argpos < n_named_args);
  783. #endif
  784.  
  785.       args[i].pass_on_stack = MUST_PASS_IN_STACK (TYPE_MODE (type), type);
  786.  
  787.       /* If FUNCTION_ARG returned an (expr_list (nil) FOO), it means that
  788.      we are to pass this arg in the register(s) designated by FOO, but
  789.      also to pass it in the stack.  */
  790.       if (args[i].reg && GET_CODE (args[i].reg) == EXPR_LIST
  791.       && XEXP (args[i].reg, 0) == 0)
  792.     args[i].pass_on_stack = 1, args[i].reg = XEXP (args[i].reg, 1);
  793.  
  794.       /* If this is an addressable type, we must preallocate the stack
  795.      since we must evaluate the object into its final location.
  796.  
  797.      If this is to be passed in both registers and the stack, it is simpler
  798.      to preallocate.  */
  799.       if (TREE_ADDRESSABLE (type)
  800.       || (args[i].pass_on_stack && args[i].reg != 0))
  801.     must_preallocate = 1;
  802.  
  803.       /* If this is an addressable type, we cannot pre-evaluate it.  Thus,
  804.      we cannot consider this function call constant.  */
  805.       if (TREE_ADDRESSABLE (type))
  806.     is_const = 0;
  807.  
  808.       /* Compute the stack-size of this argument.  */
  809.       if (args[i].reg == 0 || args[i].partial != 0
  810. #ifdef REG_PARM_STACK_SPACE
  811.       || REG_PARM_STACK_SPACE (fndecl) > 0
  812. #endif
  813.       || args[i].pass_on_stack)
  814.     locate_and_pad_parm (TYPE_MODE (type), type,
  815. #ifdef STACK_PARMS_IN_REG_PARM_AREA
  816.                  1,
  817. #else
  818.                  args[i].reg != 0,
  819. #endif
  820.                  fndecl, &args_size, &args[i].offset,
  821.                  &args[i].size);
  822.  
  823.       args[i].slot_offset = args_size;
  824.  
  825. #ifndef REG_PARM_STACK_SPACE
  826.       /* If a part of the arg was put into registers,
  827.      don't include that part in the amount pushed.  */
  828.       if (! args[i].pass_on_stack)
  829.     args[i].size.constant -= ((args[i].partial * UNITS_PER_WORD)
  830.                   / (PARM_BOUNDARY / BITS_PER_UNIT)
  831.                   * (PARM_BOUNDARY / BITS_PER_UNIT));
  832. #endif
  833.       
  834.       /* Update ARGS_SIZE, the total stack space for args so far.  */
  835.  
  836.       args_size.constant += args[i].size.constant;
  837.       if (args[i].size.var)
  838.     {
  839.       ADD_PARM_SIZE (args_size, args[i].size.var);
  840.     }
  841.  
  842.       /* Increment ARGS_SO_FAR, which has info about which arg-registers
  843.      have been used, etc.  */
  844.  
  845.       FUNCTION_ARG_ADVANCE (args_so_far, TYPE_MODE (type), type,
  846.                 argpos < n_named_args);
  847.     }
  848.  
  849.   /* Compute the actual size of the argument block required.  The variable
  850.      and constant sizes must be combined, the size may have to be rounded,
  851.      and there may be a minimum required size.  */
  852.  
  853.   original_args_size = args_size;
  854.   if (args_size.var)
  855.     {
  856.       /* If this function requires a variable-sized argument list, don't try to
  857.      make a cse'able block for this call.  We may be able to do this
  858.      eventually, but it is too complicated to keep track of what insns go
  859.      in the cse'able block and which don't.  */
  860.  
  861.       is_const = 0;
  862.       must_preallocate = 1;
  863.  
  864.       args_size.var = ARGS_SIZE_TREE (args_size);
  865.       args_size.constant = 0;
  866.  
  867. #ifdef STACK_BOUNDARY
  868.       if (STACK_BOUNDARY != BITS_PER_UNIT)
  869.     args_size.var = round_up (args_size.var, STACK_BYTES);
  870. #endif
  871.  
  872. #ifdef REG_PARM_STACK_SPACE
  873.       if (REG_PARM_STACK_SPACE (fndecl) > 0)
  874.     {
  875.       args_size.var
  876.         = size_binop (MAX_EXPR, args_size.var,
  877.               size_int (REG_PARM_STACK_SPACE (fndecl)));
  878.  
  879. #ifndef OUTGOING_REG_PARM_STACK_SPACE
  880.       /* The area corresponding to register parameters is not to count in
  881.          the size of the block we need.  So make the adjustment.  */
  882.       args_size.var
  883.         = size_binop (MINUS_EXPR, args_size.var,
  884.               size_int (REG_PARM_STACK_SPACE (fndecl)));
  885. #endif
  886.     }
  887. #endif
  888.     }
  889.   else
  890.     {
  891. #ifdef STACK_BOUNDARY
  892.       args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
  893.                  / STACK_BYTES) * STACK_BYTES);
  894. #endif
  895.  
  896. #ifdef REG_PARM_STACK_SPACE
  897.       args_size.constant = MAX (args_size.constant,
  898.                 REG_PARM_STACK_SPACE (fndecl));
  899. #ifndef OUTGOING_REG_PARM_STACK_SPACE
  900.       args_size.constant -= REG_PARM_STACK_SPACE (fndecl);
  901. #endif
  902. #endif
  903.     }
  904.  
  905.   /* See if we have or want to preallocate stack space.
  906.  
  907.      If we would have to push a partially-in-regs parm
  908.      before other stack parms, preallocate stack space instead.
  909.  
  910.      If the size of some parm is not a multiple of the required stack
  911.      alignment, we must preallocate.
  912.  
  913.      If the total size of arguments that would otherwise create a copy in
  914.      a temporary (such as a CALL) is more than half the total argument list
  915.      size, preallocation is faster.
  916.  
  917.      Another reason to preallocate is if we have a machine (like the m88k)
  918.      where stack alignment is required to be maintained between every
  919.      pair of insns, not just when the call is made.  However, we assume here
  920.      that such machines either do not have push insns (and hence preallocation
  921.      would occur anyway) or the problem is taken care of with
  922.      PUSH_ROUNDING.  */
  923.  
  924.   if (! must_preallocate)
  925.     {
  926.       int partial_seen = 0;
  927.       int copy_to_evaluate_size = 0;
  928.  
  929.       for (i = 0; i < num_actuals && ! must_preallocate; i++)
  930.     {
  931.       if (args[i].partial > 0 && ! args[i].pass_on_stack)
  932.         partial_seen = 1;
  933.       else if (partial_seen && args[i].reg == 0)
  934.         must_preallocate = 1;
  935.  
  936.       if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
  937.           && (TREE_CODE (args[i].tree_value) == CALL_EXPR
  938.           || TREE_CODE (args[i].tree_value) == TARGET_EXPR
  939.           || TREE_CODE (args[i].tree_value) == COND_EXPR
  940.           || TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value))))
  941.         copy_to_evaluate_size
  942.           += int_size_in_bytes (TREE_TYPE (args[i].tree_value));
  943.     }
  944.  
  945.       if (copy_to_evaluate_size >= args_size.constant / 2)
  946.     must_preallocate = 1;
  947.     }
  948.  
  949.   /* If the structure value address will reference the stack pointer, we must
  950.      stabilize it.  We don't need to do this if we know that we are not going
  951.      to adjust the stack pointer in processing this call.  */
  952.  
  953.   if (structure_value_addr
  954.       && (reg_mentioned_p (virtual_stack_dynamic_rtx, structure_value_addr)
  955.        || reg_mentioned_p (virtual_outgoing_args_rtx, structure_value_addr))
  956.       && (args_size.var
  957. #ifndef ACCUMULATE_OUTGOING_ARGS
  958.       || args_size.constant
  959. #endif
  960.       ))
  961.     structure_value_addr = copy_to_reg (structure_value_addr);
  962.  
  963.   /* If this function call is cse'able, precompute all the parameters.
  964.      Note that if the parameter is constructed into a temporary, this will
  965.      cause an additional copy because the parameter will be constructed
  966.      into a temporary location and then copied into the outgoing arguments.
  967.      If a parameter contains a call to alloca and this function uses the
  968.      stack, precompute the parameter.  */
  969.  
  970. #ifdef NeXT
  971.   for (i = 0; i < num_actuals; i++)
  972.     if (is_const
  973.     || ((args_size.var != 0 || args_size.constant != 0)
  974.         && calls_alloca (args[i].tree_value)))
  975. #else /* NeXT */
  976.   if (is_const)
  977.     for (i = 0; i < num_actuals; i++)
  978. #endif /* NeXT */
  979.       {
  980.     args[i].value = expand_expr (args[i].tree_value, 0, VOIDmode, 0);
  981.     preserve_temp_slots (args[i].value);
  982.     free_temp_slots ();
  983.  
  984.     /* ANSI doesn't require a sequence point here,
  985.        but PCC has one, so this will avoid some problems.  */
  986.     emit_queue ();
  987.       }
  988.  
  989.   /* Get the function to call, in the form of RTL, if it is a constant.  */
  990.   if (fndecl && is_const)
  991.     {
  992.       /* Get a SYMBOL_REF rtx for the function address.  */
  993.       funexp = XEXP (DECL_RTL (fndecl), 0);
  994.  
  995. #ifndef NO_FUNCTION_CSE
  996.       /* Pass the address through a pseudoreg, if desired,
  997.      before the "beginning" of the library call.
  998.      So this insn isn't "part of" the library call, in case that
  999.      is deleted, or cse'd.  */
  1000.       if (! flag_no_function_cse)
  1001.     funexp = copy_to_reg (funexp);
  1002. #endif
  1003.     }
  1004.  
  1005.   /* Now we are about to start emitting insns that can be deleted
  1006.      if the libcall is deleted.  */
  1007.   insn_before = get_last_insn ();
  1008.  
  1009.   /* If we have no actual push instructions, or shouldn't use them,
  1010.      make space for all args right now.  */
  1011.  
  1012.   if (args_size.var != 0)
  1013.     {
  1014.       if (old_stack_level == 0)
  1015.     {
  1016.       old_stack_level = copy_to_mode_reg (Pmode, stack_pointer_rtx);
  1017.       old_pending_adj = pending_stack_adjust;
  1018.       pending_stack_adjust = 0;
  1019.     }
  1020.       argblock = push_block (ARGS_SIZE_RTX (args_size), 0, 0);
  1021.     }
  1022.   else if (must_preallocate)
  1023.     {
  1024.       /* Note that we must go through the motions of allocating an argument
  1025.      block even if the size is zero because we may be storing args
  1026.      in the area reserved for register arguments, which may be part of
  1027.      the stack frame.  */
  1028.       int needed = args_size.constant;
  1029.  
  1030. #ifdef ACCUMULATE_OUTGOING_ARGS
  1031.       /* Store the maximum argument space used.  It will be pushed by the
  1032.      prologue.
  1033.  
  1034.      Since the stack pointer will never be pushed, it is possible for
  1035.      the evaluation of a parm to clobber something we have already
  1036.      written to the stack.  Since most function calls on RISC machines
  1037.      do not use the stack, this is uncommon, but must work correctly.
  1038.      
  1039.      Therefore, we save any area of the stack that was already written
  1040.      and that we are using.  Here we set up to do this by making a new
  1041.      stack usage map from the old one.  The actual save will be done
  1042.      by store_one_arg. 
  1043.  
  1044.      Another approach might be to try to reorder the argument
  1045.      evaluations to avoid this conflictint stack usage.  */
  1046.  
  1047.       if (needed > current_function_outgoing_args_size)
  1048.     current_function_outgoing_args_size = needed;
  1049.  
  1050. #if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE)
  1051.       /* Since we will be writing into the entire argument area, the
  1052.      map must be allocated for its entire size, not just the part that
  1053.      is the responsibility of the caller.  */
  1054.       needed += REG_PARM_STACK_SPACE (fndecl);
  1055. #endif
  1056.  
  1057.       highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, needed);
  1058.       stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
  1059.  
  1060.       if (initial_highest_arg_in_use)
  1061.     bcopy (initial_stack_usage_map, stack_usage_map,
  1062.            initial_highest_arg_in_use);
  1063.  
  1064.       if (initial_highest_arg_in_use != highest_outgoing_arg_in_use)
  1065.     bzero (&stack_usage_map[initial_highest_arg_in_use],
  1066.            highest_outgoing_arg_in_use - initial_highest_arg_in_use);
  1067.       needed = 0;
  1068. #else
  1069.       if (inhibit_defer_pop == 0)
  1070.     {
  1071.       /* Try to reuse some or all of the pending_stack_adjust
  1072.          to get this space.  Maybe we can avoid any pushing.  */
  1073.       if (needed > pending_stack_adjust)
  1074.         {
  1075.           needed -= pending_stack_adjust;
  1076.           pending_stack_adjust = 0;
  1077.         }
  1078.       else
  1079.         {
  1080.           pending_stack_adjust -= needed;
  1081.           needed = 0;
  1082.         }
  1083.     }
  1084. #endif
  1085.       /* Special case this because overhead of `push_block' in this
  1086.      case is non-trivial.  */
  1087.       if (needed == 0)
  1088.     argblock = virtual_outgoing_args_rtx;
  1089.       else
  1090.     argblock = push_block (gen_rtx (CONST_INT, VOIDmode, needed), 0, 0);
  1091.     }
  1092.  
  1093.   /* If we preallocated stack space, compute the address of each argument.
  1094.      We need not ensure it is a valid memory address here; it will be 
  1095.      validized when it is used.  */
  1096.   if (argblock)
  1097.     {
  1098.       rtx arg_reg = argblock;
  1099.       int arg_offset = 0;
  1100.  
  1101.       if (GET_CODE (argblock) == PLUS)
  1102.     arg_reg = XEXP (argblock, 0), arg_offset = INTVAL (XEXP (argblock, 1));
  1103.  
  1104.       for (i = 0; i < num_actuals; i++)
  1105.     {
  1106.       rtx offset = ARGS_SIZE_RTX (args[i].offset);
  1107.       rtx slot_offset = ARGS_SIZE_RTX (args[i].slot_offset);
  1108.       rtx addr;
  1109.  
  1110.       /* Skip this parm if it will not be passed on the stack.  */
  1111.       if (! args[i].pass_on_stack && args[i].reg != 0)
  1112.         continue;
  1113.  
  1114.       if (GET_CODE (offset) == CONST_INT)
  1115.         addr = plus_constant (arg_reg, INTVAL (offset));
  1116.       else
  1117.         addr = gen_rtx (PLUS, Pmode, arg_reg, offset);
  1118.  
  1119.       addr = plus_constant (addr, arg_offset);
  1120.       args[i].stack
  1121.         = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (args[i].tree_value)), addr);
  1122.  
  1123.       if (GET_CODE (slot_offset) == CONST_INT)
  1124.         addr = plus_constant (arg_reg, INTVAL (slot_offset));
  1125.       else
  1126.         addr = gen_rtx (PLUS, Pmode, arg_reg, slot_offset);
  1127.  
  1128.       addr = plus_constant (addr, arg_offset);
  1129.       args[i].stack_slot
  1130.         = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (args[i].tree_value)), addr);
  1131.     }
  1132.     }
  1133.                            
  1134. #ifdef PUSH_ARGS_REVERSED
  1135. #ifdef STACK_BOUNDARY
  1136.   /* If we push args individually in reverse order, perform stack alignment
  1137.      before the first push (the last arg).  */
  1138.   if (argblock == 0)
  1139.     anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode,
  1140.                 (args_size.constant
  1141.                  - original_args_size.constant)));
  1142. #endif
  1143. #endif
  1144.  
  1145.   /* Don't try to defer pops if preallocating, not even from the first arg,
  1146.      since ARGBLOCK probably refers to the SP.  */
  1147.   if (argblock)
  1148.     NO_DEFER_POP;
  1149.  
  1150.   /* Get the function to call, in the form of RTL.  */
  1151.   if (fndecl)
  1152.     /* Get a SYMBOL_REF rtx for the function address.  */
  1153.     funexp = XEXP (DECL_RTL (fndecl), 0);
  1154.   else
  1155.     /* Generate an rtx (probably a pseudo-register) for the address.  */
  1156.     {
  1157.       funexp = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0);
  1158.       free_temp_slots ();    /* FUNEXP can't be BLKmode */
  1159.       emit_queue ();
  1160.     }
  1161.  
  1162.   /* Figure out the register where the value, if any, will come back.  */
  1163.   valreg = 0;
  1164.   if (TYPE_MODE (TREE_TYPE (exp)) != VOIDmode
  1165.       && ! structure_value_addr)
  1166.     {
  1167.       if (pcc_struct_value)
  1168.     valreg = hard_function_value (build_pointer_type (TREE_TYPE (exp)),
  1169.                       fndecl);
  1170.       else
  1171.     valreg = hard_function_value (TREE_TYPE (exp), fndecl);
  1172.     }
  1173.  
  1174.   /* Precompute all register parameters.  It isn't safe to compute anything
  1175.      once we have started filling any specific hard regs. */
  1176.   reg_parm_seen = 0;
  1177.   for (i = 0; i < num_actuals; i++)
  1178.     if (args[i].reg != 0 && ! args[i].pass_on_stack)
  1179.       {
  1180.     reg_parm_seen = 1;
  1181.  
  1182.     if (args[i].value == 0)
  1183.       {
  1184.         args[i].value = expand_expr (args[i].tree_value, 0, VOIDmode, 0);
  1185.         preserve_temp_slots (args[i].value);
  1186.         free_temp_slots ();
  1187.  
  1188.         /* ANSI doesn't require a sequence point here,
  1189.            but PCC has one, so this will avoid some problems.  */
  1190.         emit_queue ();
  1191.       }
  1192.       }
  1193.  
  1194. #if defined(ACCUMULATE_OUTGOING_ARGS) && defined(REG_PARM_STACK_SPACE)
  1195.   /* The argument list is the property of the called routine and it
  1196.      may clobber it.  If the fixed area has been used for previous
  1197.      parameters, we must save and restore it.
  1198.  
  1199.      Here we compute the boundary of the that needs to be saved, if any.  */
  1200.  
  1201.   for (i = 0; i < REG_PARM_STACK_SPACE (fndecl); i++)
  1202.     {
  1203.       if (i >=  highest_outgoing_arg_in_use
  1204.       || stack_usage_map[i] == 0)
  1205.     continue;
  1206.  
  1207.       if (low_to_save == -1)
  1208.     low_to_save = i;
  1209.  
  1210.       high_to_save = i;
  1211.     }
  1212.  
  1213.   if (low_to_save >= 0)
  1214.     {
  1215.       int num_to_save = high_to_save - low_to_save + 1;
  1216.       enum machine_mode save_mode
  1217.     = mode_for_size (num_to_save * BITS_PER_UNIT, MODE_INT, 1);
  1218.       rtx stack_area;
  1219.  
  1220.       /* If we don't have the required alignment, must do this in BLKmode.  */
  1221.       if ((low_to_save & (MIN (GET_MODE_SIZE (save_mode),
  1222.                    BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
  1223.     save_mode = BLKmode;
  1224.  
  1225.       stack_area = gen_rtx (MEM, save_mode,
  1226.                 memory_address (save_mode,
  1227.                         plus_constant (argblock,
  1228.                                low_to_save)));
  1229.       if (save_mode == BLKmode)
  1230.     {
  1231.       save_area = assign_stack_temp (BLKmode, num_to_save, 1);
  1232.       emit_block_move (validize_mem (save_area), stack_area,
  1233.                gen_rtx (CONST_INT, VOIDmode, num_to_save),
  1234.                PARM_BOUNDARY / BITS_PER_UNIT);
  1235.     }
  1236.       else
  1237.     {
  1238.       save_area = gen_reg_rtx (save_mode);
  1239.       emit_move_insn (save_area, stack_area);
  1240.     }
  1241.     }
  1242. #endif
  1243.       
  1244.  
  1245.   /* Now store (and compute if necessary) all non-register parms.
  1246.      These come before register parms, since they can require block-moves,
  1247.      which could clobber the registers used for register parms.
  1248.      Parms which have partial registers are not stored here,
  1249.      but we do preallocate space here if they want that.  */
  1250.  
  1251.   for (i = 0; i < num_actuals; i++)
  1252.     if (args[i].reg == 0 || args[i].pass_on_stack)
  1253.       store_one_arg (&args[i], argblock, may_be_alloca,
  1254.              args_size.var != 0, fndecl);
  1255.  
  1256.   /* Now store any partially-in-registers parm.
  1257.      This is the last place a block-move can happen.  */
  1258.   if (reg_parm_seen)
  1259.     for (i = 0; i < num_actuals; i++)
  1260.       if (args[i].partial != 0 && ! args[i].pass_on_stack)
  1261.     store_one_arg (&args[i], argblock, may_be_alloca,
  1262.                args_size.var != 0, fndecl);
  1263.  
  1264. #ifndef PUSH_ARGS_REVERSED
  1265. #ifdef STACK_BOUNDARY
  1266.   /* If we pushed args in forward order, perform stack alignment
  1267.      after pushing the last arg.  */
  1268.   if (argblock == 0)
  1269.     anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode,
  1270.                 (args_size.constant
  1271.                  - original_args_size.constant)));
  1272. #endif
  1273. #endif
  1274.  
  1275.   /* Pass the function the address in which to return a structure value.  */
  1276.   if (structure_value_addr && ! structure_value_addr_parm)
  1277.     {
  1278.       emit_move_insn (struct_value_rtx,
  1279.               force_reg (Pmode,
  1280.                  force_operand (structure_value_addr, 0)));
  1281.       if (GET_CODE (struct_value_rtx) == REG)
  1282.     {
  1283.       push_to_sequence (use_insns);
  1284.       emit_insn (gen_rtx (USE, VOIDmode, struct_value_rtx));
  1285.       use_insns = get_insns ();
  1286.       end_sequence ();
  1287.     }
  1288.     }
  1289.  
  1290.   /* Now do the register loads required for any wholly-register parms or any
  1291.      parms which are passed both on the stack and in a register.  Their
  1292.      expressions were already evaluated. 
  1293.  
  1294.      Mark all register-parms as living through the call, putting these USE
  1295.      insns in a list headed by USE_INSNS.  */
  1296.  
  1297.   for (i = 0; i < num_actuals; i++)
  1298.     {
  1299.       rtx list = args[i].reg;
  1300.       int partial = args[i].partial;
  1301.  
  1302.       while (list)
  1303.     {
  1304.       rtx reg;
  1305.       int nregs;
  1306.  
  1307.       /* Process each register that needs to get this arg.  */
  1308.       if (GET_CODE (list) == EXPR_LIST)
  1309.         reg = XEXP (list, 0), list = XEXP (list, 1);
  1310.       else
  1311.         reg = list, list = 0;
  1312.  
  1313.       /* Set to non-zero if must move a word at a time, even if just one
  1314.          word (e.g, partial == 1 && mode == DFmode).  Set to zero if
  1315.          we just use a normal move insn.  */
  1316.       nregs = (partial ? partial
  1317.            : (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
  1318.               ? ((int_size_in_bytes (TREE_TYPE (args[i].tree_value))
  1319.               + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
  1320.               : 0));
  1321.  
  1322.       /* If simple case, just do move.  If normal partial, store_one_arg
  1323.          has already loaded the register for us.  In all other cases,
  1324.          load the register(s) from memory.  */
  1325.  
  1326.       if (nregs == 0)
  1327.         emit_move_insn (reg, args[i].value);
  1328.       else if (args[i].partial == 0 || args[i].pass_on_stack)
  1329.         move_block_to_reg (REGNO (reg),
  1330.                    validize_mem (args[i].value), nregs,
  1331.                    TYPE_MODE (TREE_TYPE (args[i].tree_value)));
  1332.     
  1333.       push_to_sequence (use_insns);
  1334.       if (nregs == 0)
  1335.         emit_insn (gen_rtx (USE, VOIDmode, reg));
  1336.       else
  1337.         use_regs (REGNO (reg), nregs);
  1338.       use_insns = get_insns ();
  1339.       end_sequence ();
  1340.  
  1341.       /* PARTIAL referred only to the first register, so clear it for the
  1342.          next time.  */
  1343.       partial = 0;
  1344.     }
  1345.     }
  1346.  
  1347.   /* Perform postincrements before actually calling the function.  */
  1348.   emit_queue ();
  1349.  
  1350.   /* All arguments and registers used for the call must be set up by now!  */
  1351.  
  1352.   funexp = prepare_call_address (funexp, fndecl, use_insns);
  1353.  
  1354.   /* Generate the actual call instruction.  */
  1355.   emit_call_1 (funexp, funtype, args_size.constant,
  1356.            FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1),
  1357.            valreg, old_inhibit_defer_pop, use_insns);
  1358.  
  1359.   /* For calls to `setjmp', etc., inform flow.c it should complain
  1360.      if nonvolatile values are live.  */
  1361.  
  1362.   if (is_setjmp)
  1363.     {
  1364.       emit_note (IDENTIFIER_POINTER (DECL_NAME (fndecl)), NOTE_INSN_SETJMP);
  1365.       current_function_calls_setjmp = 1;
  1366.     }
  1367.  
  1368.   /* Notice functions that cannot return.
  1369.      If optimizing, insns emitted below will be dead.
  1370.      If not optimizing, they will exist, which is useful
  1371.      if the user uses the `return' command in the debugger.  */
  1372.  
  1373. #ifndef NeXT
  1374.   if (fndecl && TREE_THIS_VOLATILE (fndecl)
  1375.       || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))))
  1376. #else /* NeXT */
  1377.   if (fndecl && TREE_THIS_VOLATILE (fndecl))
  1378. #endif /* NeXT */
  1379.     emit_barrier ();
  1380.  
  1381.   /* For calls to __builtin_new, note that it can never return 0.
  1382.      This is because a new handler will be called, and 0 it not
  1383.      among the numbers it is supposed to return.  */
  1384. #if 0
  1385.   if (is_builtin_new)
  1386.     emit_note (IDENTIFIER_POINTER (DECL_NAME (fndecl)), NOTE_INSN_BUILTIN_NEW);
  1387. #endif
  1388.  
  1389.   /* If value type not void, return an rtx for the value.  */
  1390.  
  1391.   /* If there are cleanups to be called, don't use a hard reg as target.  */
  1392.   if (cleanups_this_call != old_cleanups
  1393.       && target && REG_P (target)
  1394.       && REGNO (target) < FIRST_PSEUDO_REGISTER)
  1395.     target = 0;
  1396.  
  1397.   if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode
  1398.       || ignore)
  1399.     {
  1400.       target = const0_rtx;
  1401.     }
  1402.   else if (structure_value_addr)
  1403.     {
  1404.       if (target == 0 || GET_CODE (target) != MEM)
  1405.     target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1406.               memory_address (TYPE_MODE (TREE_TYPE (exp)),
  1407.                       structure_value_addr));
  1408.     }
  1409.   else if (pcc_struct_value)
  1410.     {
  1411.       if (target == 0)
  1412.     target = gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1413.               copy_to_reg (valreg));
  1414.       else if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
  1415.     emit_move_insn (target, gen_rtx (MEM, TYPE_MODE (TREE_TYPE (exp)),
  1416.                      copy_to_reg (valreg)));
  1417.       else
  1418.     emit_block_move (target, gen_rtx (MEM, BLKmode, copy_to_reg (valreg)),
  1419.              expr_size (exp),
  1420.              TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT);
  1421.     }
  1422.   else if (target && GET_MODE (target) == TYPE_MODE (TREE_TYPE (exp)))
  1423.     /* TARGET and VALREG cannot be equal at this point because the latter
  1424.        would not have REG_FUNCTION_VALUE_P true, while the former would if
  1425.        it were referring to the same register.
  1426.  
  1427.        If they refer to the same register, this move will be a no-op, except
  1428.        when function inlining is being done.  */
  1429.     emit_move_insn (target, valreg);
  1430.   else
  1431.     target = copy_to_reg (valreg);
  1432.  
  1433.   /* Perform all cleanups needed for the arguments of this call
  1434.      (i.e. destructors in C++).  */
  1435.   expand_cleanups_to (old_cleanups);
  1436.  
  1437.   /* If size of args is variable, restore saved stack-pointer value.  */
  1438.  
  1439.   if (old_stack_level)
  1440.     {
  1441.       emit_move_insn (stack_pointer_rtx, old_stack_level);
  1442.       pending_stack_adjust = old_pending_adj;
  1443.     }
  1444.  
  1445. #ifdef ACCUMULATE_OUTGOING_ARGS
  1446.   else
  1447.     {
  1448. #ifdef REG_PARM_STACK_SPACE
  1449.       if (save_area)
  1450.     {
  1451.       enum machine_mode save_mode = GET_MODE (save_area);
  1452.       rtx stack_area
  1453.         = gen_rtx (MEM, save_mode,
  1454.                memory_address (save_mode,
  1455.                        plus_constant (argblock, low_to_save)));
  1456.  
  1457.       if (save_mode != BLKmode)
  1458.         emit_move_insn (stack_area, save_area);
  1459.       else
  1460.         emit_block_move (stack_area, validize_mem (save_area),
  1461.                  gen_rtx (CONST_INT, VOIDmode,
  1462.                       high_to_save - low_to_save + 1,
  1463.                       PARM_BOUNDARY / BITS_PER_UNIT));
  1464.     }
  1465. #endif
  1466.       
  1467.       /* If we saved any argument areas, restore them.  */
  1468.       for (i = 0; i < num_actuals; i++)
  1469.     if (args[i].save_area)
  1470.       {
  1471.         enum machine_mode save_mode = GET_MODE (args[i].save_area);
  1472.         rtx stack_area
  1473.           = gen_rtx (MEM, save_mode,
  1474.              memory_address (save_mode,
  1475.                      XEXP (args[i].stack_slot, 0)));
  1476.  
  1477.         if (save_mode != BLKmode)
  1478.           emit_move_insn (stack_area, args[i].save_area);
  1479.         else
  1480.           emit_block_move (stack_area, validize_mem (args[i].save_area),
  1481.                    gen_rtx (CONST_INT, VOIDmode,
  1482.                     args[i].size.constant),
  1483.                    PARM_BOUNDARY / BITS_PER_UNIT);
  1484.       }
  1485.  
  1486.       highest_outgoing_arg_in_use = initial_highest_arg_in_use;
  1487.       stack_usage_map = initial_stack_usage_map;
  1488.     }
  1489. #endif
  1490.  
  1491.   /* If this was alloca, record the new stack level for nonlocal gotos.  */
  1492.   if (may_be_alloca && nonlocal_goto_stack_level != 0)
  1493.     emit_move_insn (nonlocal_goto_stack_level, stack_pointer_rtx);
  1494.  
  1495.   /* If call is cse'able, make appropriate pair of reg-notes around it.  */
  1496.   if (is_const)
  1497.     {
  1498.       rtx insn_first = NEXT_INSN (insn_before);
  1499.       rtx insn_last = get_last_insn ();
  1500.       rtx note = 0;
  1501.  
  1502.       /* Don't put the notes on if we don't have insns that can hold them.  */
  1503.       if ((GET_CODE (insn_first) == INSN
  1504.        || GET_CODE (insn_first) == CALL_INSN
  1505.        || GET_CODE (insn_first) == JUMP_INSN)
  1506.       && (GET_CODE (insn_last) == INSN
  1507.           || GET_CODE (insn_last) == CALL_INSN
  1508.           || GET_CODE (insn_last) == JUMP_INSN))
  1509.     {
  1510.       /* Construct an "equal form" for the value
  1511.          which mentions all the arguments in order
  1512.          as well as the function name.  */
  1513. #ifdef PUSH_ARGS_REVERSED
  1514.       for (i = 0; i < num_actuals; i++)
  1515.         note = gen_rtx (EXPR_LIST, VOIDmode, args[i].value, note);
  1516. #else
  1517.       for (i = num_actuals - 1; i >= 0; i--)
  1518.         note = gen_rtx (EXPR_LIST, VOIDmode, args[i].value, note);
  1519. #endif
  1520.       note = gen_rtx (EXPR_LIST, VOIDmode,
  1521.               XEXP (DECL_RTL (fndecl), 0), note);
  1522.  
  1523.       REG_NOTES (insn_last)
  1524.         = gen_rtx (EXPR_LIST, REG_EQUAL, note,
  1525.                gen_rtx (INSN_LIST, REG_RETVAL, insn_first,
  1526.                 REG_NOTES (insn_last)));
  1527.       REG_NOTES (insn_first)
  1528.         = gen_rtx (INSN_LIST, REG_LIBCALL, insn_last,
  1529.                REG_NOTES (insn_first));
  1530.     }
  1531.     }
  1532.  
  1533.   pop_temp_slots ();
  1534.  
  1535.   return target;
  1536. }
  1537.  
  1538. #if 0
  1539. /* Return an rtx which represents a suitable home on the stack
  1540.    given TYPE, the type of the argument looking for a home.
  1541.    This is called only for BLKmode arguments.
  1542.  
  1543.    SIZE is the size needed for this target.
  1544.    ARGS_ADDR is the address of the bottom of the argument block for this call.
  1545.    OFFSET describes this parameter's offset into ARGS_ADDR.  It is meaningless
  1546.    if this machine uses push insns.  */
  1547.  
  1548. static rtx
  1549. target_for_arg (type, size, args_addr, offset)
  1550.      tree type;
  1551.      rtx size;
  1552.      rtx args_addr;
  1553.      struct args_size offset;
  1554. {
  1555.   rtx target;
  1556.   rtx offset_rtx = ARGS_SIZE_RTX (offset);
  1557.  
  1558.   /* We do not call memory_address if possible,
  1559.      because we want to address as close to the stack
  1560.      as possible.  For non-variable sized arguments,
  1561.      this will be stack-pointer relative addressing.  */
  1562.   if (GET_CODE (offset_rtx) == CONST_INT)
  1563.     target = plus_constant (args_addr, INTVAL (offset_rtx));
  1564.   else
  1565.     {
  1566.       /* I have no idea how to guarantee that this
  1567.      will work in the presence of register parameters.  */
  1568.       target = gen_rtx (PLUS, Pmode, args_addr, offset_rtx);
  1569.       target = memory_address (QImode, target);
  1570.     }
  1571.  
  1572.   return gen_rtx (MEM, BLKmode, target);
  1573. }
  1574. #endif
  1575.  
  1576. /* Store a single argument for a function call
  1577.    into the register or memory area where it must be passed.
  1578.    *ARG describes the argument value and where to pass it.
  1579.  
  1580.    ARGBLOCK is the address of the stack-block for all the arguments,
  1581.    or 0 on a machine where arguemnts are pushed individually.
  1582.  
  1583.    MAY_BE_ALLOCA nonzero says this could be a call to `alloca'
  1584.    so must be careful about how the stack is used. 
  1585.  
  1586.    VARIABLE_SIZE nonzero says that this was a variable-sized outgoing
  1587.    argument stack.  This is used if ACCUMULATE_OUTGOING_ARGS to indicate
  1588.    that we need not worry about saving and restoring the stack.
  1589.  
  1590.    FNDECL is the declaration of the function we are calling.  */
  1591.  
  1592. static void
  1593. store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl)
  1594.      struct arg_data *arg;
  1595.      rtx argblock;
  1596.      int may_be_alloca;
  1597.      int variable_size;
  1598.      tree fndecl;
  1599. {
  1600.   register tree pval = arg->tree_value;
  1601.   rtx reg = 0;
  1602.   int partial = 0;
  1603.   int used = 0;
  1604.   int i, lower_bound, upper_bound;
  1605.  
  1606.   if (TREE_CODE (pval) == ERROR_MARK)
  1607.     return;
  1608.  
  1609. #ifdef ACCUMULATE_OUTGOING_ARGS
  1610.   /* If this is being stored into a pre-allocated, fixed-size, stack area,
  1611.      save any previous data at that location.  */
  1612.   if (argblock && ! variable_size && arg->stack)
  1613.     {
  1614.       if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
  1615.     lower_bound = INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1));
  1616.       else
  1617.     lower_bound = 0;
  1618.  
  1619.       upper_bound = lower_bound + arg->size.constant;
  1620.  
  1621.       for (i = lower_bound; i < upper_bound; i++)
  1622.     if (stack_usage_map[i]
  1623. #ifdef REG_PARM_STACK_SPACE
  1624.         /* Don't store things in the fixed argument area at this point;
  1625.            it has already been saved.  */
  1626.         && i > REG_PARM_STACK_SPACE (fndecl)
  1627. #endif
  1628.         )
  1629.       break;
  1630.  
  1631.       if (i != upper_bound)
  1632.     {
  1633.       /* We need to make a save area.  See what mode we can make it.  */
  1634.       enum machine_mode save_mode
  1635.         = mode_for_size (arg->size.constant * BITS_PER_UNIT, MODE_INT, 1);
  1636.       rtx stack_area
  1637.         = gen_rtx (MEM, save_mode,
  1638.                memory_address (save_mode, XEXP (arg->stack_slot, 0)));
  1639.  
  1640.       if (save_mode == BLKmode)
  1641.         {
  1642.           arg->save_area = assign_stack_temp (BLKmode,
  1643.                           arg->size.constant, 1);
  1644.           emit_block_move (validize_mem (arg->save_area), stack_area,
  1645.                    gen_rtx (CONST_INT, VOIDmode,
  1646.                     arg->size.constant),
  1647.                    PARM_BOUNDARY / BITS_PER_UNIT);
  1648.         }
  1649.       else
  1650.         {
  1651.           arg->save_area = gen_reg_rtx (save_mode);
  1652.           emit_move_insn (arg->save_area, stack_area);
  1653.         }
  1654.     }
  1655.     }
  1656. #endif
  1657.  
  1658.   /* If this isn't going to be placed on both the stack and in registers,
  1659.      set up the register and number of words.  */
  1660.   if (! arg->pass_on_stack)
  1661.     reg = arg->reg, partial = arg->partial;
  1662.  
  1663.   if (reg != 0 && partial == 0)
  1664.     /* Being passed entirely in a register.  We shouldn't be called in
  1665.        this case.   */
  1666.     abort ();
  1667.  
  1668.   /* If this is being partially passed in a register, but multiple locations
  1669.      are specified, we assume that the one partially used is the one that is
  1670.      listed first.  */
  1671.   if (reg && GET_CODE (reg) == EXPR_LIST)
  1672.     reg = XEXP (reg, 0);
  1673.  
  1674.   /* If this is being passes partially in a register, we can't evaluate
  1675.      it directly into its stack slot.  Otherwise, we can.  */
  1676.   if (arg->value == 0)
  1677.     arg->value = expand_expr (pval, partial ? 0 : arg->stack, VOIDmode, 0);
  1678.  
  1679.   /* Don't allow anything left on stack from computation
  1680.      of argument to alloca.  */
  1681.   if (may_be_alloca)
  1682.     do_pending_stack_adjust ();
  1683.  
  1684.   if (arg->value == arg->stack)
  1685.     /* If the value is already in the stack slot, we are done.  */
  1686.     ;
  1687.   else if (TYPE_MODE (TREE_TYPE (pval)) != BLKmode)
  1688.     {
  1689.       register int size;
  1690.  
  1691.       /* Argument is a scalar, not entirely passed in registers.
  1692.      (If part is passed in registers, arg->partial says how much
  1693.      and emit_push_insn will take care of putting it there.)
  1694.      
  1695.      Push it, and if its size is less than the
  1696.      amount of space allocated to it,
  1697.      also bump stack pointer by the additional space.
  1698.      Note that in C the default argument promotions
  1699.      will prevent such mismatches.  */
  1700.  
  1701.       size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (pval)));
  1702.       /* Compute how much space the push instruction will push.
  1703.      On many machines, pushing a byte will advance the stack
  1704.      pointer by a halfword.  */
  1705. #ifdef PUSH_ROUNDING
  1706.       size = PUSH_ROUNDING (size);
  1707. #endif
  1708.       used = size;
  1709.  
  1710.       /* Compute how much space the argument should get:
  1711.      round up to a multiple of the alignment for arguments.  */
  1712.       if (none != FUNCTION_ARG_PADDING (TYPE_MODE (TREE_TYPE (pval)),
  1713.                     TREE_TYPE (pval)))
  1714.     used = (((size + PARM_BOUNDARY / BITS_PER_UNIT - 1)
  1715.          / (PARM_BOUNDARY / BITS_PER_UNIT))
  1716.         * (PARM_BOUNDARY / BITS_PER_UNIT));
  1717.  
  1718.       /* This isn't already where we want it on the stack, so put it there.
  1719.      This can either be done with push or copy insns.  */
  1720.       emit_push_insn (arg->value, TYPE_MODE (TREE_TYPE (pval)),
  1721.               TREE_TYPE (pval), 0, 0, partial, reg,
  1722.               used - size, argblock, ARGS_SIZE_RTX (arg->offset));
  1723.     }
  1724.   else
  1725.     {
  1726.       /* BLKmode, at least partly to be pushed.  */
  1727.  
  1728.       register int excess;
  1729.       rtx size_rtx;
  1730.  
  1731.       /* Pushing a nonscalar.
  1732.      If part is passed in registers, PARTIAL says how much
  1733.      and emit_push_insn will take care of putting it there.  */
  1734.  
  1735.       /* Round its size up to a multiple
  1736.      of the allocation unit for arguments.  */
  1737.  
  1738.       if (arg->size.var != 0)
  1739.     {
  1740.       excess = 0;
  1741.       size_rtx = ARGS_SIZE_RTX (arg->size);
  1742.     }
  1743.       else
  1744.     {
  1745.       register tree size = size_in_bytes (TREE_TYPE (pval));
  1746.       /* PUSH_ROUNDING has no effect on us, because
  1747.          emit_push_insn for BLKmode is careful to avoid it.  */
  1748.       excess = (arg->size.constant - TREE_INT_CST_LOW (size)
  1749.             + partial * UNITS_PER_WORD);
  1750.       size_rtx = expand_expr (size, 0, VOIDmode, 0);
  1751.     }
  1752.  
  1753.       emit_push_insn (arg->value, TYPE_MODE (TREE_TYPE (pval)),
  1754.               TREE_TYPE (pval), size_rtx,
  1755.               TYPE_ALIGN (TREE_TYPE (pval)) / BITS_PER_UNIT, partial,
  1756.               reg, excess, argblock, ARGS_SIZE_RTX (arg->offset));
  1757.     }
  1758.  
  1759.  
  1760.   /* Unless this is a partially-in-register argument, the argument is now
  1761.      in the stack. 
  1762.  
  1763.      ??? Note that this can change arg->value from arg->stack to
  1764.      arg->stack_slot and it matters when they are not the same.
  1765.      It isn't totally clear that this is correct in all cases.  */
  1766.   if (partial == 0)
  1767.     arg->value = arg->stack_slot;
  1768.  
  1769.   /* Once we have pushed something, pops can't safely
  1770.      be deferred during the rest of the arguments.  */
  1771.   NO_DEFER_POP;
  1772.  
  1773.   /* ANSI doesn't require a sequence point here,
  1774.      but PCC has one, so this will avoid some problems.  */
  1775.   emit_queue ();
  1776.  
  1777.   /* Free any temporary slots made in processing this argument.  */
  1778.   free_temp_slots ();
  1779.  
  1780. #ifdef ACCUMULATE_OUTGOING_ARGS
  1781.   /* Now mark the segment we just used.  */
  1782.   if (argblock && ! variable_size && arg->stack)
  1783.     for (i = lower_bound; i < upper_bound; i++)
  1784.       stack_usage_map[i] = 1;
  1785. #endif
  1786. }
  1787.