diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-09-04 07:30:53 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-09-04 07:30:53 +0000 |
commit | db69559bac8ab03ccddfe3a42be630e65c277812 (patch) | |
tree | 2cf080b045129f4dea972ab956100f6ec25bddbc /gcc | |
parent | 77701e2346bee936056ff33e1a94b214e359b4d2 (diff) | |
download | gcc-db69559bac8ab03ccddfe3a42be630e65c277812.zip gcc-db69559bac8ab03ccddfe3a42be630e65c277812.tar.gz gcc-db69559bac8ab03ccddfe3a42be630e65c277812.tar.bz2 |
PR82045: Avoid passing machine modes through "..."
PR82045 is about a bootstrap failure on sparc-sun-solaris2.11.
The problem was that we were passing the new machine_mode wrapper
classes through "..." to emit_library_call(_value), which then
read them back as ints instead.
The simplest fix seemed to be replace "..." with an array of
rtx_mode_ts, then provide wrappers for the common cases. This
bulks out rtl.h a bit, but it does make things a bit more typesafe.
2017-09-04 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR bootstrap/82045
* rtl.h (emit_library_call_value_1): Declare.
(emit_library_call): Replace declaration with a series of overloads.
Remove the parameter count argument.
(emit_library_call_value): Likewise.
* calls.c (emit_library_call_value_1): Make global. Replace varargs
with an "rtx_mode_t *".
(emit_library_call_value): Delete.
(emit_library_call): Likewise.
* asan.c (asan_emit_stack_protection): Update calls accordingly.
(asan_emit_allocas_unpoison): Likewise.
* builtins.c (expand_builtin_powi): Likewise.
(expand_asan_emit_allocas_unpoison): Likewise.
* cfgexpand.c (expand_main_function): Likewise.
* config/aarch64/aarch64.c (aarch64_trampoline_init): Likewise.
* config/aarch64/aarch64.h (PROFILE_HOOK): Likewise.
* config/alpha/alpha.c (alpha_trampoline_init): Likewise.
* config/arm/arm.c (arm_trampoline_init): Likewise.
(arm_call_tls_get_addr): Likewise.
(arm_expand_divmod_libfunc): Likewise.
* config/bfin/bfin.md (umulsi3_highpart): Likewise.
(smulsi3_highpart): Likewise.
* config/c6x/c6x.c (c6x_initialize_trampoline): Likewise.
(c6x_expand_compare): Likewise.
(c6x_expand_movmem): Likewise.
* config/frv/frv.c (frv_trampoline_init): Likewise.
* config/i386/i386.c (ix86_trampoline_init): Likewise.
(ix86_expand_divmod_libfunc): Likewise.
* config/ia64/ia64.c (ia64_expand_tls_address): Likewise.
(ia64_expand_compare): Likewise.
(ia64_profile_hook): Likewise.
* config/ia64/ia64.md (save_stack_nonlocal): Likewise.
(nonlocal_goto): Likewise.
(restore_stack_nonlocal): Likewise.
* config/m32r/m32r.c (block_move_call): Likewise.
(m32r_trampoline_init): Likewise.
* config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise.
* config/m68k/m68k.c (m68k_call_tls_get_addr): Likewise.
(m68k_call_m68k_read_tp): Likewise.
* config/microblaze/microblaze.c (microblaze_call_tls_get_addr)
(microblaze_expand_divide): Likewise.
* config/mips/mips.h (mips_args): Likewise.
* config/mips/sdemtk.h (mips_sync_icache): Likewise.
(MIPS_ICACHE_SYNC): Likewise.
* config/nios2/nios2.c (nios2_emit_expensive_div): Likewise.
(nios2_trampoline_init): Likewise.
* config/pa/pa.c (hppa_tls_call): Likewise.
(pa_trampoline_init): Likewise.
* config/pa/pa.md (canonicalize_funcptr_for_compare): Likewise.
* config/powerpcspe/powerpcspe.c (rs6000_legitimize_tls_address)
(expand_strn_compare): Likewise.
(rs6000_generate_compare): Likewise.
(rs6000_expand_float128_convert): Likewise.
(output_profile_hook): Likewise.
(rs6000_trampoline_init): Likewise.
* config/powerpcspe/powerpcspe.md (neg<mode>2): Likewise.
* config/riscv/riscv.h (PROFILE_HOOK): Likewise.
* config/rs6000/rs6000-string.c (expand_strn_compare): Likewise.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise.
(rs6000_generate_compare): Likewise.
(rs6000_expand_float128_convert): Likewise.
(output_profile_hook): Likewise.
(rs6000_trampoline_init): Likewise.
* config/rs6000/rs6000.md (neg<mode>2): Likewise.
* config/sh/sh.c (sh_trampoline_init): Likewise.
* config/sparc/sparc.c (emit_soft_tfmode_libcall): Likewise.
(sparc_emit_float_lib_cmp): Likewise.
(sparc32_initialize_trampoline): Likewise.
(sparc64_initialize_trampoline): Likewise.
(sparc_profile_hook): Likewise.
* config/spu/spu.c (ea_load_store): Likewise.
* config/spu/spu.md (floatunssidf2): Likewise.
* config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise.
* config/tilepro/tilepro.c (tilepro_trampoline_init): Likewise.
* config/visium/visium.c (expand_block_move_4): Likewise.
(expand_block_move_2): Likewise.
(expand_block_move_1): Likewise.
(expand_block_set_4): Likewise.
(expand_block_set_2): Likewise.
(expand_block_set_1): Likewise.
(visium_trampoline_init): Likewise.
(visium_profile_hook): Likewise.
* config/xtensa/xtensa.c (xtensa_expand_nonlocal_goto): Likewise.
(xtensa_setup_frame_addresses): Likewise.
(xtensa_trampoline_init): Likewise.
* except.c (sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
* explow.c (allocate_dynamic_stack_space): Likewise.
(probe_stack_range): Likewise.
* expr.c (convert_mode_scalar): Likewise.
* optabs.c (expand_binop): Likewise.
(expand_twoval_binop_libfunc): Likewise.
(expand_unop): Likewise.
(prepare_cmp_insn): Likewise.
(prepare_float_lib_cmp): Likewise.
(expand_float): Likewise.
(expand_fix): Likewise.
(expand_fixed_convert): Likewise.
(maybe_emit_sync_lock_test_and_set): Likewise.
(expand_atomic_compare_and_swap): Likewise.
(expand_mem_thread_fence): Likewise.
(expand_atomic_fetch_op): Likewise.
From-SVN: r251637
Diffstat (limited to 'gcc')
43 files changed, 387 insertions, 199 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 595a865..a1bdd85 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,108 @@ +2017-09-04 Richard Sandiford <richard.sandiford@linaro.org> + + PR bootstrap/82045 + * rtl.h (emit_library_call_value_1): Declare. + (emit_library_call): Replace declaration with a series of overloads. + Remove the parameter count argument. + (emit_library_call_value): Likewise. + * calls.c (emit_library_call_value_1): Make global. Replace varargs + with an "rtx_mode_t *". + (emit_library_call_value): Delete. + (emit_library_call): Likewise. + * asan.c (asan_emit_stack_protection): Update calls accordingly. + (asan_emit_allocas_unpoison): Likewise. + * builtins.c (expand_builtin_powi): Likewise. + (expand_asan_emit_allocas_unpoison): Likewise. + * cfgexpand.c (expand_main_function): Likewise. + * config/aarch64/aarch64.c (aarch64_trampoline_init): Likewise. + * config/aarch64/aarch64.h (PROFILE_HOOK): Likewise. + * config/alpha/alpha.c (alpha_trampoline_init): Likewise. + * config/arm/arm.c (arm_trampoline_init): Likewise. + (arm_call_tls_get_addr): Likewise. + (arm_expand_divmod_libfunc): Likewise. + * config/bfin/bfin.md (umulsi3_highpart): Likewise. + (smulsi3_highpart): Likewise. + * config/c6x/c6x.c (c6x_initialize_trampoline): Likewise. + (c6x_expand_compare): Likewise. + (c6x_expand_movmem): Likewise. + * config/frv/frv.c (frv_trampoline_init): Likewise. + * config/i386/i386.c (ix86_trampoline_init): Likewise. + (ix86_expand_divmod_libfunc): Likewise. + * config/ia64/ia64.c (ia64_expand_tls_address): Likewise. + (ia64_expand_compare): Likewise. + (ia64_profile_hook): Likewise. + * config/ia64/ia64.md (save_stack_nonlocal): Likewise. + (nonlocal_goto): Likewise. + (restore_stack_nonlocal): Likewise. + * config/m32r/m32r.c (block_move_call): Likewise. + (m32r_trampoline_init): Likewise. + * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. + * config/m68k/m68k.c (m68k_call_tls_get_addr): Likewise. + (m68k_call_m68k_read_tp): Likewise. + * config/microblaze/microblaze.c (microblaze_call_tls_get_addr) + (microblaze_expand_divide): Likewise. + * config/mips/mips.h (mips_args): Likewise. + * config/mips/sdemtk.h (mips_sync_icache): Likewise. + (MIPS_ICACHE_SYNC): Likewise. + * config/nios2/nios2.c (nios2_emit_expensive_div): Likewise. + (nios2_trampoline_init): Likewise. + * config/pa/pa.c (hppa_tls_call): Likewise. + (pa_trampoline_init): Likewise. + * config/pa/pa.md (canonicalize_funcptr_for_compare): Likewise. + * config/powerpcspe/powerpcspe.c (rs6000_legitimize_tls_address) + (expand_strn_compare): Likewise. + (rs6000_generate_compare): Likewise. + (rs6000_expand_float128_convert): Likewise. + (output_profile_hook): Likewise. + (rs6000_trampoline_init): Likewise. + * config/powerpcspe/powerpcspe.md (neg<mode>2): Likewise. + * config/riscv/riscv.h (PROFILE_HOOK): Likewise. + * config/rs6000/rs6000-string.c (expand_strn_compare): Likewise. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise. + (rs6000_generate_compare): Likewise. + (rs6000_expand_float128_convert): Likewise. + (output_profile_hook): Likewise. + (rs6000_trampoline_init): Likewise. + * config/rs6000/rs6000.md (neg<mode>2): Likewise. + * config/sh/sh.c (sh_trampoline_init): Likewise. + * config/sparc/sparc.c (emit_soft_tfmode_libcall): Likewise. + (sparc_emit_float_lib_cmp): Likewise. + (sparc32_initialize_trampoline): Likewise. + (sparc64_initialize_trampoline): Likewise. + (sparc_profile_hook): Likewise. + * config/spu/spu.c (ea_load_store): Likewise. + * config/spu/spu.md (floatunssidf2): Likewise. + * config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise. + * config/tilepro/tilepro.c (tilepro_trampoline_init): Likewise. + * config/visium/visium.c (expand_block_move_4): Likewise. + (expand_block_move_2): Likewise. + (expand_block_move_1): Likewise. + (expand_block_set_4): Likewise. + (expand_block_set_2): Likewise. + (expand_block_set_1): Likewise. + (visium_trampoline_init): Likewise. + (visium_profile_hook): Likewise. + * config/xtensa/xtensa.c (xtensa_expand_nonlocal_goto): Likewise. + (xtensa_setup_frame_addresses): Likewise. + (xtensa_trampoline_init): Likewise. + * except.c (sjlj_emit_function_enter): Likewise. + (sjlj_emit_function_exit): Likewise. + * explow.c (allocate_dynamic_stack_space): Likewise. + (probe_stack_range): Likewise. + * expr.c (convert_mode_scalar): Likewise. + * optabs.c (expand_binop): Likewise. + (expand_twoval_binop_libfunc): Likewise. + (expand_unop): Likewise. + (prepare_cmp_insn): Likewise. + (prepare_float_lib_cmp): Likewise. + (expand_float): Likewise. + (expand_fix): Likewise. + (expand_fixed_convert): Likewise. + (maybe_emit_sync_lock_test_and_set): Likewise. + (expand_atomic_compare_and_swap): Likewise. + (expand_mem_thread_fence): Likewise. + (expand_atomic_fetch_op): Likewise. + 2017-09-03 Gerald Pfeifer <gerald@pfeifer.com> * doc/generic.texi (OpenACC): Adjust URL. @@ -1347,7 +1347,7 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb, snprintf (buf, sizeof buf, "__asan_stack_malloc_%d", use_after_return_class); ret = init_one_libfunc (buf); - ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 1, + ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, GEN_INT (asan_frame_size + base_align_bias), TYPE_MODE (pointer_sized_int_node)); @@ -1477,7 +1477,7 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb, ret = init_one_libfunc (buf); rtx addr = convert_memory_address (ptr_mode, base); rtx orig_addr = convert_memory_address (ptr_mode, orig_base); - emit_library_call (ret, LCT_NORMAL, ptr_mode, 3, addr, ptr_mode, + emit_library_call (ret, LCT_NORMAL, ptr_mode, addr, ptr_mode, GEN_INT (asan_frame_size + base_align_bias), TYPE_MODE (pointer_sized_int_node), orig_addr, ptr_mode); @@ -1573,8 +1573,8 @@ asan_emit_allocas_unpoison (rtx top, rtx bot, rtx_insn *before) rtx ret = init_one_libfunc ("__asan_allocas_unpoison"); top = convert_memory_address (ptr_mode, top); bot = convert_memory_address (ptr_mode, bot); - ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top, - ptr_mode, bot, ptr_mode); + ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, + top, ptr_mode, bot, ptr_mode); do_pending_stack_adjust (); rtx_insn *insns = get_insns (); diff --git a/gcc/builtins.c b/gcc/builtins.c index 35be335..8fd1202 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -2768,7 +2768,7 @@ expand_builtin_powi (tree exp, rtx target) op1 = convert_to_mode (mode2, op1, 0); target = emit_library_call_value (optab_libfunc (powi_optab, mode), - target, LCT_CONST, mode, 2, + target, LCT_CONST, mode, op0, mode, op1, mode2); return target; @@ -4909,8 +4909,8 @@ expand_asan_emit_allocas_unpoison (tree exp) rtx top = expand_expr (arg0, NULL_RTX, ptr_mode, EXPAND_NORMAL); rtx bot = convert_memory_address (ptr_mode, virtual_stack_dynamic_rtx); rtx ret = init_one_libfunc ("__asan_allocas_unpoison"); - ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top, - ptr_mode, bot, ptr_mode); + ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, + top, ptr_mode, bot, ptr_mode); return ret; } 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. */ diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 7f5c97b..7657a65 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -6079,7 +6079,7 @@ expand_main_function (void) || (!defined(HAS_INIT_SECTION) \ && !defined(INIT_SECTION_ASM_OP) \ && !defined(INIT_ARRAY_SECTION_ASM_OP))) - emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0); + emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode); #endif } diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index ca07752..fe5b59c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5977,7 +5977,7 @@ aarch64_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) gen_clear_cache(). */ a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), - LCT_NORMAL, VOIDmode, 2, a_tramp, ptr_mode, + LCT_NORMAL, VOIDmode, a_tramp, ptr_mode, plus_constant (ptr_mode, a_tramp, TRAMPOLINE_SIZE), ptr_mode); } diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 7f91edb..a6e0479 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -857,7 +857,7 @@ typedef struct rtx fun, lr; \ lr = get_hard_reg_initial_val (Pmode, LR_REGNUM); \ fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \ - emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lr, Pmode); \ + emit_library_call (fun, LCT_NORMAL, VOIDmode, lr, Pmode); \ } /* All the work done in PROFILE_HOOK, but still required. */ diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index c37a7e3..cbcfc01 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5562,7 +5562,7 @@ alpha_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_insn (gen_imb ()); #ifdef HAVE_ENABLE_EXECUTE_STACK emit_library_call (init_one_libfunc ("__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); #endif } } diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 14c8b8c..b278534 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3888,7 +3888,7 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), - LCT_NORMAL, VOIDmode, 2, a_tramp, Pmode, + LCT_NORMAL, VOIDmode, a_tramp, Pmode, plus_constant (Pmode, a_tramp, TRAMPOLINE_SIZE), Pmode); } @@ -8364,7 +8364,7 @@ arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, LCT_PURE, /* LCT_CONST? */ - Pmode, 1, reg, Pmode); + Pmode, reg, Pmode); rtx_insn *insns = get_insns (); end_sequence (); @@ -31101,7 +31101,7 @@ arm_expand_divmod_libfunc (rtx libfunc, machine_mode mode, = smallest_int_mode_for_size (2 * GET_MODE_BITSIZE (mode)); rtx libval = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - libval_mode, 2, + libval_mode, op0, GET_MODE (op0), op1, GET_MODE (op1)); diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md index 819255d..1b7f6fe 100644 --- a/gcc/config/bfin/bfin.md +++ b/gcc/config/bfin/bfin.md @@ -1578,7 +1578,7 @@ emit_library_call_value (umulsi3_highpart_libfunc, operands[0], LCT_NORMAL, SImode, - 2, operands[1], SImode, operands[2], SImode); + operands[1], SImode, operands[2], SImode); } DONE; }) @@ -1628,7 +1628,7 @@ emit_library_call_value (smulsi3_highpart_libfunc, operands[0], LCT_NORMAL, SImode, - 2, operands[1], SImode, operands[2], SImode); + operands[1], SImode, operands[2], SImode); } DONE; }) diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index b4545aa..4671f3c 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -739,9 +739,8 @@ c6x_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt) #ifdef CLEAR_INSN_CACHE tramp = XEXP (tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gnu_clear_cache"), - LCT_NORMAL, VOIDmode, 2, tramp, Pmode, - plus_constant (Pmode, tramp, TRAMPOLINE_SIZE), - Pmode); + LCT_NORMAL, VOIDmode, tramp, Pmode, + plus_constant (Pmode, tramp, TRAMPOLINE_SIZE), Pmode); #endif } @@ -1592,7 +1591,7 @@ c6x_expand_compare (rtx comparison, machine_mode mode) } start_sequence (); - cmp = emit_library_call_value (libfunc, 0, LCT_CONST, SImode, 2, + cmp = emit_library_call_value (libfunc, 0, LCT_CONST, SImode, op0, op_mode, op1, op_mode); insns = get_insns (); end_sequence (); @@ -1728,7 +1727,7 @@ c6x_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, mark_addressable (src_expr); if (dst_expr) mark_addressable (dst_expr); - emit_library_call (fn, LCT_NORMAL, VOIDmode, 3, + emit_library_call (fn, LCT_NORMAL, VOIDmode, dstreg, Pmode, srcreg, Pmode, count_exp, SImode); return true; } diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 89ab54d..4e589cf 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -6241,7 +6241,7 @@ frv_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain) rtx sc_reg = force_reg (Pmode, static_chain); emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"), - LCT_NORMAL, VOIDmode, 4, + LCT_NORMAL, VOIDmode, addr, Pmode, GEN_INT (frv_trampoline_size ()), SImode, fnaddr, Pmode, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0fe2958..68cb32b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -31824,7 +31824,7 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) if (CHECK_EXECUTE_STACK_ENABLED) #endif emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); #endif } @@ -52432,10 +52432,10 @@ ix86_expand_divmod_libfunc (rtx libfunc, machine_mode mode, rtx rem = assign_386_stack_local (mode, SLOT_TEMP); rtx quot = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL, - mode, 3, - op0, GET_MODE (op0), - op1, GET_MODE (op1), - XEXP (rem, 0), Pmode); + mode, + op0, GET_MODE (op0), + op1, GET_MODE (op1), + XEXP (rem, 0), Pmode); *quot_p = quot; *rem_p = rem; } diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 409977f..1326877 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1202,8 +1202,8 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1, emit_insn (gen_load_dtprel (tga_op2, op1)); tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX, - LCT_CONST, Pmode, 2, tga_op1, - Pmode, tga_op2, Pmode); + LCT_CONST, Pmode, + tga_op1, Pmode, tga_op2, Pmode); insns = get_insns (); end_sequence (); @@ -1226,8 +1226,8 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1, tga_op2 = const0_rtx; tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX, - LCT_CONST, Pmode, 2, tga_op1, - Pmode, tga_op2, Pmode); + LCT_CONST, Pmode, + tga_op1, Pmode, tga_op2, Pmode); insns = get_insns (); end_sequence (); @@ -1836,7 +1836,7 @@ ia64_expand_compare (rtx *expr, rtx *op0, rtx *op1) start_sequence (); - ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, 3, + ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, *op0, TFmode, *op1, TFmode, GEN_INT (magic), DImode); cmp = gen_reg_rtx (BImode); @@ -11101,7 +11101,7 @@ ia64_profile_hook (int labelno) ip = gen_reg_rtx (Pmode); emit_insn (gen_ip_value (ip)); emit_library_call (gen_mcount_func_rtx (), LCT_NORMAL, - VOIDmode, 3, + VOIDmode, gen_rtx_REG (Pmode, BR_REG (0)), Pmode, ip, Pmode, label, Pmode); diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 054cfd8..b7cd52b 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -5056,7 +5056,7 @@ { emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_save_stack_nonlocal\"), - LCT_NORMAL, VOIDmode, 2, XEXP (operands[0], 0), Pmode, + LCT_NORMAL, VOIDmode, XEXP (operands[0], 0), Pmode, operands[1], Pmode); DONE; }) @@ -5069,7 +5069,7 @@ "" { emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_nonlocal_goto\"), - LCT_NORETURN, VOIDmode, 3, + LCT_NORETURN, VOIDmode, operands[1], Pmode, copy_to_reg (XEXP (operands[2], 0)), Pmode, operands[3], Pmode); @@ -5134,7 +5134,7 @@ { emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__ia64_restore_stack_nonlocal"), - LCT_NORMAL, VOIDmode, 1, + LCT_NORMAL, VOIDmode, copy_to_reg (XEXP (operands[1], 0)), Pmode); DONE; }) diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index ae37388..56d1dbd 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -2493,7 +2493,7 @@ block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx) bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1); emit_library_call (m32r_function_symbol ("memcpy"), LCT_NORMAL, - VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode, + VOIDmode, dest_reg, Pmode, src_reg, Pmode, convert_to_mode (TYPE_MODE (sizetype), bytes_rtx, TYPE_UNSIGNED (sizetype)), TYPE_MODE (sizetype)); @@ -2796,7 +2796,7 @@ m32r_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) gen_int_mode (m32r_cache_flush_trap, SImode))); else if (m32r_cache_flush_func && m32r_cache_flush_func[0]) emit_library_call (m32r_function_symbol (m32r_cache_flush_func), - LCT_NORMAL, VOIDmode, 3, XEXP (m_tramp, 0), Pmode, + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode, gen_int_mode (TRAMPOLINE_SIZE, SImode), SImode, GEN_INT (3), SImode); } diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index c6e0056..5ed48b3 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -192,8 +192,8 @@ along with GCC; see the file COPYING3. If not see #undef FINALIZE_TRAMPOLINE #define FINALIZE_TRAMPOLINE(TRAMP) \ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ + LCT_NORMAL, VOIDmode, TRAMP, Pmode, \ + plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ Pmode); /* Clear the instruction cache from `beg' to `end'. This makes an diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index fbec453..08c7292 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -2540,7 +2540,7 @@ m68k_call_tls_get_addr (rtx x, rtx eqv, enum m68k_reloc reloc) m68k_libcall_value_in_a0_p = true; a0 = emit_library_call_value (m68k_get_tls_get_addr (), NULL_RTX, LCT_PURE, - Pmode, 1, x, Pmode); + Pmode, x, Pmode); m68k_libcall_value_in_a0_p = false; insns = get_insns (); @@ -2589,7 +2589,7 @@ m68k_call_m68k_read_tp (void) /* Emit the call sequence. */ m68k_libcall_value_in_a0_p = true; a0 = emit_library_call_value (m68k_get_m68k_read_tp (), NULL_RTX, LCT_PURE, - Pmode, 0); + Pmode); m68k_libcall_value_in_a0_p = false; insns = get_insns (); end_sequence (); diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index cb61ae5..2a291ea 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -585,7 +585,7 @@ microblaze_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, LCT_PURE, /* LCT_CONST? */ - Pmode, 1, reg, Pmode); + Pmode, reg, Pmode); insns = get_insns (); end_sequence (); @@ -3560,10 +3560,10 @@ microblaze_expand_divide (rtx operands[]) emit_label (div_label); ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, "__divsi3"), - operands[0], LCT_NORMAL, - GET_MODE (operands[0]), 2, operands[1], - GET_MODE (operands[1]), operands[2], - GET_MODE (operands[2])); + operands[0], LCT_NORMAL, + GET_MODE (operands[0]), + operands[1], GET_MODE (operands[1]), + operands[2], GET_MODE (operands[2])); if (ret != operands[0]) emit_move_insn (operands[0], ret); diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 23e1672..3016ce0 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2603,7 +2603,7 @@ typedef struct mips_args { /* Flush both caches. We need to flush the data cache in case \ the system has a write-back cache. */ \ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \ - LCT_NORMAL, VOIDmode, 3, ADDR, Pmode, SIZE, Pmode, \ + LCT_NORMAL, VOIDmode, ADDR, Pmode, SIZE, Pmode, \ GEN_INT (3), TYPE_MODE (integer_type_node)) diff --git a/gcc/config/mips/sdemtk.h b/gcc/config/mips/sdemtk.h index 9b89f16..5144cda 100644 --- a/gcc/config/mips/sdemtk.h +++ b/gcc/config/mips/sdemtk.h @@ -70,7 +70,7 @@ extern void mips_sync_icache (void *beg, unsigned long len); #undef MIPS_ICACHE_SYNC #define MIPS_ICACHE_SYNC(ADDR, SIZE) \ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \ - LCT_NORMAL, VOIDmode, 2, ADDR, Pmode, \ + LCT_NORMAL, VOIDmode, ADDR, Pmode, \ SIZE, TYPE_MODE (sizetype)) /* This version of _mcount does not pop 2 words from the stack. */ diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c index 0a4ce38..fa7f14e 100644 --- a/gcc/config/nios2/nios2.c +++ b/gcc/config/nios2/nios2.c @@ -1734,7 +1734,7 @@ nios2_emit_expensive_div (rtx *operands, machine_mode mode) start_sequence (); final_result = emit_library_call_value (libfunc, NULL_RTX, - LCT_CONST, SImode, 2, + LCT_CONST, SImode, operands[1], SImode, operands[2], SImode); @@ -3025,7 +3025,7 @@ nios2_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt) rtx addr = force_reg (Pmode, XEXP (m_tramp, 0)); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"), - LCT_NORMAL, VOIDmode, 3, addr, Pmode, fnaddr, Pmode, + LCT_NORMAL, VOIDmode, addr, Pmode, fnaddr, Pmode, ctx_reg, Pmode); } diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 95ad7cf..6783fe3 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -906,7 +906,7 @@ hppa_tls_call (rtx arg) ret = gen_reg_rtx (Pmode); emit_library_call_value (gen_tls_get_addr (), ret, - LCT_CONST, Pmode, 1, arg, Pmode); + LCT_CONST, Pmode, arg, Pmode); return ret; } @@ -10192,7 +10192,7 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) #ifdef HAVE_ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); #endif } diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index e786d10..1d979e0 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -9637,7 +9637,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" emit_library_call_value (canonicalize_funcptr_for_compare_libfunc, operands[0], LCT_NORMAL, Pmode, - 1, operands[1], Pmode); + operands[1], Pmode); DONE; } diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c index b3c0a9e..0df373d 100644 --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c @@ -9694,7 +9694,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) { tga = rs6000_tls_get_addr (); emit_library_call_value (tga, dest, LCT_CONST, Pmode, - 1, const0_rtx, Pmode); + const0_rtx, Pmode); r3 = gen_rtx_REG (Pmode, 3); if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) @@ -9719,7 +9719,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) tga = rs6000_tls_get_addr (); tmp1 = gen_reg_rtx (Pmode); emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, - 1, const0_rtx, Pmode); + const0_rtx, Pmode); r3 = gen_rtx_REG (Pmode, 3); if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) @@ -20417,7 +20417,7 @@ expand_strn_compare (rtx operands[], int no_length) { tree fun = builtin_decl_explicit (BUILT_IN_STRCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 2, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode); } @@ -20436,7 +20436,7 @@ expand_strn_compare (rtx operands[], int no_length) tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 3, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode, len_rtx, GET_MODE (len_rtx)); @@ -20683,7 +20683,7 @@ expand_strn_compare (rtx operands[], int no_length) { tree fun = builtin_decl_explicit (BUILT_IN_STRCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 2, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode); } @@ -20698,7 +20698,7 @@ expand_strn_compare (rtx operands[], int no_length) emit_move_insn (len_rtx, GEN_INT (bytes - compare_length)); tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 3, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode, len_rtx, GET_MODE (len_rtx)); @@ -24720,7 +24720,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) if (!check_nan) dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, mode); + SImode, op0, mode, op1, mode); /* The library signals an exception for signalling NaNs, so we need to handle isgreater, etc. by first checking isordered. */ @@ -24736,8 +24736,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) /* Test for either value being a NaN. */ gcc_assert (unord_func); unord_dest = emit_library_call_value (unord_func, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, - mode); + SImode, op0, mode, op1, mode); /* Set value (0) if either value is a NaN, and jump to the join label. */ @@ -24756,8 +24755,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) /* Do the normal comparison, knowing that the values are not NaNs. */ normal_dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, - mode); + SImode, op0, mode, op1, mode); emit_insn (gen_cstoresi4 (dest, gen_rtx_fmt_ee (code, SImode, normal_dest, @@ -25121,8 +25119,8 @@ rs6000_expand_float128_convert (rtx dest, rtx src, bool unsigned_p) libfunc = convert_optab_libfunc (cvt, dest_mode, src_mode); gcc_assert (libfunc != NULL_RTX); - dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, 1, src, - src_mode); + dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, + src, src_mode); gcc_assert (dest2 != NULL_RTX); if (!rtx_equal_p (dest, dest2)) @@ -33083,7 +33081,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) #endif if (NO_PROFILE_COUNTERS) emit_library_call (init_one_libfunc (RS6000_MCOUNT), - LCT_NORMAL, VOIDmode, 0); + LCT_NORMAL, VOIDmode); else { char buf[30]; @@ -33095,7 +33093,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) fun = gen_rtx_SYMBOL_REF (Pmode, label_name); emit_library_call (init_one_libfunc (RS6000_MCOUNT), - LCT_NORMAL, VOIDmode, 1, fun, Pmode); + LCT_NORMAL, VOIDmode, fun, Pmode); } } else if (DEFAULT_ABI == ABI_DARWIN) @@ -33114,7 +33112,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) caller_addr_regno = 0; #endif emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name), - LCT_NORMAL, VOIDmode, 1, + LCT_NORMAL, VOIDmode, gen_rtx_REG (Pmode, caller_addr_regno), Pmode); } } @@ -35464,7 +35462,7 @@ rs6000_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt) case ABI_DARWIN: case ABI_V4: emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"), - LCT_NORMAL, VOIDmode, 4, + LCT_NORMAL, VOIDmode, addr, Pmode, GEN_INT (rs6000_trampoline_size ()), SImode, fnaddr, Pmode, diff --git a/gcc/config/powerpcspe/powerpcspe.md b/gcc/config/powerpcspe/powerpcspe.md index 799d786..8dc6929 100644 --- a/gcc/config/powerpcspe/powerpcspe.md +++ b/gcc/config/powerpcspe/powerpcspe.md @@ -7997,7 +7997,7 @@ { rtx libfunc = optab_libfunc (neg_optab, <MODE>mode); rtx target = emit_library_call_value (libfunc, operands[0], LCT_CONST, - <MODE>mode, 1, + <MODE>mode, operands[1], <MODE>mode); if (target && !rtx_equal_p (target, operands[0])) diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index c5d134c..30d2ae2 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -340,7 +340,7 @@ along with GCC; see the file COPYING3. If not see rtx fun, ra; \ ra = get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM); \ fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \ - emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, ra, Pmode); \ + emit_library_call (fun, LCT_NORMAL, VOIDmode, ra, Pmode); \ } /* All the work done in PROFILE_HOOK, but still required. */ diff --git a/gcc/config/rs6000/rs6000-string.c b/gcc/config/rs6000/rs6000-string.c index b71a4a3..fb57ab3 100644 --- a/gcc/config/rs6000/rs6000-string.c +++ b/gcc/config/rs6000/rs6000-string.c @@ -843,7 +843,7 @@ expand_strn_compare (rtx operands[], int no_length) { tree fun = builtin_decl_explicit (BUILT_IN_STRCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 2, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode); } @@ -862,7 +862,7 @@ expand_strn_compare (rtx operands[], int no_length) tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 3, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode, len_rtx, GET_MODE (len_rtx)); @@ -1109,7 +1109,7 @@ expand_strn_compare (rtx operands[], int no_length) { tree fun = builtin_decl_explicit (BUILT_IN_STRCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 2, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode); } @@ -1124,7 +1124,7 @@ expand_strn_compare (rtx operands[], int no_length) emit_move_insn (len_rtx, GEN_INT (bytes - compare_length)); tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP); emit_library_call_value (XEXP (DECL_RTL (fun), 0), - target, LCT_NORMAL, GET_MODE (target), 3, + target, LCT_NORMAL, GET_MODE (target), force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode, len_rtx, GET_MODE (len_rtx)); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index cf744d8..a787a29 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -9233,7 +9233,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) { tga = rs6000_tls_get_addr (); emit_library_call_value (tga, dest, LCT_CONST, Pmode, - 1, const0_rtx, Pmode); + const0_rtx, Pmode); r3 = gen_rtx_REG (Pmode, 3); if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) @@ -9258,7 +9258,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) tga = rs6000_tls_get_addr (); tmp1 = gen_reg_rtx (Pmode); emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, - 1, const0_rtx, Pmode); + const0_rtx, Pmode); r3 = gen_rtx_REG (Pmode, 3); if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) @@ -21887,7 +21887,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) if (!check_nan) dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, mode); + SImode, op0, mode, op1, mode); /* The library signals an exception for signalling NaNs, so we need to handle isgreater, etc. by first checking isordered. */ @@ -21903,8 +21903,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) /* Test for either value being a NaN. */ gcc_assert (unord_func); unord_dest = emit_library_call_value (unord_func, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, - mode); + SImode, op0, mode, op1, mode); /* Set value (0) if either value is a NaN, and jump to the join label. */ @@ -21923,8 +21922,7 @@ rs6000_generate_compare (rtx cmp, machine_mode mode) /* Do the normal comparison, knowing that the values are not NaNs. */ normal_dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - SImode, 2, op0, mode, op1, - mode); + SImode, op0, mode, op1, mode); emit_insn (gen_cstoresi4 (dest, gen_rtx_fmt_ee (code, SImode, normal_dest, @@ -22287,8 +22285,8 @@ rs6000_expand_float128_convert (rtx dest, rtx src, bool unsigned_p) libfunc = convert_optab_libfunc (cvt, dest_mode, src_mode); gcc_assert (libfunc != NULL_RTX); - dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, 1, src, - src_mode); + dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, + src, src_mode); gcc_assert (dest2 != NULL_RTX); if (!rtx_equal_p (dest, dest2)) @@ -29928,7 +29926,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) #endif if (NO_PROFILE_COUNTERS) emit_library_call (init_one_libfunc (RS6000_MCOUNT), - LCT_NORMAL, VOIDmode, 0); + LCT_NORMAL, VOIDmode); else { char buf[30]; @@ -29940,7 +29938,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) fun = gen_rtx_SYMBOL_REF (Pmode, label_name); emit_library_call (init_one_libfunc (RS6000_MCOUNT), - LCT_NORMAL, VOIDmode, 1, fun, Pmode); + LCT_NORMAL, VOIDmode, fun, Pmode); } } else if (DEFAULT_ABI == ABI_DARWIN) @@ -29959,7 +29957,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) caller_addr_regno = 0; #endif emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name), - LCT_NORMAL, VOIDmode, 1, + LCT_NORMAL, VOIDmode, gen_rtx_REG (Pmode, caller_addr_regno), Pmode); } } @@ -32309,7 +32307,7 @@ rs6000_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt) case ABI_DARWIN: case ABI_V4: emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"), - LCT_NORMAL, VOIDmode, 4, + LCT_NORMAL, VOIDmode, addr, Pmode, GEN_INT (rs6000_trampoline_size ()), SImode, fnaddr, Pmode, diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index f67e949..10ce014 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7886,7 +7886,7 @@ { rtx libfunc = optab_libfunc (neg_optab, <MODE>mode); rtx target = emit_library_call_value (libfunc, operands[0], LCT_CONST, - <MODE>mode, 1, + <MODE>mode, operands[1], <MODE>mode); if (target && !rtx_equal_p (target, operands[0])) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 2d906a2..c68b077 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -10090,7 +10090,7 @@ sh_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt) || (!(TARGET_SH4A || TARGET_SH4_300) && TARGET_USERMODE)) emit_library_call (function_symbol (NULL, "__ic_invalidate", FUNCTION_ORDINARY).sym, - LCT_NORMAL, VOIDmode, 1, tramp, SImode); + LCT_NORMAL, VOIDmode, tramp, SImode); else emit_insn (gen_ic_invalidate_line (tramp)); } diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 50882d0..57b008e 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3399,11 +3399,11 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) if (GET_MODE (operands[0]) == TFmode) { if (nargs == 2) - emit_library_call (func_sym, LCT_NORMAL, VOIDmode, 2, + emit_library_call (func_sym, LCT_NORMAL, VOIDmode, arg[0], GET_MODE (arg[0]), arg[1], GET_MODE (arg[1])); else - emit_library_call (func_sym, LCT_NORMAL, VOIDmode, 3, + emit_library_call (func_sym, LCT_NORMAL, VOIDmode, arg[0], GET_MODE (arg[0]), arg[1], GET_MODE (arg[1]), arg[2], GET_MODE (arg[2])); @@ -3418,7 +3418,7 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) gcc_assert (nargs == 2); ret = emit_library_call_value (func_sym, operands[0], LCT_NORMAL, - GET_MODE (operands[0]), 1, + GET_MODE (operands[0]), arg[1], GET_MODE (arg[1])); if (ret != operands[0]) @@ -8131,7 +8131,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc); emit_library_call (libfunc, LCT_NORMAL, - DImode, 2, + DImode, XEXP (slot0, 0), Pmode, XEXP (slot1, 0), Pmode); mode = DImode; @@ -8140,7 +8140,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) { libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc); emit_library_call (libfunc, LCT_NORMAL, - SImode, 2, + SImode, x, TFmode, y, TFmode); mode = SImode; } @@ -9632,7 +9632,7 @@ sparc32_initialize_trampoline (rtx m_tramp, rtx fnaddr, rtx cxt) the stack address is accessible. */ #ifdef HAVE_ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); #endif } @@ -9679,7 +9679,7 @@ sparc64_initialize_trampoline (rtx m_tramp, rtx fnaddr, rtx cxt) the stack address is accessible. */ #ifdef HAVE_ENABLE_EXECUTE_STACK emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); #endif } @@ -10183,13 +10183,13 @@ sparc_profile_hook (int labelno) fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_FUNCTION); if (NO_PROFILE_COUNTERS) { - emit_library_call (fun, LCT_NORMAL, VOIDmode, 0); + emit_library_call (fun, LCT_NORMAL, VOIDmode); } else { ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); - emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lab, Pmode); + emit_library_call (fun, LCT_NORMAL, VOIDmode, lab, Pmode); } } diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 5fabdd24..cd840e3 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -4201,14 +4201,14 @@ ea_load_store (rtx mem, bool is_store, rtx ea_addr, rtx data_addr) if (!cache_fetch_dirty) cache_fetch_dirty = init_one_libfunc ("__cache_fetch_dirty"); emit_library_call_value (cache_fetch_dirty, data_addr, LCT_NORMAL, Pmode, - 2, ea_addr, EAmode, ndirty, SImode); + ea_addr, EAmode, ndirty, SImode); } else { if (!cache_fetch) cache_fetch = init_one_libfunc ("__cache_fetch"); emit_library_call_value (cache_fetch, data_addr, LCT_NORMAL, Pmode, - 1, ea_addr, EAmode); + ea_addr, EAmode); } } diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md index fd6d253..9b76669 100644 --- a/gcc/config/spu/spu.md +++ b/gcc/config/spu/spu.md @@ -864,9 +864,10 @@ { start_sequence (); value = - emit_library_call_value (convert_optab_libfunc (ufloat_optab, - DFmode, SImode), - NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], SImode); + emit_library_call_value (convert_optab_libfunc (ufloat_optab, + DFmode, SImode), + NULL_RTX, LCT_NORMAL, DFmode, + operands[1], SImode); rtx_insn *insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], value, @@ -959,7 +960,8 @@ value = emit_library_call_value (convert_optab_libfunc (ufloat_optab, DFmode, DImode), - NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], DImode); + NULL_RTX, LCT_NORMAL, DFmode, + operands[1], DImode); rtx_insn *insns = get_insns (); end_sequence (); emit_libcall_block (insns, operands[0], value, diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 2f00b73..004cc93 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -5063,7 +5063,7 @@ tilegx_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain) TRAMPOLINE_SIZE)); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), - LCT_NORMAL, VOIDmode, 2, begin_addr, Pmode, + LCT_NORMAL, VOIDmode, begin_addr, Pmode, end_addr, Pmode); } diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c index 9b6c5f6..ae3337b 100644 --- a/gcc/config/tilepro/tilepro.c +++ b/gcc/config/tilepro/tilepro.c @@ -4472,7 +4472,7 @@ tilepro_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain) TRAMPOLINE_SIZE)); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), - LCT_NORMAL, VOIDmode, 2, begin_addr, Pmode, + LCT_NORMAL, VOIDmode, begin_addr, Pmode, end_addr, Pmode); } diff --git a/gcc/config/visium/visium.c b/gcc/config/visium/visium.c index aa14d2b..dcffe5c 100644 --- a/gcc/config/visium/visium.c +++ b/gcc/config/visium/visium.c @@ -2380,7 +2380,7 @@ expand_block_move_4 (rtx dst, rtx dst_reg, rtx src, rtx src_reg, rtx bytes_rtx) emit_insn (insn); } else - emit_library_call (long_int_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (long_int_memcpy_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, src_reg, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2416,7 +2416,7 @@ expand_block_move_2 (rtx dst, rtx dst_reg, rtx src, rtx src_reg, rtx bytes_rtx) unsigned HOST_WIDE_INT bytes = UINTVAL (bytes_rtx); unsigned int rem = bytes % 2; - emit_library_call (wrd_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (wrd_memcpy_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, src_reg, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2440,7 +2440,7 @@ expand_block_move_2 (rtx dst, rtx dst_reg, rtx src, rtx src_reg, rtx bytes_rtx) static void expand_block_move_1 (rtx dst_reg, rtx src_reg, rtx bytes_rtx) { - emit_library_call (byt_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (byt_memcpy_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, src_reg, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2459,7 +2459,7 @@ expand_block_set_4 (rtx dst, rtx dst_reg, rtx value_rtx, rtx bytes_rtx) unsigned int rem = bytes % 4; value_rtx = convert_to_mode (Pmode, value_rtx, 1); - emit_library_call (long_int_memset_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (long_int_memset_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, value_rtx, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2505,7 +2505,7 @@ expand_block_set_2 (rtx dst, rtx dst_reg, rtx value_rtx, rtx bytes_rtx) unsigned int rem = bytes % 2; value_rtx = convert_to_mode (Pmode, value_rtx, 1); - emit_library_call (wrd_memset_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (wrd_memset_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, value_rtx, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2529,7 +2529,7 @@ static void expand_block_set_1 (rtx dst_reg, rtx value_rtx, rtx bytes_rtx) { value_rtx = convert_to_mode (Pmode, value_rtx, 1); - emit_library_call (byt_memset_libfunc, LCT_NORMAL, VOIDmode, 3, + emit_library_call (byt_memset_libfunc, LCT_NORMAL, VOIDmode, dst_reg, Pmode, value_rtx, Pmode, convert_to_mode (TYPE_MODE (sizetype), @@ -2681,7 +2681,7 @@ visium_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain) GEN_INT (0xffff), NULL_RTX), 0x04940000)); - emit_library_call (set_trampoline_parity_libfunc, LCT_NORMAL, VOIDmode, 1, + emit_library_call (set_trampoline_parity_libfunc, LCT_NORMAL, VOIDmode, addr, SImode); } @@ -2721,7 +2721,7 @@ visium_profile_hook (void) { visium_frame_needed = true; emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "mcount"), LCT_NORMAL, - VOIDmode, 0); + VOIDmode); } /* A C expression whose value is RTL representing the address in a stack frame diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 14219bc..9c94c59 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1343,7 +1343,7 @@ xtensa_expand_nonlocal_goto (rtx *operands) containing_fp = force_reg (Pmode, containing_fp); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_nonlocal_goto"), - LCT_NORMAL, VOIDmode, 2, + LCT_NORMAL, VOIDmode, containing_fp, Pmode, goto_handler, Pmode); } @@ -1623,7 +1623,7 @@ xtensa_setup_frame_addresses (void) if (TARGET_WINDOWED_ABI) emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_libgcc_window_spill"), - LCT_NORMAL, VOIDmode, 0); + LCT_NORMAL, VOIDmode); } @@ -4045,7 +4045,7 @@ xtensa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain) emit_move_insn (adjust_address (m_tramp, SImode, chain_off), chain); emit_move_insn (adjust_address (m_tramp, SImode, func_off), func); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_sync_caches"), - LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode); + LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode); } /* Implement TARGET_LEGITIMATE_CONSTANT_P. */ diff --git a/gcc/except.c b/gcc/except.c index 1159b18..10b5a7c 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1190,7 +1190,7 @@ sjlj_emit_function_enter (rtx_code_label *dispatch_label) } emit_library_call (unwind_sjlj_register_libfunc, LCT_NORMAL, VOIDmode, - 1, XEXP (fc, 0), Pmode); + XEXP (fc, 0), Pmode); seq = get_insns (); end_sequence (); @@ -1232,7 +1232,7 @@ sjlj_emit_function_exit (void) start_sequence (); emit_library_call (unwind_sjlj_unregister_libfunc, LCT_NORMAL, VOIDmode, - 1, XEXP (crtl->eh.sjlj_fc, 0), Pmode); + XEXP (crtl->eh.sjlj_fc, 0), Pmode); seq = get_insns (); end_sequence (); diff --git a/gcc/explow.c b/gcc/explow.c index 82380f3..13736a5 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1408,7 +1408,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align, func = init_one_libfunc ("__morestack_allocate_stack_space"); space = emit_library_call_value (func, target, LCT_NORMAL, Pmode, - 1, ask, Pmode); + ask, Pmode); if (available_label == NULL_RTX) return space; @@ -1621,8 +1621,8 @@ probe_stack_range (HOST_WIDE_INT first, rtx size) stack_pointer_rtx, plus_constant (Pmode, size, first))); - emit_library_call (stack_check_libfunc, LCT_THROW, VOIDmode, 1, addr, - Pmode); + emit_library_call (stack_check_libfunc, LCT_THROW, VOIDmode, + addr, Pmode); } /* Next see if we have an insn to check the stack. */ @@ -327,7 +327,7 @@ convert_mode_scalar (rtx to, rtx from, int unsignedp) start_sequence (); value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode, - 1, from, from_mode); + from, from_mode); insns = get_insns (); end_sequence (); emit_libcall_block (insns, to, value, diff --git a/gcc/optabs.c b/gcc/optabs.c index 2c4de74..b7f1e2c 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1759,7 +1759,7 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, /* Pass 1 for NO_QUEUE so we don't lose any increments if the libcall is cse'd or moved. */ value = emit_library_call_value (libfunc, - NULL_RTX, LCT_CONST, mode, 2, + NULL_RTX, LCT_CONST, mode, op0, mode, op1x, op1_mode); insns = get_insns (); @@ -2092,7 +2092,7 @@ expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1, libval_mode = smallest_int_mode_for_size (2 * GET_MODE_BITSIZE (mode)); start_sequence (); libval = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - libval_mode, 2, + libval_mode, op0, mode, op1, mode); /* Get the part of VAL containing the value that we want. */ @@ -2966,7 +2966,7 @@ expand_unop (machine_mode mode, optab unoptab, rtx op0, rtx target, /* Pass 1 for NO_QUEUE so we don't lose any increments if the libcall is cse'd or moved. */ value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, outmode, - 1, op0, mode); + op0, mode); insns = get_insns (); end_sequence (); @@ -3917,7 +3917,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size, ret_mode = targetm.libgcc_cmp_return_mode (); result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - ret_mode, 2, x, mode, y, mode); + ret_mode, x, mode, y, mode); /* There are two kinds of comparison routines. Biased routines return 0/1/2, and unbiased routines return -1/0/1. Other parts @@ -4171,7 +4171,7 @@ prepare_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison, start_sequence (); value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - cmp_mode, 2, x, mode, y, mode); + cmp_mode, x, mode, y, mode); insns = get_insns (); end_sequence (); @@ -4811,8 +4811,7 @@ expand_float (rtx to, rtx from, int unsignedp) start_sequence (); value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - GET_MODE (to), 1, from, - GET_MODE (from)); + GET_MODE (to), from, GET_MODE (from)); insns = get_insns (); end_sequence (); @@ -5004,8 +5003,7 @@ expand_fix (rtx to, rtx from, int unsignedp) start_sequence (); value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, - GET_MODE (to), 1, from, - GET_MODE (from)); + GET_MODE (to), from, GET_MODE (from)); insns = get_insns (); end_sequence (); @@ -5097,7 +5095,7 @@ expand_fixed_convert (rtx to, rtx from, int uintp, int satp) start_sequence (); value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, to_mode, - 1, from, from_mode); + from, from_mode); insns = get_insns (); end_sequence (); @@ -5944,7 +5942,7 @@ maybe_emit_sync_lock_test_and_set (rtx target, rtx mem, rtx val, addr = convert_memory_address (ptr_mode, XEXP (mem, 0)); return emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL, - mode, 2, addr, ptr_mode, + mode, addr, ptr_mode, val, mode); } } @@ -6252,7 +6250,7 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval, { rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0)); rtx target = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL, - mode, 3, addr, ptr_mode, + mode, addr, ptr_mode, expected, mode, desired, mode); emit_move_insn (target_oval, target); @@ -6313,7 +6311,7 @@ expand_mem_thread_fence (enum memmodel model) else if (targetm.have_memory_barrier ()) emit_insn (targetm.gen_memory_barrier ()); else if (synchronize_libfunc != NULL_RTX) - emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode, 0); + emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode); else expand_asm_memory_barrier (); } @@ -6813,7 +6811,7 @@ expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code, { rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0)); result = emit_library_call_value (libfunc, NULL, LCT_NORMAL, mode, - 2, addr, ptr_mode, val, mode); + addr, ptr_mode, val, mode); if (!unused_result && fixup) result = expand_simple_binop (mode, code, result, val, target, @@ -3773,10 +3773,138 @@ enum libcall_type LCT_RETURNS_TWICE = 5 }; -extern void emit_library_call (rtx, enum libcall_type, machine_mode, int, - ...); -extern rtx emit_library_call_value (rtx, rtx, enum libcall_type, - machine_mode, int, ...); +extern rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type, + machine_mode, int, rtx_mode_t *); + +/* Output a library call and discard the returned value. FUN is the + address of the function, as a SYMBOL_REF rtx, and OUTMODE is the mode + of the (discarded) return value. FN_TYPE is 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. + + There are different overloads of this function for different numbers + of arguments. In each case the argument value is followed by its mode. */ + +inline void +emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode) +{ + emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 0, NULL); +} + +inline void +emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode, + rtx arg1, machine_mode arg1_mode) +{ + rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) }; + emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 1, args); +} + +inline void +emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode) + }; + emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 2, args); +} + +inline void +emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode, + rtx arg3, machine_mode arg3_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode), + rtx_mode_t (arg3, arg3_mode) + }; + emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 3, args); +} + +inline void +emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode, + rtx arg3, machine_mode arg3_mode, + rtx arg4, machine_mode arg4_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode), + rtx_mode_t (arg3, arg3_mode), + rtx_mode_t (arg4, arg4_mode) + }; + emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 4, args); +} + +/* Like emit_library_call, but return the value produced by the call. + Use VALUE to store the result if it is nonnull, otherwise pick a + convenient location. */ + +inline rtx +emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, + machine_mode outmode) +{ + return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 0, NULL); +} + +inline rtx +emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, + machine_mode outmode, + rtx arg1, machine_mode arg1_mode) +{ + rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) }; + return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 1, args); +} + +inline rtx +emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, + machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode) + }; + return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 2, args); +} + +inline rtx +emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, + machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode, + rtx arg3, machine_mode arg3_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode), + rtx_mode_t (arg3, arg3_mode) + }; + return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 3, args); +} + +inline rtx +emit_library_call_value (rtx fun, rtx value, libcall_type fn_type, + machine_mode outmode, + rtx arg1, machine_mode arg1_mode, + rtx arg2, machine_mode arg2_mode, + rtx arg3, machine_mode arg3_mode, + rtx arg4, machine_mode arg4_mode) +{ + rtx_mode_t args[] = { + rtx_mode_t (arg1, arg1_mode), + rtx_mode_t (arg2, arg2_mode), + rtx_mode_t (arg3, arg3_mode), + rtx_mode_t (arg4, arg4_mode) + }; + return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 4, args); +} /* In varasm.c */ extern void init_varasm_once (void); |