OSDN Git Service

H
[pf3gnuchains/gcc-fork.git] / gcc / calls.c
index 2bddc2a..d46973a 100644 (file)
@@ -126,7 +126,7 @@ static void emit_call_1             PROTO((rtx, tree, tree, HOST_WIDE_INT,
                                       HOST_WIDE_INT, rtx, rtx,
                                       int, rtx, int));
 static void store_one_arg      PROTO ((struct arg_data *, rtx, int, int,
-                                       tree, int));
+                                       int));
 \f
 /* If WHICH is 1, return 1 if EXP contains a call to the built-in function
    `alloca'.
@@ -343,8 +343,8 @@ emit_call_1 (funexp, fndecl, funtype, stack_size, struct_value_size,
              next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage,
             is_const)
      rtx funexp;
-     tree fndecl;
-     tree funtype;
+     tree fndecl ATTRIBUTE_UNUSED;
+     tree funtype ATTRIBUTE_UNUSED;
      HOST_WIDE_INT stack_size;
      HOST_WIDE_INT struct_value_size;
      rtx next_arg_reg;
@@ -595,7 +595,7 @@ expand_call (exp, target, ignore)
      if -fcheck-memory-usage, code which invokes functions (and thus
      damages some hard registers) can be inserted before using the value.
      So, target is always a pseudo-register in that case.  */
-  if (flag_check_memory_usage)
+  if (current_function_check_memory_usage)
     target = 0;
 
   /* See if we can find a DECL-node for the actual function.
@@ -1625,7 +1625,7 @@ expand_call (exp, target, ignore)
       pop_temp_slots ();       /* FUNEXP can't be BLKmode */
 
       /* Check the function is executable.  */
-      if (flag_check_memory_usage)
+      if (current_function_check_memory_usage)
        emit_library_call (chkr_check_exec_libfunc, 1,
                           VOIDmode, 1,
                           funexp, ptr_mode);
@@ -1765,7 +1765,7 @@ expand_call (exp, target, ignore)
   for (i = 0; i < num_actuals; i++)
     if (args[i].reg == 0 || args[i].pass_on_stack)
       store_one_arg (&args[i], argblock, may_be_alloca,
-                    args_size.var != 0, fndecl, reg_parm_stack_space);
+                    args_size.var != 0, reg_parm_stack_space);
 
   /* If we have a parm that is passed in registers but not in memory
      and whose alignment does not permit a direct copy into registers,
@@ -1777,7 +1777,7 @@ expand_call (exp, target, ignore)
       if (args[i].reg != 0 && ! args[i].pass_on_stack
        && args[i].mode == BLKmode
          && (TYPE_ALIGN (TREE_TYPE (args[i].tree_value))
-             < MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
+             < (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
        {
          int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
          int big_endian_correction = 0;
@@ -1835,7 +1835,7 @@ expand_call (exp, target, ignore)
     for (i = 0; i < num_actuals; i++)
       if (args[i].partial != 0 && ! args[i].pass_on_stack)
        store_one_arg (&args[i], argblock, may_be_alloca,
-                      args_size.var != 0, fndecl, reg_parm_stack_space);
+                      args_size.var != 0, reg_parm_stack_space);
 
 #ifndef PUSH_ARGS_REVERSED
 #ifdef STACK_BOUNDARY
@@ -1864,7 +1864,7 @@ expand_call (exp, target, ignore)
                                                NULL_RTX)));
 
       /* Mark the memory for the aggregate as write-only.  */
-      if (flag_check_memory_usage)
+      if (current_function_check_memory_usage)
        emit_library_call (chkr_set_right_libfunc, 1,
                           VOIDmode, 3,
                           structure_value_addr, ptr_mode, 
@@ -3357,13 +3357,12 @@ target_for_arg (type, size, args_addr, offset)
    FNDECL is the declaration of the function we are calling.  */
 
 static void
-store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl,
+store_one_arg (arg, argblock, may_be_alloca, variable_size,
               reg_parm_stack_space)
      struct arg_data *arg;
      rtx argblock;
      int may_be_alloca;
      int variable_size;
-     tree fndecl;
      int reg_parm_stack_space;
 {
   register tree pval = arg->tree_value;
@@ -3508,15 +3507,13 @@ store_one_arg (arg, argblock, may_be_alloca, variable_size, fndecl,
 
   if (arg->value == arg->stack)
     {
-      /* If the value is already in the stack slot, we are done.  */
-      if (flag_check_memory_usage && GET_CODE (arg->stack) == MEM)
+      /* If the value is already in the stack slot, we are done moving
+        data.  */
+      if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM)
        {
-         if (arg->mode == BLKmode)
-           abort ();
-
          emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
                             XEXP (arg->stack, 0), ptr_mode, 
-                            GEN_INT (GET_MODE_SIZE (arg->mode)),
+                            ARGS_SIZE_RTX (arg->size),
                             TYPE_MODE (sizetype),
                             GEN_INT (MEMORY_USE_RW),
                             TYPE_MODE (integer_type_node));