libfuncs.h (LTI_setbits, [...]): New.

* libfuncs.h (LTI_setbits, LTI_gcov_flush, LTI_gcov_init): New.
        (setbits_libfunc, gcov_flush_libfunc, gcov_init_libfunc): New.
        * optabs.c (init_optabs): Initialize them.
        (init_libfuncs): Use init_one_libfunc.
        * calls.c (expand_call): Use gcov_flush_libfunc.
        * expr.c (store_constructor): Use setbits_libfunc.
        * function.c (expand_main_function): Use init_one_libfunc.
        * profile.c (create_profiler): Use gcov_init_libfunc and DECL_RTL.

From-SVN: r65478
This commit is contained in:
Richard Henderson 2003-04-11 12:45:32 -07:00 committed by Richard Henderson
parent 8d3f856e31
commit 68d28100a0
7 changed files with 30 additions and 16 deletions

View File

@ -1,3 +1,14 @@
2003-04-11 Richard Henderson <rth@redhat.com>
* libfuncs.h (LTI_setbits, LTI_gcov_flush, LTI_gcov_init): New.
(setbits_libfunc, gcov_flush_libfunc, gcov_init_libfunc): New.
* optabs.c (init_optabs): Initialize them.
(init_libfuncs): Use init_one_libfunc.
* calls.c (expand_call): Use gcov_flush_libfunc.
* expr.c (store_constructor): Use setbits_libfunc.
* function.c (expand_main_function): Use init_one_libfunc.
* profile.c (create_profiler): Use gcov_init_libfunc and DECL_RTL.
2003-04-11 Mark Mitchell <mark@codesourcery.com>
* doc/c-tree.texi (Functions): Remove DECL_REAL_CONTEXT

View File

@ -2635,9 +2635,7 @@ expand_call (exp, target, ignore)
is subject to race conditions, just as with multithreaded
programs. */
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gcov_flush"),
LCT_ALWAYS_RETURN,
VOIDmode, 0);
emit_library_call (gcov_flush_libfunc, LCT_ALWAYS_RETURN, VOIDmode, 0);
}
/* Ensure current function's preferred stack boundary is at least

View File

@ -5450,8 +5450,8 @@ store_constructor (exp, target, cleared, size)
TYPE_MODE (sizetype));
}
else
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"),
LCT_NORMAL, VOIDmode, 4, XEXP (targetx, 0),
emit_library_call (setbits_libfunc, LCT_NORMAL,
VOIDmode, 4, XEXP (targetx, 0),
Pmode, bitlength_rtx, TYPE_MODE (sizetype),
startbit_rtx, TYPE_MODE (sizetype),
endbit_rtx, TYPE_MODE (sizetype));

View File

@ -6470,8 +6470,7 @@ expand_main_function ()
#endif
#ifndef HAS_INIT_SECTION
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), LCT_NORMAL,
VOIDmode, 0);
emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0);
#endif
}

View File

@ -44,6 +44,7 @@ enum libfunc_index
LTI_bcmp,
LTI_memset,
LTI_bzero,
LTI_setbits,
LTI_unwind_resume,
LTI_eh_personality,
@ -143,6 +144,9 @@ enum libfunc_index
LTI_profile_function_entry,
LTI_profile_function_exit,
LTI_gcov_flush,
LTI_gcov_init,
LTI_MAX
};
@ -171,6 +175,7 @@ extern GTY(()) rtx libfunc_table[LTI_MAX];
#define bcmp_libfunc (libfunc_table[LTI_bcmp])
#define memset_libfunc (libfunc_table[LTI_memset])
#define bzero_libfunc (libfunc_table[LTI_bzero])
#define setbits_libfunc (libfunc_table[LTI_setbits])
#define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume])
#define eh_personality_libfunc (libfunc_table[LTI_eh_personality])
@ -271,4 +276,7 @@ extern GTY(()) rtx libfunc_table[LTI_MAX];
#define profile_function_entry_libfunc (libfunc_table[LTI_profile_function_entry])
#define profile_function_exit_libfunc (libfunc_table[LTI_profile_function_exit])
#define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush])
#define gcov_init_libfunc (libfunc_table[LTI_gcov_init])
#endif /* GCC_LIBFUNCS_H */

View File

@ -5329,8 +5329,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix)
*p = '\0';
optable->handlers[(int) mode].libfunc
= gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (libfunc_name,
p - libfunc_name));
= init_one_libfunc (ggc_alloc_string (libfunc_name, p - libfunc_name));
}
}
@ -5647,6 +5646,7 @@ init_optabs ()
bcmp_libfunc = init_one_libfunc ("__gcc_bcmp");
memset_libfunc = init_one_libfunc ("memset");
bzero_libfunc = init_one_libfunc ("bzero");
setbits_libfunc = init_one_libfunc ("__setbits");
unwind_resume_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
? "_Unwind_SjLj_Resume"
@ -5756,6 +5756,9 @@ init_optabs ()
profile_function_exit_libfunc
= init_one_libfunc ("__cyg_profile_func_exit");
gcov_flush_libfunc = init_one_libfunc ("__gcov_flush");
gcov_init_libfunc = init_one_libfunc ("__gcov_init");
#ifdef HAVE_conditional_trap
init_traps ();
#endif

View File

@ -1979,13 +1979,8 @@ create_profiler ()
cfun->arc_profile = 0;
/* Actually generate the code to call __gcov_init. */
gcov_info_address = force_reg (Pmode,
gen_rtx_SYMBOL_REF (
Pmode,
IDENTIFIER_POINTER (
DECL_NAME (gcov_info))));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gcov_init"),
LCT_NORMAL, VOIDmode, 1,
gcov_info_address = force_reg (Pmode, XEXP (DECL_RTL (gcov_info), 0));
emit_library_call (gcov_init_libfunc, LCT_NORMAL, VOIDmode, 1,
gcov_info_address, Pmode);
expand_function_end (input_filename, lineno, 0);