aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c70
1 files changed, 15 insertions, 55 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 79b6e25..4b34ab2 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -164,8 +164,6 @@ static void compute_argument_addresses (struct arg_data *, rtx, int);
static rtx rtx_for_function_call (tree, tree);
static void load_register_parameters (struct arg_data *, int, rtx *, int,
int, int *);
-static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
- machine_mode, int, va_list);
static int special_function_p (const_tree, int);
static int check_sibcall_argument_overlap_1 (rtx);
static int check_sibcall_argument_overlap (rtx_insn *, struct arg_data *, int);
@@ -4364,14 +4362,21 @@ split_complex_types (tree types)
return types;
}
-/* Output a library call to function FUN (a SYMBOL_REF rtx).
- The RETVAL parameter specifies whether return value needs to be saved, other
- parameters are documented in the emit_library_call function below. */
+/* Output a library call to function ORGFUN (a SYMBOL_REF rtx)
+ for a value of mode OUTMODE,
+ with NARGS different arguments, passed as ARGS.
+ Store the return value if RETVAL is nonzero: store it in VALUE if
+ VALUE is nonnull, otherwise pick a convenient location. In either
+ case return the location of the stored value.
-static rtx
+ FN_TYPE should be LCT_NORMAL for `normal' calls, LCT_CONST for
+ `const' calls, LCT_PURE for `pure' calls, or another LCT_ value for
+ other types of library calls. */
+
+rtx
emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
enum libcall_type fn_type,
- machine_mode outmode, int nargs, va_list p)
+ machine_mode outmode, int nargs, rtx_mode_t *args)
{
/* Total size in bytes of all the stack-parms scanned so far. */
struct args_size args_size;
@@ -4553,10 +4558,10 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
count++;
}
- for (; count < nargs; count++)
+ for (unsigned int i = 0; count < nargs; i++, count++)
{
- rtx val = va_arg (p, rtx);
- machine_mode mode = (machine_mode) va_arg (p, int);
+ rtx val = args[i].first;
+ machine_mode mode = args[i].second;
int unsigned_p = 0;
/* We cannot convert the arg value to the mode the library wants here;
@@ -5128,51 +5133,6 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
}
-/* Output a library call to function FUN (a SYMBOL_REF rtx)
- (emitting the queue unless NO_QUEUE is nonzero),
- for a value of mode OUTMODE,
- with NARGS different arguments, passed as alternating rtx values
- and machine_modes to convert them to.
-
- FN_TYPE should be LCT_NORMAL for `normal' calls, LCT_CONST for
- `const' calls, LCT_PURE for `pure' calls, or other LCT_ value for
- other types of library calls. */
-
-void
-emit_library_call (rtx orgfun, enum libcall_type fn_type,
- machine_mode outmode, int nargs, ...)
-{
- va_list p;
-
- va_start (p, nargs);
- emit_library_call_value_1 (0, orgfun, NULL_RTX, fn_type, outmode, nargs, p);
- va_end (p);
-}
-
-/* Like emit_library_call except that an extra argument, VALUE,
- comes second and says where to store the result.
- (If VALUE is zero, this function chooses a convenient way
- to return the value.
-
- This function returns an rtx for where the value is to be found.
- If VALUE is nonzero, VALUE is returned. */
-
-rtx
-emit_library_call_value (rtx orgfun, rtx value,
- enum libcall_type fn_type,
- machine_mode outmode, int nargs, ...)
-{
- rtx result;
- va_list p;
-
- va_start (p, nargs);
- result = emit_library_call_value_1 (1, orgfun, value, fn_type, outmode,
- nargs, p);
- va_end (p);
-
- return result;
-}
-
/* Store pointer bounds argument ARG into Bounds Table entry
associated with PARM. */