aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.stanford.edu>2000-11-17 06:05:31 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-11-17 06:05:31 +0000
commit520a57c81c83affcccb71eef52da0278991af777 (patch)
tree925528b7b20608d2eac0acf5e939480048b49271 /gcc/profile.c
parent5af655cceef2b8b61a323734a6f9c250b4f420ca (diff)
downloadgcc-520a57c81c83affcccb71eef52da0278991af777.zip
gcc-520a57c81c83affcccb71eef52da0278991af777.tar.gz
gcc-520a57c81c83affcccb71eef52da0278991af777.tar.bz2
stringpool.c: New file.
* stringpool.c: New file. * ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete. (ggc_alloc_string): Now in stringpool.o. * ggc-page.c, ggc-simple.c: Do not define or allocate empty_string. * ggc.h: Delete prototype of ggc_add_string_root. #define ggc_add_string_root and ggc_mark_string to nothing. Prototype init_stringpool and stringpool_statistics. (ggc_alloc_string): Returns a const char *. * tree.c (hash_table, do_identifier_warnings): Delete. (init_obstacks): Don't initialize the identifier hash table. (get_identifier, maybe_get_identifier, start_identifier_warnings, set_identifier_size): Now in stringpool.c. * tree.h (struct tree_string): Constify pointer field. (approx_sqrt): Prototype. * Makefile.in (stringpool.o): Add rule, mention in OBJS. * toplev.c (approx_sqrt): New function. (compile_file): Call stringpool_statistics if mem_report is on. (main): Call init_stringpool. * builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c (process_directive), c-typeck.c (constructor_asmspec, struct initializer_stack, start_init), except.c (create_rethrow_ref), stmt.c (digit_strings), toplev.c (decode_f_option), tree.c (built_in_filename), varasm,c (in_named_name, assemble_static_space, struct constant_descriptor, struct deferred_string, struct pool_constant, force_const_mem), i386.c (pic_label_name, global_offset_table_name), rs6000.c (rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *. * c-common.c (combine_strings): Combine strings in scratch buffer, then pass to build_string. * optabs.c (init_libfuncs), profile.c (init_edge_profiler, output_func_start_profiler), stmt.c (init_stmt), alpha.c (alpha_need_linkage), arm.c (arm_encode_call_attribute), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_encode_section_info): Create string in scratch buffer, then pass to ggc_alloc_string. * stmt.c (expand_asm_operands): If we must adjust the constraint strings, do so by creating a new one, not by modifying the old one in place. Constify some char *s. * config/pa/pa.c (hppa_encode_label): Drop unnecessary second argument. Create string in scratch buffer, then pass to ggc_alloc_string. * config/pa/pa-protos.h: Update prototype. * config/pa/elf.h, config/pa/pa.h, config/pa/som.h: hppa_encode_label takes only one argument. * c-parse.in (if_prefix): Find the filename and line number at $-2 and $-1 respectively. * diagnostic.c (error_recursion): Add missing newline, use fputs, translate string. cp: * lex.c (struct impl_files, internal_filename): Constify a char *. java: * jcf-parse.c (get_constant), parse.y (do_merge_string_cste): Create string in scratch buffer, then pass to build_string. From-SVN: r37514
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index b52b352..d60b2b2 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1025,9 +1025,9 @@ static void
init_edge_profiler ()
{
/* Generate and save a copy of this so it can be shared. */
- char *name = ggc_alloc_string (NULL, 20);
- ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
- profiler_label = gen_rtx_SYMBOL_REF (Pmode, name);
+ char buf[20];
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", 2);
+ profiler_label = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (buf, -1));
ggc_add_rtx_root (&profiler_label, 1);
}
@@ -1066,6 +1066,7 @@ output_func_start_profiler ()
{
tree fnname, fndecl;
char *name;
+ char buf[20];
const char *cfnname;
rtx table_address;
enum machine_mode mode = mode_for_size (LONG_TYPE_SIZE, MODE_INT, 0);
@@ -1121,9 +1122,10 @@ output_func_start_profiler ()
expand_function_start (fndecl, 0);
/* Actually generate the code to call __bb_init_func. */
- name = ggc_alloc_string (NULL, 20);
- ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);
- table_address = force_reg (Pmode, gen_rtx_SYMBOL_REF (Pmode, name));
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", 0);
+ table_address = force_reg (Pmode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ ggc_alloc_string (buf, -1)));
emit_library_call (gen_rtx_SYMBOL_REF
(Pmode, ggc_alloc_string ("__bb_init_func", 14)), 0,
mode, 1, table_address, Pmode);