aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcov.c
AgeCommit message (Collapse)AuthorFilesLines
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-14/+9
From-SVN: r145841
2009-02-20Update Copyright years for files modified in 2008 and/or 2009.Jakub Jelinek1-1/+2
From-SVN: r144324
2009-01-20libgcov.c (__gcov_execl, [...]): Remove const qualifier from arg parameter.Ben Elliston1-6/+6
* libgcov.c (__gcov_execl, __gcov_execlp, __gcov_execle): Remove const qualifier from arg parameter. Remove unnecessary cast to char *. * gcov-io.h (__gcov_execl, __gcov_execlp, __gcov_execle): Remove const qualifier from arg 2. From-SVN: r143511
2008-10-29re PR target/32277 (indir-call-prof fails on ia64-linux-gnu)Steve Ellcey1-1/+6
PR target/32277 * libgcov.c ( __gcov_indirect_call_profiler): Check TARGET_VTABLE_USES_DESCRIPTORS. From-SVN: r141442
2007-01-28expr.c (emit_block_move_via_movmem, [...]): Add variant handling histograms; ↵Jan Hubicka1-0/+36
add wrapper. * expr.c (emit_block_move_via_movmem, emit_block_move_via_libcall): Add variant handling histograms; add wrapper. (clear_storage_via_libcall): Export. (emit_block_move_hints): Break out from ...; add histograms. (emit_block_move): ... this one. (clear_storage_hints): Break out from ...; add histograms. (clear_storage): ... this one. (set_storage_via_memset): Handle histogram. * expr.h (emit_block_move_via_libcall, emit_block_move_hints): Declare. (clear_storage_hints, clear_storage_via_libcall): Declare. (set_storage_via_setmem): Update prototype. * doc/md.texi (movmem, setmem): Document new arguments. * value-prof.c (dump_histogram_value, tree_find_values_to_profile): Add new histograms. (stringop_block_profile): New global function. (tree_stringops_values_to_profile): Profile block size and alignment. * value-prof.h (enum hist_type): add HIST_TYPE_AVERAGE and HIST_TYPE_IOR. (struct profile_hooks): Add gen_average_profiler and gen_ior_profiler. (stringop_block_profile): Declare. * builtins.c: Include value-prof.h. (expand_builtin_memcpy, expand_builtin_memset): Pass block profile. * gcov-ui.h (GCOV_COUNTER_NAMES): Add new counter. (GCOV_COUNTER_AVERAGE, GCOV_COUNTER_IOR): New constants. (GCOV_COUNTERS, GCOV_LAST_VALUE_COUNTER): Update. * profile.c (instrument_values): Add new counters. * cfgexpand.c (expand_gimple_basic_block): Propagate histograms to calls. * tree-profile.c (tree_average_profiler_fn, tree_ior_profiler_fn): New. (tree_init_edge_profiler): Build new profilers. (tree_gen_average_profiler, tree_gen_ior_profiler): New. (pass_tree_profile): Add dump. (tree_profile_hooks): Update. * Makefile.in (LIBGCOV): Add new constants. * libgcov.c (__gcov_merge_ior, __gcov_average_profiler, __gcov_ior_profiler): New. * i386.md (movmem/setmem expanders): Add new optional arguments. From-SVN: r121270
2007-01-19Patch by Tomas Bily <tbily@suse.cz>Tomas Bily1-3/+20
Patch by Tomas Bily <tbily@suse.cz> * cgraphunit.c (cgraph_finalize_function): Updating of pid * tree-profile.c: (tree_init_ic_make_global_vars): New function (tree_init_edge_profiler): call of tree_init_ic_make_global_vars (tree_gen_ic_profiler): New function (tree_gen_ic_func_profiler): New function (tree_profiling): Added calling of tree_gen_ic_func_profiler (tree_profile_hooks): Added hook for indirec/virtual calls * value-prof.c (tree_find_values_to_profile): New case for indirect calls (tree_values_to_profile): Call for determining indirect/virtual counters (tree_indirect_call_to_profile): New function (tree_ic_transform): New function (tree_ic): New function (find_func_by_pid): New function (init_pid_map): New function (tree_value_profile_transformations): Added check for indirect/virtual call transformation * value-prof.h (enum hist_type): New counter type for indirect/virtual calls (profile_hooks): Added new hook for profiling indirect/virtual calls * profile.c (instrument_values): New case for indirect/virtual call added * gcov-io.h (GCOV_LAST_VALUE_COUNTER): Changed to 6 (GCOV_COUNTER_V_INDIR): New counter type (GCOV_COUNTER_NAMES): New name of counter "indirect" added (GCOV_MERGE_FUNCTIONS): New merge function for indirect/virtual call added * cgraph.c: Definition of cgraph_max_pid (cgraph_create_node): Default init of pid attribute * cgraph.h: Declaration of cgraph_max_pid (struct cgraph_node): Added pid attribute * libgcov.c (__gcov_indirect_call_profiler): New function (__gcov_one_value_profiler_body): New function (__gcov_one_value_profiler): Body was moved to __gcov_one_value_profiler_body and calls it gcc.dg/tree-prof/indir-call-prof.c: New. g++.dg/dg.exp: Add tree-prof subdirectory. g++.dg/tree-prof/indir-call-prof.C: New. g++.dg/tree-prof/tree-prof.exp: New. From-SVN: r120975
2005-12-18tree-vn.c (vn_add): Use XNEW.Gabriel Dos Reis1-4/+4
* tree-vn.c (vn_add): Use XNEW. * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC. (ccp_fold): Likewise. (fold_stmt_r): Use explicit cast to convert from void *. * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC. (new_temp_expr_table): Likewise. * gimplify.c (lookup_tmp_var): Use XNEW. (gimplify_asm_expr): Use explcit cast to convert from void *. * tree-into-ssa.c (get_ssa_name_ann): Likewise. (get_def_blocks_for): Use XNEW. (add_to_repl_tbl): Likewise. (mark_def_sites): Use explicit cast to convert from void *. (def_blocks_free): Likewise. (mark_def_sites_initialize_block): Likewise. (update_ssa): Use XNEWVEC. * tree-dfa.c (create_var_ann): Use GGC_NEW. (create_stmt_ann): Likewise. (create_tree_ann): Likewise. (referenced_var_insert): Likewise. (set_default_def): Likewise. (referenced_var_lookup_if_exists): Use explicit cast to * convert from void *. (referenced_var_lookup): Likewise. (default_def): Likewise. (set_default_def): Likewise. * tree-cfg.c (create_bb): Likewise. (edge_to_cases_cleanup): Likewise. (verify_node_sharing): Likewise. (record_switch_edge): Use XNEW. (cleanup_dead_labels): Use XCNEWVEC. (tree_duplicate_sese_region): Use XNEWVEC. * tree-scalar-evolution.c (get_instantiated_value): Likewise. * tree-ssa.c (verify_ssa): Use XCNEWVEC. (int_tree_map_eq): Use explicit cast to convert from void *. * libgcov.c (gcov_exit): Use explicit cast to convert from * void *. (__gcov_execl): Likewise. (__gcov_execlp): Likewise. (__gcov_execle): Likewise. * tree-eh.c (struct_ptr_eq): Likewise. (struct_ptr_hash): Likewise. (lookup_stmt_eh_region_fn): Likewise. (outside_finally_tree): Likewise. (find_goto_replacement): Likewise. (make_eh_edge): Likewise. (mark_eh_edge): Likewise. (add_stmt_to_eh_region_fn): Use GGC_NEW. (record_in_finally_tree): Use XNEW. (maybe_record_in_goto_queue): Use XRESIZEVEC. (lower_try_finally_copy): Use XCNEWVEC. From-SVN: r108736
2005-07-13linux.h (TARGET_HAS_F_SETLKW): Renamed to ...H.J. Lu1-0/+4
2005-07-13 H.J. Lu <hongjiu.lu@intel.com> * config/alpha/linux.h (TARGET_HAS_F_SETLKW): Renamed to ... (TARGET_POSIX_IO): This. * config/darwin.h: Likewise. * config/freebsd.h: Likewise. * config/linux.h: Likewise. * config/lynx.h: Likewise. * config/netbsd.h: Likewise. * config/rs6000/linux64.h: Likewise. * config/rs6000/linux.h: Likewise. * config/s390/tpf.h: Likewise. * config/sh/embed-elf.h: Likewise. * config/sparc/linux64.h: Likewise. * config/sparc/linux.h: Likewise. * config/svr4.h: Likewise. * gcov-io.h: Likewise. * doc/tm.texi: Updated. * libgcov.c (create_file_directory): Defined only if TARGET_POSIX_IO is defined. (gcov_exit): Call create_file_directory only if TARGET_POSIX_IO is defined. From-SVN: r101973
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-05-11libgcov.c (gcov_exit): Set prefix_length to 0 if no relocation is needed.H.J. Lu1-0/+2
2005-05-11 H.J. Lu <hongjiu.lu@intel.com> * libgcov.c (gcov_exit): Set prefix_length to 0 if no relocation is needed. From-SVN: r99584
2005-05-11* fold-const.c, libgcov.c: Fix comment typos.Kazu Hirata1-2/+2
From-SVN: r99582
2005-05-10libgcov.c (create_file_directory): New function.Grigory Zagorodnev1-13/+122
* libgcov.c (create_file_directory): New function. Create directory for the given file name. (gcov_max_filename): New static var. Keeps size of the longest file name. (gcov_exit): Always try to create directory for output file. Relocate each filename basing on environment vars. (__gcov_init): Remember the longest file name. * tsystem.h: include filenames.h to get IS_DIR_SEPARATOR * doc/gcov.texi (Cross-profiling): New node documenting cross-profiling management. * doc/invoke.texi (-fprofile-arcs): Add xref to cross-profiling. From-SVN: r99523
2005-05-08Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.shNathan Sidwell1-4/+0
* Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.sh * aclocal.m4 (GCC_TARGET_TEMPLATE, AH_TEMPLATE): New. * configure.ac (enable_checking): Fix typos in runtime_checking. (ENABLE_RUNTIME_CHECKING): Mark as target template. (xm_file): Prepend auto-host.h (HAVE_GAS_HIDDEN, HAVE_LD_EH_FRAME_HDR): Mark as target template. * mkconfig.sh: Do not automatically define USED_FOR_TARGET in tconfig.h. * crtstuff.c: Do not include auto-host.h. (IN_LIBGCC2): Do not define. * gcov-io.h: Include tconfig.h, not auto-host.h. * libgcc2.c: Do not include auto-host.h. (abort): Do not undefine. * libgcov.c: Remove unneeded comment about config.h. * unwind-dw2-fde-glibc.c: Do not inlude auto-host.h. * config.in, configure: Regenerated. Co-Authored-By: Paolo Bonzini <bonzini@gnu.org> From-SVN: r99386
2005-04-28attribs.c, [...]: Update copyright.Kazu Hirata1-1/+1
* attribs.c, c-pragma.c, caller-save.c, cfghooks.h, coverage.c, cselib.h, domwalk.c, domwalk.h, errors.c, errors.h, gcov-dump.c, gcov-io.c, gcov-io.h, gen-protos.c, genattrtab.h, genextract.c, gthr-win32.h, insn-notes.def, integrate.c, lambda-mat.c, lambda.h, libgcov.c, local-alloc.c, machmode.def, mips-tfile.c, params.c, pretty-print.c, print-rtl.c, protoize.c, regmove.c, sched-vis.c, tree-chrec.h, tree-data-ref.h, vec.h, config/darwin-c.c, config/sol2-c.c, config/sol2.c, config/arm/arm-cores.def, config/arm/cirrus.md, config/arm/symbian.h, config/c4x/c4x.c, config/c4x/c4x.h, config/i386/cygming.h, config/i386/djgpp.h, config/i386/lynx.h, config/i386/netware.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/iq2000/iq2000.c, config/m32r/little.h, config/m68k/m68k-protos.h, config/m68k/m68k.h, config/m68k/m68k.md, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.md, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/netbsd.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-hpux11.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/rs6000/darwin.h, config/rs6000/default64.h, config/rs6000/rs6000-c.c, config/s390/2064.md, config/s390/2084.md, config/s390/s390-modes.def, config/s390/s390-protos.h, config/s390/tpf.h, config/sh/sh.h, config/sh/symbian.c, config/stormy16/stormy16.c, config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h, config/xtensa/lib1funcs.asm, config/xtensa/xtensa.md: Update copyright. From-SVN: r98914
2005-04-22Makefile.in (LIBGCOV): Add _gcov_interval_profiler, _gcov_pow2_profiler and ↵Zdenek Dvorak1-0/+61
_gcov_one_value_profiler. * Makefile.in (LIBGCOV): Add _gcov_interval_profiler, _gcov_pow2_profiler and _gcov_one_value_profiler. (tree-profile.o): Add GGC_H and gt-tree-profile.h dependency. (GTFILES): Add $(srcdir)/tree-profile.c. * gcov-io.h (__gcov_interval_profiler, __gcov_pow2_profiler, __gcov_one_value_profiler): Declare. * gimplify.c (force_gimple_operand): Check whether the statements should be produced in ssa form. (force_gimple_operand_bsi): New function. * libgcov.c (__gcov_interval_profiler, __gcov_pow2_profiler, __gcov_one_value_profiler): New functions. * rtl-profile.c (rtl_gen_pow2_profiler): Only measure whether the profiled value is a power of two or not. * tree-cfg.c (tree_block_ends_with_condjump_p): Handle empty blocks. * tree-flow.h (in_ssa_p): Declare. (force_gimple_operand_bsi): Declare. * tree-into-ssa.c (in_ssa_p): New variable. (rewrite_into_ssa): Set in_ssa_p. * tree-outof-ssa.c (rewrite_out_of_ssa): Set in_ssa_p. * tree-profile.c: Include ggc.h and gt-tree-profile.h. (gcov_type_node, tree_interval_profiler_fn, tree_pow2_profiler_fn, tree_one_value_profiler_fn): New variables. (tree_init_edge_profiler): Initialize the profiler function decls. (tree_gen_edge_profiler): Use global gcov_type_node. (prepare_instrumented_value): New function. (tree_gen_interval_profiler, tree_gen_interval_profiler, tree_gen_one_value_profiler): Call the library functions instead of creating instrumentation code. * tree.c (build_fn_decl): New function. * tree.h (build_fn_decl): Declare. * value-prof.c (rtl_divmod_values_to_profile, rtl_find_values_to_profile, rtl_mod_pow2_value_transform, tree_mod_pow2_value_transform, tree_find_values_to_profile): Do not handle may_be_other and precise values of exponents at pow2 profiler. (tree_mod_subtract_transform): Reflect that value field of histogram has changed meaning. (tree_divmod_values_to_profile): Record the values correctly. (tree_values_to_profile): Update comment. * value-prof.h (struct histogram_value_t): Remove pow2 data. From-SVN: r98555
2005-04-01gcov-io.h (GCOV_CHECK, [...]): Remove.Nathan Sidwell1-2/+2
* gcov-io.h (GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): Remove. (gcov_position, gcov_rewrite): Use gcc_assert. * gcov-io.c (gcov_open, gcov_write_words, gcov_write_length, gcov_read_words, gcov_sync, gcov_seek): Use gcc_assert. * libgcov.c (__gcov_merge_single, __gcov_merge_delta): Use gcc_assert. From-SVN: r97392
2004-07-29gcov-io.h: Allow zero tag as EOF indicator.Nathan Sidwell1-19/+20
* gcov-io.h: Allow zero tag as EOF indicator. (gcov_is_eof): Remove. (gcov_truncate): Remove. * gcov-io.c (gcov_seek): Always SEEK_SET. * libgcov.c (gcov_exit): Don't use gcov_truncate. Write explicit EOF tag. * coverage.c (read_counts_file): Don't use gcov_is_eof. * gcov-dump.c (dump_file): Likewise. * gcov.c (read_graph_file, read_count_file): Likewise. From-SVN: r85291
2004-04-23Makefile.in (LIBGCOV): Add _gcov_fork...Zdenek Dvorak1-0/+142
* Makefile.in (LIBGCOV): Add _gcov_fork, _gcov_execl, _gcov_execlp, _gcov_execle, _gcov_execv, _gcov_execvp, _gcov_execve. * builtin-types.def (BT_PID, BT_PTR_CONST_STRING, BT_FN_PID, BT_FN_INT_CONST_STRING_PTR_CONST_STRING, BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING): New. * builtins.c (expand_builtin_fork_or_exec): New. (expand_builtin): Call it. * builtins.def (BUILT_IN_EXECL, BUILT_IN_EXECLP,BUILT_IN_EXECLE, BUILT_IN_EXECV, BUILT_IN_EXECVP, BUILT_IN_EXECVE, BUILT_IN_FORK): New. * c-common.c (PID_TYPE): New macro. (c_common_nodes_and_builtins): Initialize pid_type_node. * calls.c (special_function_p): Do not handle fork and exec. (expand_call): Do not handle ECF_FORK_OR_EXEC. * gcov-io.h (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, __gcov_execv, __gcov_execvp, __gcov_execve): Declare. * libgcov.c (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle, __gcov_execv, __gcov_execvp, __gcov_execve): New. * tree.h (enum tree_index): Add TI_PID_TYPE. (pid_type_node): New macro. (ECF_FORK_OR_EXEC): Removed. From-SVN: r81118
2004-02-23convert.c, [...]: Update copyright.Kazu Hirata1-1/+1
* convert.c, gcov-io.c, libgcov.c, sched-int.h, sibcall.c, config/rs6000/linux.h, config/rs6000/rs6000-c.c: Update copyright. From-SVN: r78318
2004-02-23gcov-io.c (gcov_open): Use open + fdopen instead of fopen.Jakub Jelinek1-0/+1
* gcov-io.c (gcov_open) [GCOV_LOCKED]: Use open + fdopen instead of fopen. * libgcov.c: Include sys/stat.h. * config/rs6000/linux.h (TARGET_HAS_F_SETLKW): Define. * config/rs6000/linux64.h (TARGET_HAS_F_SETLKW): Define. * config/sparc/linux.h (TARGET_HAS_F_SETLKW): Define. * config/sparc/linux64.h (TARGET_HAS_F_SETLKW): Define. From-SVN: r78281
2003-09-29* libgcov.c (gcov_exit): Fix two pastos.Jan Hubicka1-2/+2
From-SVN: r71906
2003-08-02libgcov.c (gcov_exit): Cleanup and fix.Zdenek Dvorak1-80/+101
* libgcov.c (gcov_exit): Cleanup and fix. * profile.c (compute_value_histograms): Don't try to read profiles that are not present. From-SVN: r70100
2003-07-10gcov-io.h: Update documentation.Nathan Sidwell1-18/+20
* gcov-io.h: Update documentation. (GCOV_UNSIGNED2STRING): New. (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH, GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH, GCOV_TAG_SUMMARY_LENGTH): Adjust. (GCOV_TAG_BLOCKS_NUM, GCOV_TAG_ARCS_NUM, GCOV_TAG_COUNTER_NUM): New. (GCOV_BLOCK_SIZE): Number of words. (gcov_var): Adjust buffer type. * gcov-io.c (gcov_write_bytes, gcov_read_bytes): Rename to ... (gcov_write_words, gcov_read_words): ... here. Take a 4-byte word count, not byte count. (gcov_open): Adjust overread init. (gcov_allocate, gcov_write_unsigned, gcov_write_counter, gcov_write_string, gcov_write_tag, gcov_write_length, gcov_write_tag_length): Adjust. (gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust. (gcov_sync, gcov_seek): Adjust. * gcov-dump.c (print_usage): Show gcc version only. (dump_file): Use GCOV_UNSIGNED2STRING. (tag_blocks, tag_arcs, tag_counters): Use GCOV_TAG_*_NUM macros. * gcov.c (print_version): Show gcc version only. (read_graph_file): Use GCOV_UNSIGNED2STRING. Use GCOV_TAG_*_NUM macros. (read_count_file): Use GCOV_UNSIGNED2STRING. Use GCOV_TAG_COUNTER_LENGTH. * coverage.c (read_counts_file): Use GCOV_UNSIGNED2STRING. Use GCOV_TAG_COUNTER_NUM. * libgcov.c (gcov_version): Use GCOV_UNSIGNED2STRING. (__gcov_merge_single, __gcov_merge_delta): Use GCOV_CHECK. From-SVN: r69188
2003-07-09gcov-io.h: Update documentation.Nathan Sidwell1-35/+26
* gcov-io.h: Update documentation. (GCOV_GRAPH_SUFFIX, GCOV_GRAPH_MAGIC): Rename to GCOV_NOTE_SUFFIX, GCOV_NOTE_MAGIC. (GCOV_DATA_SUFFIX, GCOV_NOTE_SUFFIX): Update. (GCOV_DATA_MAGIC, GCOV_NOTE_MAGIC): Make non-palindromic. (struct gcov_var): Change buffer's type. Add endian flag. (gcov_open): Remove mode in libgcov. (gcov_magic): Prototype. * gcov-io.c (from_file): New. (gcov_open): Clear endian flag. (gcov_magic): New. (gcov_write_bytes, gcov_read_bytes): Return gcov_unsigned_t pointers. (gcov_write_unsigned, gcov_write_counter, gcov_write_string, gcov_write_tag, gcov_write_length, gcov_write_tag_length): Update. (gcov_read_unsigned, gcov_read_counter, gcov_read_string): Update. * gcov-iov.c (main): Correct cast. * coverage.c (read_counts_file): Use gcov_magic. Remove endianness conversion. (gcov_begin_output): Use GCOV_NOTE_MAGIC. (coverage_init): Use GCOV_NOTE_SUFFIX. * libgcov.c (gcov_version_mismatch): Remove endianness conversion. Rename to gcov_version, and return flag. (gcov_exit): Use gcov_version. (__gcov_init): Use gcov_version. * Makefile.in (coverageexts): Update. * gcov.c (print_version): Remove endianness conversion. (create_file_names): Use GCOV_NOTE_SUFFIX. (read_graph_file): Use gcov_magic. (read_count_file): Likewise. * gcov-dump.c (dump_file): Remove endianness conversion, use gcov_magic. From-SVN: r69137
2003-07-06gcov-io.h: Add a local time stamp.Nathan Sidwell1-3/+13
* gcov-io.h: Add a local time stamp. (struct gcov_info): Add stamp field. (gcov_truncate): New. * coverage.c (read_counts_file): Skip the stamp. (coverage_begin_output): Write the stamp. (build_gcov_info): Declare and init the stamp. (coverage_finish): Only unlink data file, if stamp is zero. * gcov-dump.c (dump_file): Dump the stamp. * gcov.c (bbg_stamp): New. (release_structures): Clear bbg_stamp. (read_graph_file): Read stamp. (read_count_file): Check stamp. * libgcov.c (gcov_exit): Check stamp and truncate if needed. From-SVN: r69006
2003-06-29alloc-pool.c: Fix comment formatting.Kazu Hirata1-2/+2
* alloc-pool.c: Fix comment formatting. * bitmap.c: Likewise. * bitmap.h: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * cfganal.c: Likewise. * cfgrtl.c: Likewise. * collect2.c: Likewise. * cse.c: Likewise. * df.c: Likewise. * diagnostic.c: Likewise. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * expmed.c: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * gcc.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * libgcov.c: Likewise. * mips-tfile.c: Likewise. * optabs.c: Likewise. * prefix.c: Likewise. * rtlanal.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * toplev.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. From-SVN: r68672
2003-06-26value-prof.c: New.Zdenek Dvorak1-0/+89
* value-prof.c: New. * value-prof.h: New. * Makefile.in (value-prof.o): New. (LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta (profile.o): Add value-prof.h and tree.h dependency. * flags.h (flag_profile_values): Declare. * gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS): Add new counters. (GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE, GCOV_COUNTER_V_DELTA): New counter sections. (__gcov_merge_single, __gcov_merge_delta): Declare. * flow.c (mark_used_regs): Set subregs_of_mode only when the structure is initialized. * libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions. * profile.c: Include value-prof.h and tree.h. (gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler, gen_const_delta_profiler, instrument_values): New static functions. (get_exec_counts): Fix comment. (branch_prob): Invoke instrument_values. * toplev.c (flag_profile_values): New flag. * doc/invoke.texi (-fprofile-values): Document. From-SVN: r68519
2003-05-14gcov-io.h (gcov_write_bytes, [...]): Remove here.Nathan Sidwell1-14/+18
* gcov-io.h (gcov_write_bytes, gcov_read_bytes): Remove here. (GCOV_TAG_*) Force type to gcov_unsigned_t. (GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): New. (struct gcov_var): Remove modified. Add start, length, offset, overread. Have buffer array for libgcov. (gcov_sync, gcov_seek): Definitions moved to gcov-io.c. (gcov_position, gcov_rewrite, gcov_is_eof): Adjust. * gcov-io.c (gcov_open): Set mode, do not read anything. (gcov_close): Write final block. (gcov_write_block, gcov_allocate): New. (gcov_write_bytes): Make static. Write or allocate buffer. (gcov_write_unsigned, gcov_write_counter): Buffer can never be null. (gcov_write_string): Adjust. (gcov_write_tag) (gcov_write_length): Adjust. Flush the block. (gcov_write_tag_length): Buffer can never be null. (gcov_read_bytes): Make static. Read in block. (gcov_sync): Moved here. Adjust. (gcov_seek): Moved here. Adjust. * coverage.c (read_counts_file): Adjust. * gcov-dump.c (print_prefix): Add position parameter. (flag_dump_positions): New flag. (options, main, print_usage): Add it. (dump_file, tag_blocks, tag_arcs, tag_lines, tag_counters, tag_summary): Adjust. * gcov.c (read_graph_file, read_count_file): Adjust. * libgcov.c (gcov_exit): Adjust. From-SVN: r66805
2003-05-10defaults.h (GCOV_TYPE_SIZE): Remove.Nathan Sidwell1-20/+17
* defaults.h (GCOV_TYPE_SIZE): Remove. * gcov-io.h (gcov_type): Set to specific mode int on target. (gcov_unsigned_t, gcov_position_t): New. (GCOV_TYPE_NODE): New. (GCOV_TAG_SUMMARY_LENGTH): Adjust. (GCOV_COUNTERS_SUMMABLE): New. (gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn, gcov_ctr_info, gcov_info): Adjust types. (gcov_var): Adjust types. (gcov_write_unsigned, gcov_write_tag, gcov_write_length, gcov_write_tag_length, gcov_write_summary, gcov_read_unsigned, gcov_read_summary): Adjust gcov types. (gcov_position, gcov_sync, gcov_seek): Adjust gcov types. * gcov-io.c (gcov_write_unsigned, gcov_write_tag, gcov_write_length, gcov_write_tag_length, gcov_write_summary, gcov_read_unsigned, gcov_read_summary): Adjust gcov types. * libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit, __gcov_init, __gcov_merge_add): Adjust gcov types. * coverage.c (ctr_merge_functions): Constify. (ctr_names): New. (read_counts_file): Adjust gcov types. Only summarize & merge summable counters. (coverage_counter_ref): Use GCOV_TYPE_NODE. (build_fn_info_type, build_fn_info_value, build_ctr_info_type, build_ctr_info_value, build_gcov_info): Adjust types. * profile.c (branch_prob): Adjust gcov types. * gcov_dump (dump_file): Adjust gcov types. From-SVN: r66668
2003-05-07gcov-io.h (GCOV_LOCKED): New #define.Nathan Sidwell1-60/+50
* gcov-io.h (GCOV_LOCKED): New #define. (GCOV_LINKAGE): Make sure it is #defined. (gcov_write_string, gcov_write_tag, gcov_write_length, gcov_read_string, gcov_time): Poison in libgcov. (gcov_seek_end): Remove. (gcov_write_tag_length, gcov_sync, gcov_rewrite): New. (GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH, GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH, GCOV_TAG_SUMMARY_LENGTH): New #defines. (gcov_write_tag, gcov_write_length): Not in libgcov. * gcov-io.c (gcov_open): Use GCOV_LOCKED. (gcov_write_tag, gcov_write_length): Not in libgcov. (gcov_write_tag_length): New. (gcov_write_summary): Use gcov_write_tag_length. * libgcov.c: Always #include gcov-io.h. (IN_LIBGCOV): -1 for inhibit_libc, +1 otherwise. (GCOV_LINKAGE): Define to nothing for L_gcov. (gcov_exit): Replace gcov_write_tag, gcov_write_length with gcov_write_tag_length. Use gcov_rewrite & gcov_seek. * gcov.c (read_graph_file): Replace gcov_seek by gcov_sync. (read_count_file): Likewise. * gcov-dump.c (dump_file): Likewise. * coverag.c (read_counts_file): Likewise. From-SVN: r66555
2003-05-05libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc is defined.Zdenek Dvorak1-2/+2
* libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc is defined. From-SVN: r66475
2003-05-04Makefile.in (LIBGCOV): Add _gcov_merge_add.Zdenek Dvorak1-6/+31
* Makefile.in (LIBGCOV): Add _gcov_merge_add. * gcov-io.h: Make GCOV_LINKAGE extern in libgcov and prevent resulting namespace clash. (GCOV_MERGE_FUNCTIONS): New. (gcov_merge_fn): Declare. (struct gcov_ctr_info): New field "merge". (__gcov_merge_add): Declare. * coverage.c (ctr_merge_functions): New. (build_ctr_info_type, build_ctr_info_value): Initialize merge field of gcov_ctr_info type. * libgcov.c (__gcov_merge_add): New. (gcov_exit): Call a hook to merge values of counters. From-SVN: r66457
2003-04-24New GCOV_TAG_FUNCTION layoutNathan Sidwell1-10/+8
New GCOV_TAG_FUNCTION layout * coverage.c (struct function_list): Replace name with ident. (struct counts_entry): Likewise. (fn_ident): New. (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del): Adjust. (reads_count_file, get_coverage_counts, coverage_begin_output, coverage_end_function): Adjust. (build_fn_info_type, build_fn_info_value): Likewise. * gcov-dump.c (tag_function): Adjust. * gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV. * gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV. * gcov.c (struct function_info): Add ident. (read_graph_file, read_count_file): Adjust. * libgcov.c (gcov_exit): Adjust. From-SVN: r66035
2003-04-23Makefile.in (LIBGCC_DEPS): Add gcov headers.Nathan Sidwell1-220/+200
* Makefile.in (LIBGCC_DEPS): Add gcov headers. (libgcov.a): Depends on LIBGCC_DEPS. * basic-block.h (profile_info): Moved here from coverage.h. Made a pointer. * coverage.c (struct function_list): Fixed array of counter types. (struct counts_entry): Keyed by counter type, contains summary. (profile_info): Moved to profile.c. (prg_ctr_mask, prg_n_ctrs, fn_ctr_mask, fn_n_ctrs): New global vars. (profiler_label): Remove. (ctr_labels): New. (set_purpose, label_for_tag, build_counter_section_fields, build_counter_section_value, build_counter_section_data_fields, build_counter_section_data_values, build_function_info_fields, build_function_info_value, gcov_info_fields, gcov_info_value): Remove. (build_fn_info_type, build_fn_info_value, build_ctr_info_type, build_ctr_info_value, build_gcov_info): New. (htab_counts_entry_hash, htab_counts_entry_eq): Adjust. (reads_counts_file): Adjust. (get_coverage_counts): Takes counter number. Add summary parameter. Adjust. (coverage_counter_ref): Tkaes counter number. Adjust. Lazily create counter array labels. (coverage_end_function): Adjust. (create_coverage): Adjust. (find_counters_section): Remove. * coverage.h (MAX_COUNTER_SECTIONS): Remove. (struct section_info, struct profile_info): Remove. (profile_info): Moved to basic-block.h. (coverage_counter_ref): Takes a counter number. (get_coverage_counts): Takes a counter number. Added summary parameter. (find_counters_section): Remove. * gcov-dump.c (tag_arc_counts): Rename to ... (tag_counters): ... here. Adjust. (tag_table): Move tag_counters to 3rd entry. Remove PROGRAM_PLACEHOLDER and PROGRAM_INCORRECT entries. (dump_file): Check for counter tag values here. (tag_summary): Adjust. * gcov-io.c (gcov_write_summary, gcov_read_summary): Adjust. * gcov-io.h (GCOV_LOCKED): New. (GCOV_TAG_ARC_COUNTS): Rename to ... (GCOV_TAG_COUNTS_BASE): ... here. (GCOV_TAG_PLACEHOLDER_SUMMARY, GCOV_TAG_INCORRECT_SUMMARY): Remove. (GCOV_COUNTER_ARCS, GCOV_COUNTERS, GCOV_NAMES): New. (GCOV_TAG_FOR_COUNTER, GCOV_COUNTER_FOR_TAG, GCOV_TAG_IS_COUNTER): New. (struct gcov_ctr_summary): New. (struct gcov_summary): Adjust. (struct gcov_counter_section): Remove. struct gcov_counter_section_data): Remove. (struct gcov_function_info): Rename to ... (struct gcov_fn_info): ... here. Adjust. (struct gcov_ctr_info): New. (struct gcov_info): Adjust. * gcov.c (read_count_file): Adjust. (output_lines): Adjust. * libgcov.c (gcov_exit): Adjust. (__gcov_flush): Adjust. * mklibgcc.in (libgcc2_c_dep): Add gcov headers. * predict.c (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p, compute_frequency_function): Adjust profile_info use. * profile.c (struct counts_entry): Remove. (profile_info): Define here. (get_exec_counts): Adjust get_coverage_counts call. (compute_branch_probablilities): Remove find_counters_section call. (gen_edge_profiler): Adjust coverage_counter_ref call. * tracer.c (tail_duplicate): Adjust profile_info use. From-SVN: r65990
2003-04-21Break out coverage routines to new file.Nathan Sidwell1-1/+2
* Makefile.in (COVERAGE_H): New variable (C_OBJS): Add coverage.o (coverage.o): New target. (profile.o, loop-init.o, sched-ebb.o, predict.o, tracer.o): Adjust dependencies. (GTFILES): Adjust. (gt-coverage.h): New target. (gt-profile.h): Remove. * profile.h: Remove. Move to ... * coverage.h: ... here. New. #include gcov-io.h. * gcov-io.h: Move function definitions to ... * gcov-io.c: ... here. New. * profile.c: Move coverage routines to coverage.c. (instrument_edges, get_exec_counts, branch_prob, init_branch_prob, end_branch_prob): Adjust. * coverage.c: New. Coverage routines from profile.c (coverage_counter_ref, coverage_init, coverage_finish, coverage_end_function, coverage_begin_output, coverage_counter_ref, get_coverage_counts): Define. * gcov-dump.c, gcov.c: #include gcov-io.c. * libgcov.c: Likewise. Adjust. * loop-init.c: Don't #include profile.h * tracer.c, predict.c, sched-ebb.c: Adjust #includes. * rtl.h: Add coverage prototypes. * toplev.c (compile_file): Init coverage, not branch_prob. Always call coverage_finish. (rest_of_compilation): Call coverage_end_function. From-SVN: r65897
2003-04-17gcov-dump.c (tag_summary): Remove max_sumJan Hubicka1-66/+71
* gcov-dump.c (tag_summary): Remove max_sum * gcov-io.h (gcov_summary, gcov_write_summary, gcov_read_summary): Kill max_sum. * libgcov.c (gcov_exit): Do one pass over the data. Make error message more verbose. From-SVN: r65758
2003-04-11Makefile.in (loop-init.o): Do not depend on gcov-io.h, gcov-iov.h.Nathan Sidwell1-86/+55
* Makefile.in (loop-init.o): Do not depend on gcov-io.h, gcov-iov.h. Simplify interface to gcov reading and writing. * gcov-io.h (gcov_file, gcov_position, gcov_length, gcov_buffer, gcov_alloc, gcov_modified, gcov_errored): Move into ... (struct gcov_var gcov_var): ... this static structure. (gcov_write_unsigned, gcov_write_counter, gcov_write_string): Return void. (gcov_read_unsigned, gcov_read_couter, gcov_read_string): Return read object. (gcov_read_bytes, gcov_write_bytes): Set error flag on error. (gcov_reserve_length): Remove. (gcov_write_tag): New. (gcov_write_length): Adjust. (gcov_read_summary, gcov_write_summary): Adjust. (gcov_eof, gcov_ok): Rename to ... (gcov_is_eof, gcov_is_error): ... here. Return error code. (gcov_save_position, gcov_resync): Rename to ... (gcov_position, gcov_seek): ... here. (gcov_skip, gcov_skip_string): Remove. (gcov_error): Remove. (gcov_open, gcov_close): Adjust. * gcov.c (find_source): Take const char *, copy it on allocation. (read_graph_file): Adjust. (read_count_file): Adjust. * libgcov.c (gcov_exit): Adjust. * gcov-dump.c (tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts, tag_summary): Return void. Adjust. (struct tag_format): Adjust proc member. (dump_file): Adjust gcov calls. From-SVN: r65464
2003-04-07Change gcov file interface to single file at a time.Nathan Sidwell1-73/+51
* gcov-io.h: Replace IN_LIBGCC1 with IN_LIBGCOV. Use IN_GCOV. Convert to C89 prototypes. (gcov_file, gcov_length, gcov_position, gcov_buffer, gcov_alloc, gcov_error, gcov_modified): New static variables. (gcov_open, gcov_close, gcov_read_bytes, gcov_write_bytes): New functions. (gcov_write_unsigned, gcov_write_counter, gcov_write_string, gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust. (gcov_read_summary, gcov_write_summary): Adjust. (gcov_save_position, gcov_reserve_length, gcov_write_length): Adjust. (gcov_resync, gcov_skip, gcov_skip_string): Adjust. (da_file_open, da_file_close, da_file_eof, da_file_error): Remove. (da_file_position, da_file_seek, da_file_write, da_file_read): Remove. (gcov_error, gcov_eof, gcov_ok, gcov_time): New functions. * gcov.c (gcov_type): Don't typedef here. (IN_GCOV): #define (read_graph_file, read_count_file): Adjust. * gcov-dump.c (gcov_type): Don't typedef here. (IN_GCOV): #define. (tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts): Remove FILE parameter, adjust. (struct tag_format): Adjust proc member. (dump_file): Adjust. * libgcov.c (IN_LIBGCOV): #define. (gcov_exit): Adjust. * loop-init.c: Don't #include gcov-io.h * profile.c (struct counts_entry): New structure to hold counter values. (struct section_reference, struct da_index_entry): Remove. (bbg_file, da_file): Remove. (htab_counts_index_hash, htab_counts_index_eq, htab_counts_index_del): Replace with ... (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del): ... these. (cleanup_counts_index, index_counts_file): Remove. (read_counts_file): New function. (get_exec_counts): Adjust. (compute_branch_probabilities): Don't free the exec counts here. (branch_prob): Adjust. (init_branch_prob): Adjust. (end_branch_prob): Adjust. From-SVN: r65338
2003-03-27libgcov.c: Provide only dummy functions if libc is not available.Janis Johnson1-0/+13
2003-03-27 Janis Johnson <janis187@us.ibm.com> * libgcov.c: Provide only dummy functions if libc is not available. From-SVN: r64936
2003-03-04gcov-io.h (gcov_save_position, [...]): Modified to enable reading/ writing ↵Zdenek Dvorak1-66/+56
of whole .da file just once. * gcov-io.h (gcov_save_position, gcov_reserve_length, gcov_resync, gcov_skip, gcov_skip_string, gcov_write_unsigned, gcov_write_counter, gcov_write_string, gcov_read_unsigned, gcov_read_counter, gcov_read_string, gcov_write_length): Modified to enable reading/ writing of whole .da file just once. (da_file_open, da_file_close, da_file_eof, da_file_error, da_file_position, da_file_seek, da_file_write, da_file_read): New functions. (actual_da_file, actual_da_file_position, actual_da_file_length, actual_da_file_buffer, actual_da_file_buffer_size): New static functions. * libgcov.c (gcov_exit): Modified to read/write the whole .da file at just once. From-SVN: r63800
2003-02-26gcov-dump.c (print_prefix): Fix signedness warning.Zdenek Dvorak1-48/+94
* gcov-dump.c (print_prefix): Fix signedness warning. * gcov-io.h (struct counter_section, struct counter_section_data): New. (struct function_info): n_arc_counts field removed, n_counter_sections, counter_sections fields added. (struct gcov_info): arc_counts, n_arc_counts fields removed, n_counter_sections, counter_sections fields added. * libgcov.c (gcov_exit, __gcov_flush): Add support for multiple profile sections. * profile.h (MAX_COUNTER_SECTIONS): New. (struct section_info): New. (struct profile_info): count_instrumented_edges, count_edges_instrumented_now fields removed, n_sections, section_info fields added. (find_counters_section): Declare. * profile.c (struct function_list): count_edges field removed, n_counter_sections, counter_sections fields added. (set_purpose, label_for_tag, build_counter_section_fields, build_counter_section_value, build_counter_section_data_fields, build_counter_section_data_value, build_function_info_fields, build_function_info_value, build_gcov_info_fields, build_gcov_info_value): New static functions. (find_counters_section): New function. (instrument_edges, get_exec_counts, compute_branch_probabilities, branch_prob, create_profiler): Modified to support multiple profile sections. From-SVN: r63474
2003-01-27Makefile.in (LIB2FUNCS_ST): Remove _gcov.Nathan Sidwell1-0/+473
* Makefile.in (LIB2FUNCS_ST): Remove _gcov. (LIBGCOV): New variable. (libgcc.mk): Add LIBGCOV. (LIBGCC_DEPS): Add libgcov.c. (libgcov.a): New target. (clean): Remove libgcov.a. (install-libgcc): Do libgcov too. (stage1-start, stage2-start, stage3-start, stage4-start): Deal with libgcov.a. * libgcc2.c (L_gcov): Move into ... * libgcov.c: ... here. New file. * mklibgcc.in: Add libgcov rules. * gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling. * doc/invoke.texi (profile-arcs, test-coverage): Update and clarify. * profile.c (index_counts_file): Remove duplicate check for open file. From-SVN: r61905