gcc/gcc/tree-mudflap.c

1347 lines
44 KiB
C
Raw Normal View History

/* Mudflap: narrow-pointer bounds-checking by tree rewriting.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Frank Ch. Eigler <fche@redhat.com>
and Graydon Hoare <graydon@redhat.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
2005-06-25 04:02:01 +02:00
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
#include "hard-reg-set.h"
#include "rtl.h"
#include "tree.h"
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
#include "tm_p.h"
#include "basic-block.h"
#include "flags.h"
#include "function.h"
#include "tree-inline.h"
#include "tree-gimple.h"
#include "tree-flow.h"
#include "tree-mudflap.h"
#include "tree-dump.h"
#include "tree-pass.h"
#include "hashtab.h"
#include "diagnostic.h"
#include <demangle.h>
#include "langhooks.h"
#include "ggc.h"
#include "cgraph.h"
#include "toplev.h"
/* Internal function decls */
/* Options. */
#define flag_mudflap_threads (flag_mudflap == 2)
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Helpers. */
static tree mf_build_string (const char *string);
static tree mf_varname_tree (tree);
static tree mf_file_function_line_tree (location_t);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Indirection-related instrumentation. */
static void mf_decl_cache_locals (void);
static void mf_decl_clear_locals (void);
static void mf_xform_derefs (void);
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
static unsigned int execute_mudflap_function_ops (void);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Addressable variables instrumentation. */
static void mf_xform_decls (tree, tree);
static tree mx_xfn_xform_decls (tree *, int *, void *);
static void mx_register_decls (tree, tree *);
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
static unsigned int execute_mudflap_function_decls (void);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* ------------------------------------------------------------------------ */
/* Some generally helpful functions for mudflap instrumentation. */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Build a reference to a literal string. */
static tree
mf_build_string (const char *string)
{
size_t len = strlen (string);
tree result = mf_mark (build_string (len + 1, string));
tree.h (build_int_cst): New. .: * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. From-SVN: r86022
2004-08-15 17:45:33 +02:00
TREE_TYPE (result) = build_array_type
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
(char_type_node, build_index_type (build_int_cst (NULL_TREE, len)));
TREE_CONSTANT (result) = 1;
TREE_INVARIANT (result) = 1;
TREE_READONLY (result) = 1;
TREE_STATIC (result) = 1;
result = build1 (ADDR_EXPR, build_pointer_type (char_type_node), result);
return mf_mark (result);
}
/* Create a properly typed STRING_CST node that describes the given
declaration. It will be used as an argument for __mf_register().
Try to construct a helpful string, including file/function/variable
name. */
static tree
mf_varname_tree (tree decl)
{
static pretty_printer buf_rec;
static int initialized = 0;
pretty_printer *buf = & buf_rec;
const char *buf_contents;
tree result;
targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort. * targhooks.c (default_unwind_emit, default_scalar_mode_supported_p): Use gcc_assert, gcc_unreachable & internal_error instead of abort. * timevar.c (timevar_push, timevar_pop, timevar_start, timevar_stop): Likewise. * toplev.c (default_pch_valid_p): Likewise. * tracer.c (tail_duplicate): Likewise. * tree-alias-common.c (get_alias_var_decl, get_values_from_constructor, create_alias_var, delete_alias_vars, empty_points_to_set, same_points_to_set, ptr_may_alias_var): Likewise. * tree.c (tree_size, make_node_stat, copy_node_stat, build_int_cst_wide, integer_all_onesp, list_length, chainon, tree_node_structure, type_contains_placeholder_p, substitute_in_expr, substitute_placeholder_in_expr, tabilize_reference_1, build0_stat, build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p, lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr, build_method_type_directly, decl_type_context, get_callee_fndecl, get_set_constructor_bits, build_vector_type_for_mode, int_cst_value, tree_fold_gcd): Likewise. * tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges, make_cond_expr_edges, group_case_labels, tree_merge_blocks, cleanup_control_expr_graph, find_taken_edge, find_taken_edge_switch_expr, phi_alternatives_equal, is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt, stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate, tree_split_edge, tree_verify_flow_info, thread_jumps, tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise. * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly): Likewise. * tree-complex.c (extract_component, expand_complex_division, expand_complex_comparison, expand_complex_operations_1, build_replicated_const, expand_vector_operations_1): Likewise. * tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector, build_classic_dir_vector): Likewise. * tree-dfa.c (compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann, create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region, record_in_finally_tree, replace_goto_queue_1, maybe_record_in_goto_queue, verify_norecord_switch_expr, do_return_redirection): Likewise. * tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr, add_to_dst_predicate_list, find_phi_replacement_condition, replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order): Likewise. * tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r, initialize_inlined_parameters, declare_return_variable, estimate_num_insns_1, expand_call_inline, expand_calls_inline, optimize_inline_calls, copy_tree_r): Likewise. * tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt, ssa_rewrite_stmt, rewrite_into_ssa): Likewise. * tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after, tsi_split_statement_list_after, tsi_split_statement_list_before): Likewise. * tree-mudflap.c (mf_varname_tree): Likewise. * tree-nested.c (create_tmp_var_for, lookup_field_for_decl, lookup_tramp_for_decl, convert_all_function_calls): Likewise. * tree-optimize.c (tree_rest_of_compilation): Likewise. * tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi, coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis, free_temp_expr_table, add_dependance, finish_expr, rewrite_trees): Likewise. * tree-phinodes.c (resize_phi_node, add_phi_arg, remove_all_phi_nodes_for): Likewise. * tree-pretty-print.c (op_prio, print_call_name): Likewise. * tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise. * tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree, sra_elt_eq, sra_walk_expr, instantiate_missing_elements, generate_one_element_ref, generate_element_copy, generate_element_zero, scalarize_copy, scalarize_init, scalarize_ldst): Likewise. * tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p, add_may_alias, add_pointed_to_expr, add_pointed_to_var, collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise. * tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise. * tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value, set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment, widen_bitfield, ccp_fold_builtin): Likewise. * tree-ssa-copy.c (may_propagate_copy, merge_alias_info, replace_exp_1, propagate_tree_value): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-dce.c (set_control_dependence_map_bit, find_control_dependence, find_pdom, mark_operand_necessary, mark_stmt_if_obviously_necessary, mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise. * tree-ssa-dom.c (dom_opt_initialize_block_local_data, simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis, eliminate_redundant_computations, avail_expr_eq): Likewise. * tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p, duplicate_blocks): Likewise. * tree-ssa-loop-im.c (for_each_index, set_level, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos, stmt_after_increment, set_iv, contains_abnormal_ssa_name_p, find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates, peel_address, ptr_difference_cost, may_replace_final_value, determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer, rewrite_use, rewrite_uses): Likewise. * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa, check_loop_closed_ssa_use): Likewise. * tree-ssanames.c (make_ssa_name): Likewise. * tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses, finalize_ssa_v_must_defs, finalize_ssa_stmt_operands, get_stmt_operands, get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands, add_stmt_operand): Likewise. * tree-ssa-pre.c (value_exists_in_set_bitmap, value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set, phi_translate, valid_in_set, compute_antic, find_or_generate_expression, create_expression_by_pieces, insert_aux, create_value_expr_from, eliminate): Likewise. * tree-ssa-propagate.c (cfg_blocks_get): Likewise. * tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges): Likewise. * tree-tailcall.c (independent_of_stmt_p, adjust_return_value, eliminate_tail_call): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_align_data_ref, vect_create_data_ref, vect_create_destination_var, vect_get_vec_def_for_operand, vect_finish_stmt_generation, vect_transform_stmt, vect_transform_loop_bound, vect_transform_loop, vect_analyze_operations): Likewise. * tree-vn.c (vn_compute, set_value_handle, get_value_handle): Likewise. * tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr, get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start, bsi_after_labels, bsi_last): Likewise. * tree-ssa-live.c (var_union, change_partition_var, create_ssa_var_map, calculate_live_on_entry, root_var_init, type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce): Likewise. * tree-ssa-live.h (partition_is_global, live_entry_blocks, tpa_find_tree): Likewise. (register_ssa_partition_check): Declare. (register_ssa_partition): use it. * tree-ssa-live.c: Include errors.h. (register_ssa_partition_check): New. * tree-ssa-operands.c: Include errors.h. * Makefile.in (tree-ssa-operands.o): Depend on errors.h. Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> From-SVN: r87223
2004-09-09 09:54:12 +02:00
gcc_assert (decl);
if (!initialized)
{
pp_construct (buf, /* prefix */ NULL, /* line-width */ 0);
initialized = 1;
}
pp_clear_output_area (buf);
/* Add FILENAME[:LINENUMBER[:COLUMNNUMBER]]. */
{
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (decl));
const char *sourcefile;
unsigned sourceline = xloc.line;
unsigned sourcecolumn = 0;
#ifdef USE_MAPPED_LOCATION
sourcecolumn = xloc.column;
#endif
sourcefile = xloc.file;
if (sourcefile == NULL && current_function_decl != NULL_TREE)
sourcefile = DECL_SOURCE_FILE (current_function_decl);
if (sourcefile == NULL)
sourcefile = "<unknown file>";
pp_string (buf, sourcefile);
if (sourceline != 0)
{
pp_string (buf, ":");
pp_decimal_int (buf, sourceline);
if (sourcecolumn != 0)
{
pp_string (buf, ":");
pp_decimal_int (buf, sourcecolumn);
}
}
}
if (current_function_decl != NULL_TREE)
{
/* Add (FUNCTION) */
pp_string (buf, " (");
{
const char *funcname = NULL;
if (DECL_NAME (current_function_decl))
funcname = lang_hooks.decl_printable_name (current_function_decl, 1);
if (funcname == NULL)
funcname = "anonymous fn";
pp_string (buf, funcname);
}
pp_string (buf, ") ");
}
else
pp_string (buf, " ");
/* Add <variable-declaration>, possibly demangled. */
{
const char *declname = NULL;
if (DECL_NAME (decl) != NULL)
{
if (strcmp ("GNU C++", lang_hooks.name) == 0)
{
/* The gcc/cp decl_printable_name hook doesn't do as good a job as
the libiberty demangler. */
declname = cplus_demangle (IDENTIFIER_POINTER (DECL_NAME (decl)),
DMGL_AUTO | DMGL_VERBOSE);
}
if (declname == NULL)
declname = lang_hooks.decl_printable_name (decl, 3);
}
if (declname == NULL)
declname = "<unnamed variable>";
pp_string (buf, declname);
}
/* Return the lot as a new STRING_CST. */
buf_contents = pp_base_formatted_text (buf);
result = mf_build_string (buf_contents);
pp_clear_output_area (buf);
return result;
}
/* And another friend, for producing a simpler message. */
static tree
mf_file_function_line_tree (location_t location)
{
expanded_location xloc = expand_location (location);
const char *file = NULL, *colon, *line, *op, *name, *cp;
char linecolbuf[30]; /* Enough for two decimal numbers plus a colon. */
char *string;
tree result;
/* Add FILENAME[:LINENUMBER[:COLUMNNUMBER]]. */
file = xloc.file;
if (file == NULL && current_function_decl != NULL_TREE)
file = DECL_SOURCE_FILE (current_function_decl);
if (file == NULL)
file = "<unknown file>";
if (xloc.line > 0)
{
#ifdef USE_MAPPED_LOCATION
if (xloc.column > 0)
sprintf (linecolbuf, "%d:%d", xloc.line, xloc.column);
else
#endif
sprintf (linecolbuf, "%d", xloc.line);
colon = ":";
line = linecolbuf;
}
else
colon = line = "";
/* Add (FUNCTION). */
name = lang_hooks.decl_printable_name (current_function_decl, 1);
if (name)
{
op = " (";
cp = ")";
}
else
op = name = cp = "";
string = concat (file, colon, line, op, name, cp, NULL);
result = mf_build_string (string);
free (string);
return result;
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* global tree nodes */
/* Global tree objects for global variables and functions exported by
mudflap runtime library. mf_init_extern_trees must be called
before using these. */
/* uintptr_t (usually "unsigned long") */
static GTY (()) tree mf_uintptr_type;
/* struct __mf_cache { uintptr_t low; uintptr_t high; }; */
static GTY (()) tree mf_cache_struct_type;
/* struct __mf_cache * const */
static GTY (()) tree mf_cache_structptr_type;
/* extern struct __mf_cache __mf_lookup_cache []; */
static GTY (()) tree mf_cache_array_decl;
/* extern unsigned char __mf_lc_shift; */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
static GTY (()) tree mf_cache_shift_decl;
/* extern uintptr_t __mf_lc_mask; */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
static GTY (()) tree mf_cache_mask_decl;
/* Their function-scope local shadows, used in single-threaded mode only. */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* auto const unsigned char __mf_lc_shift_l; */
static GTY (()) tree mf_cache_shift_decl_l;
/* auto const uintptr_t __mf_lc_mask_l; */
static GTY (()) tree mf_cache_mask_decl_l;
/* extern void __mf_check (void *ptr, size_t sz, int type, const char *); */
static GTY (()) tree mf_check_fndecl;
/* extern void __mf_register (void *ptr, size_t sz, int type, const char *); */
static GTY (()) tree mf_register_fndecl;
/* extern void __mf_unregister (void *ptr, size_t sz, int type); */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
static GTY (()) tree mf_unregister_fndecl;
/* extern void __mf_init (); */
static GTY (()) tree mf_init_fndecl;
/* extern int __mf_set_options (const char*); */
static GTY (()) tree mf_set_options_fndecl;
/* Helper for mudflap_init: construct a decl with the given category,
name, and type, mark it an external reference, and pushdecl it. */
static inline tree
mf_make_builtin (enum tree_code category, const char *name, tree type)
{
tree decl = mf_mark (build_decl (category, get_identifier (name), type));
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1;
lang_hooks.decls.pushdecl (decl);
return decl;
}
/* Helper for mudflap_init: construct a tree corresponding to the type
struct __mf_cache { uintptr_t low; uintptr_t high; };
where uintptr_t is the FIELD_TYPE argument. */
static inline tree
mf_make_mf_cache_struct_type (tree field_type)
{
/* There is, abominably, no language-independent way to construct a
RECORD_TYPE. So we have to call the basic type construction
primitives by hand. */
tree fieldlo = build_decl (FIELD_DECL, get_identifier ("low"), field_type);
tree fieldhi = build_decl (FIELD_DECL, get_identifier ("high"), field_type);
tree struct_type = make_node (RECORD_TYPE);
DECL_CONTEXT (fieldlo) = struct_type;
DECL_CONTEXT (fieldhi) = struct_type;
TREE_CHAIN (fieldlo) = fieldhi;
TYPE_FIELDS (struct_type) = fieldlo;
TYPE_NAME (struct_type) = get_identifier ("__mf_cache");
layout_type (struct_type);
return struct_type;
}
#define build_function_type_0(rtype) \
build_function_type (rtype, void_list_node)
#define build_function_type_1(rtype, arg1) \
build_function_type (rtype, tree_cons (0, arg1, void_list_node))
#define build_function_type_3(rtype, arg1, arg2, arg3) \
build_function_type (rtype, tree_cons (0, arg1, tree_cons (0, arg2, \
tree_cons (0, arg3, void_list_node))))
#define build_function_type_4(rtype, arg1, arg2, arg3, arg4) \
build_function_type (rtype, tree_cons (0, arg1, tree_cons (0, arg2, \
tree_cons (0, arg3, tree_cons (0, arg4, \
void_list_node)))))
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Initialize the global tree nodes that correspond to mf-runtime.h
declarations. */
void
mudflap_init (void)
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
{
static bool done = false;
tree mf_const_string_type;
tree mf_cache_array_type;
tree mf_check_register_fntype;
tree mf_unregister_fntype;
tree mf_init_fntype;
tree mf_set_options_fntype;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
if (done)
return;
done = true;
mf_uintptr_type = lang_hooks.types.type_for_mode (ptr_mode,
/*unsignedp=*/true);
mf_const_string_type
= build_pointer_type (build_qualified_type
(char_type_node, TYPE_QUAL_CONST));
mf_cache_struct_type = mf_make_mf_cache_struct_type (mf_uintptr_type);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
mf_cache_structptr_type = build_pointer_type (mf_cache_struct_type);
mf_cache_array_type = build_array_type (mf_cache_struct_type, 0);
mf_check_register_fntype =
build_function_type_4 (void_type_node, ptr_type_node, size_type_node,
integer_type_node, mf_const_string_type);
mf_unregister_fntype =
build_function_type_3 (void_type_node, ptr_type_node, size_type_node,
integer_type_node);
mf_init_fntype =
build_function_type_0 (void_type_node);
mf_set_options_fntype =
build_function_type_1 (integer_type_node, mf_const_string_type);
mf_cache_array_decl = mf_make_builtin (VAR_DECL, "__mf_lookup_cache",
mf_cache_array_type);
mf_cache_shift_decl = mf_make_builtin (VAR_DECL, "__mf_lc_shift",
unsigned_char_type_node);
mf_cache_mask_decl = mf_make_builtin (VAR_DECL, "__mf_lc_mask",
mf_uintptr_type);
/* Don't process these in mudflap_enqueue_decl, should they come by
there for some reason. */
mf_mark (mf_cache_array_decl);
mf_mark (mf_cache_shift_decl);
mf_mark (mf_cache_mask_decl);
mf_check_fndecl = mf_make_builtin (FUNCTION_DECL, "__mf_check",
mf_check_register_fntype);
mf_register_fndecl = mf_make_builtin (FUNCTION_DECL, "__mf_register",
mf_check_register_fntype);
mf_unregister_fndecl = mf_make_builtin (FUNCTION_DECL, "__mf_unregister",
mf_unregister_fntype);
mf_init_fndecl = mf_make_builtin (FUNCTION_DECL, "__mf_init",
mf_init_fntype);
mf_set_options_fndecl = mf_make_builtin (FUNCTION_DECL, "__mf_set_options",
mf_set_options_fntype);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
}
#undef build_function_type_4
#undef build_function_type_3
#undef build_function_type_1
#undef build_function_type_0
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* ------------------------------------------------------------------------ */
/* Memory reference transforms. Perform the mudflap indirection-related
tree transforms on the current function.
This is the second part of the mudflap instrumentation. It works on
low-level GIMPLE using the CFG, because we want to run this pass after
tree optimizations have been performed, but we have to preserve the CFG
for expansion from trees to RTL. */
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
static unsigned int
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
execute_mudflap_function_ops (void)
{
/* Don't instrument functions such as the synthetic constructor
built during mudflap_finish_file. */
if (mf_marked_p (current_function_decl) ||
DECL_ARTIFICIAL (current_function_decl))
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
return 0;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
push_gimplify_context ();
/* In multithreaded mode, don't cache the lookup cache parameters. */
if (! flag_mudflap_threads)
mf_decl_cache_locals ();
mf_xform_derefs ();
if (! flag_mudflap_threads)
mf_decl_clear_locals ();
pop_gimplify_context (NULL);
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
return 0;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
}
/* Create and initialize local shadow variables for the lookup cache
globals. Put their decls in the *_l globals for use by
mf_build_check_statement_for. */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
static void
mf_decl_cache_locals (void)
{
tree t, shift_init_stmts, mask_init_stmts;
tree_stmt_iterator tsi;
/* Build the cache vars. */
mf_cache_shift_decl_l
= mf_mark (create_tmp_var (TREE_TYPE (mf_cache_shift_decl),
"__mf_lookup_shift_l"));
mf_cache_mask_decl_l
= mf_mark (create_tmp_var (TREE_TYPE (mf_cache_mask_decl),
"__mf_lookup_mask_l"));
/* Build initialization nodes for the cache vars. We just load the
globals into the cache variables. */
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_shift_decl_l),
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
mf_cache_shift_decl_l, mf_cache_shift_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
gimplify_to_stmt_list (&t);
shift_init_stmts = t;
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_mask_decl_l),
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
mf_cache_mask_decl_l, mf_cache_mask_decl);
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
gimplify_to_stmt_list (&t);
mask_init_stmts = t;
/* Anticipating multiple entry points, we insert the cache vars
initializers in each successor of the ENTRY_BLOCK_PTR. */
for (tsi = tsi_start (shift_init_stmts);
! tsi_end_p (tsi);
tsi_next (&tsi))
insert_edge_copies (tsi_stmt (tsi), ENTRY_BLOCK_PTR);
for (tsi = tsi_start (mask_init_stmts);
! tsi_end_p (tsi);
tsi_next (&tsi))
insert_edge_copies (tsi_stmt (tsi), ENTRY_BLOCK_PTR);
bsi_commit_edge_inserts ();
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
}
static void
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
mf_decl_clear_locals (void)
{
/* Unset local shadows. */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
mf_cache_shift_decl_l = NULL_TREE;
mf_cache_mask_decl_l = NULL_TREE;
}
static void
mf_build_check_statement_for (tree base, tree limit,
block_stmt_iterator *instr_bsi,
location_t *locus, tree dirflag)
{
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
tree_stmt_iterator head, tsi;
block_stmt_iterator bsi;
basic_block cond_bb, then_bb, join_bb;
edge e;
tree cond, t, u, v;
tree mf_base;
tree mf_elem;
tree mf_limit;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* We first need to split the current basic block, and start altering
the CFG. This allows us to insert the statements we're about to
construct into the right basic blocks. */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
cond_bb = bb_for_stmt (bsi_stmt (*instr_bsi));
bsi = *instr_bsi;
bsi_prev (&bsi);
if (! bsi_end_p (bsi))
e = split_block (cond_bb, bsi_stmt (bsi));
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
else
e = split_block_after_labels (cond_bb);
cond_bb = e->src;
join_bb = e->dest;
/* A recap at this point: join_bb is the basic block at whose head
is the gimple statement for which this check expression is being
2004-09-23 17:55:18 +02:00
built. cond_bb is the (possibly new, synthetic) basic block the
end of which will contain the cache-lookup code, and a
conditional that jumps to the cache-miss code or, much more
likely, over to join_bb. */
/* Create the bb that contains the cache-miss fallback block (mf_check). */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
then_bb = create_empty_bb (cond_bb);
make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
make_single_succ_edge (then_bb, join_bb, EDGE_FALLTHRU);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Mark the pseudo-fallthrough edge from cond_bb to join_bb. */
e = find_edge (cond_bb, join_bb);
e->flags = EDGE_FALSE_VALUE;
e->count = cond_bb->count;
e->probability = REG_BR_PROB_BASE;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Update dominance info. Note that bb_join's data was
updated by split_block. */
if (dom_info_available_p (CDI_DOMINATORS))
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
{
set_immediate_dominator (CDI_DOMINATORS, then_bb, cond_bb);
set_immediate_dominator (CDI_DOMINATORS, join_bb, cond_bb);
}
/* Build our local variables. */
mf_elem = create_tmp_var (mf_cache_structptr_type, "__mf_elem");
mf_base = create_tmp_var (mf_uintptr_type, "__mf_base");
mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit");
/* Build: __mf_base = (uintptr_t) <base address expression>. */
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_base,
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
convert (mf_uintptr_type, unshare_expr (base)));
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
head = tsi_start (t);
tsi = tsi_last (t);
/* Build: __mf_limit = (uintptr_t) <limit address expression>. */
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_limit,
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
convert (mf_uintptr_type, unshare_expr (limit)));
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
/* Build: __mf_elem = &__mf_lookup_cache [(__mf_base >> __mf_shift)
& __mf_mask]. */
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
t = build2 (RSHIFT_EXPR, mf_uintptr_type, mf_base,
(flag_mudflap_threads ? mf_cache_shift_decl : mf_cache_shift_decl_l));
t = build2 (BIT_AND_EXPR, mf_uintptr_type, t,
(flag_mudflap_threads ? mf_cache_mask_decl : mf_cache_mask_decl_l));
t = build4 (ARRAY_REF,
TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_elem, t);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
SET_EXPR_LOCUS (t, locus);
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
/* Quick validity check.
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
if (__mf_elem->low > __mf_base
|| (__mf_elem_high < __mf_limit))
{
__mf_check ();
... and only if single-threaded:
__mf_lookup_shift_1 = f...;
__mf_lookup_mask_l = ...;
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
It is expected that this body of code is rarely executed so we mark
the edge to the THEN clause of the conditional jump as unlikely. */
/* Construct t <-- '__mf_elem->low > __mf_base'. */
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
t = build3 (COMPONENT_REF, mf_uintptr_type,
build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
TYPE_FIELDS (mf_cache_struct_type), NULL_TREE);
t = build2 (GT_EXPR, boolean_type_node, t, mf_base);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Construct '__mf_elem->high < __mf_limit'.
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
First build:
1) u <-- '__mf_elem->high'
2) v <-- '__mf_limit'.
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
Then build 'u <-- (u < v). */
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
u = build3 (COMPONENT_REF, mf_uintptr_type,
build1 (INDIRECT_REF, mf_cache_struct_type, mf_elem),
TREE_CHAIN (TYPE_FIELDS (mf_cache_struct_type)), NULL_TREE);
v = mf_limit;
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
u = build2 (LT_EXPR, boolean_type_node, u, v);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Build the composed conditional: t <-- 't || u'. Then store the
result of the evaluation of 't' in a temporary variable which we
can use as the condition for the conditional jump. */
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
t = build2 (TRUTH_OR_EXPR, boolean_type_node, t, u);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
t = build2 (GIMPLE_MODIFY_STMT, boolean_type_node, cond, t);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
gimplify_to_stmt_list (&t);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
/* Build the conditional jump. 'cond' is just a temporary so we can
simply build a void COND_EXPR. We do need labels in both arms though. */
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
t = build3 (COND_EXPR, void_type_node, cond,
build1 (GOTO_EXPR, void_type_node, tree_block_label (then_bb)),
build1 (GOTO_EXPR, void_type_node, tree_block_label (join_bb)));
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
SET_EXPR_LOCUS (t, locus);
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* At this point, after so much hard work, we have only constructed
the conditional jump,
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
if (__mf_elem->low > __mf_base
|| (__mf_elem_high < __mf_limit))
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
The lowered GIMPLE tree representing this code is in the statement
list starting at 'head'.
We can insert this now in the current basic block, i.e. the one that
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
the statement we're instrumenting was originally in. */
bsi = bsi_last (cond_bb);
for (tsi = head; ! tsi_end_p (tsi); tsi_next (&tsi))
bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_CONTINUE_LINKING);
/* Now build up the body of the cache-miss handling:
__mf_check();
refresh *_l vars.
This is the body of the conditional. */
u = tree_cons (NULL_TREE,
mf_file_function_line_tree (locus == NULL ? UNKNOWN_LOCATION
: *locus),
NULL_TREE);
u = tree_cons (NULL_TREE, dirflag, u);
/* NB: we pass the overall [base..limit] range to mf_check. */
u = tree_cons (NULL_TREE,
fold_build2 (PLUS_EXPR, integer_type_node,
fold_build2 (MINUS_EXPR, mf_uintptr_type, mf_limit, mf_base),
integer_one_node),
u);
u = tree_cons (NULL_TREE, mf_base, u);
t = build_function_call_expr (mf_check_fndecl, u);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
gimplify_to_stmt_list (&t);
head = tsi_start (t);
tsi = tsi_last (t);
if (! flag_mudflap_threads)
{
t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
mf_cache_shift_decl_l, mf_cache_shift_decl);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
mf_cache_mask_decl_l, mf_cache_mask_decl);
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Insert the check code in the THEN block. */
bsi = bsi_start (then_bb);
for (tsi = head; ! tsi_end_p (tsi); tsi_next (&tsi))
bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_CONTINUE_LINKING);
*instr_bsi = bsi_start (join_bb);
bsi_next (instr_bsi);
}
/* Check whether the given decl, generally a VAR_DECL or PARM_DECL, is
eligible for instrumentation. For the mudflap1 pass, this implies
that it should be registered with the libmudflap runtime. For the
mudflap2 pass this means instrumenting an indirection operation with
respect to the object.
*/
static int
mf_decl_eligible_p (tree decl)
{
return ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
/* The decl must have its address taken. In the case of
arrays, this flag is also set if the indexes are not
compile-time known valid constants. */
&& TREE_ADDRESSABLE (decl) /* XXX: not sufficient: return-by-value structs! */
/* The type of the variable must be complete. */
&& COMPLETE_OR_VOID_TYPE_P (TREE_TYPE (decl))
/* The decl hasn't been decomposed somehow. */
&& !DECL_HAS_VALUE_EXPR_P (decl));
}
static void
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp,
location_t *locus, tree dirflag)
{
tree type, base, limit, addr, size, t;
/* Don't instrument read operations. */
if (dirflag == integer_zero_node && flag_mudflap_ignore_reads)
return;
/* Don't instrument marked nodes. */
if (mf_marked_p (*tp))
return;
t = *tp;
type = TREE_TYPE (t);
if (type == error_mark_node)
return;
size = TYPE_SIZE_UNIT (type);
switch (TREE_CODE (t))
{
case ARRAY_REF:
case COMPONENT_REF:
{
/* This is trickier than it may first appear. The reason is
that we are looking at expressions from the "inside out" at
this point. We may have a complex nested aggregate/array
expression (e.g. "a.b[i].c"), maybe with an indirection as
the leftmost operator ("p->a.b.d"), where instrumentation
is necessary. Or we may have an innocent "a.b.c"
expression that must not be instrumented. We need to
recurse all the way down the nesting structure to figure it
out: looking just at the outer node is not enough. */
tree var;
int component_ref_only = (TREE_CODE (t) == COMPONENT_REF);
/* If we have a bitfield component reference, we must note the
innermost addressable object in ELT, from which we will
construct the byte-addressable bounds of the bitfield. */
tree elt = NULL_TREE;
int bitfield_ref_p = (TREE_CODE (t) == COMPONENT_REF
&& DECL_BIT_FIELD_TYPE (TREE_OPERAND (t, 1)));
/* Iterate to the top of the ARRAY_REF/COMPONENT_REF
containment hierarchy to find the outermost VAR_DECL. */
var = TREE_OPERAND (t, 0);
while (1)
{
if (bitfield_ref_p && elt == NULL_TREE
&& (TREE_CODE (var) == ARRAY_REF || TREE_CODE (var) == COMPONENT_REF))
elt = var;
if (TREE_CODE (var) == ARRAY_REF)
{
component_ref_only = 0;
var = TREE_OPERAND (var, 0);
}
else if (TREE_CODE (var) == COMPONENT_REF)
var = TREE_OPERAND (var, 0);
else if (INDIRECT_REF_P (var))
{
base = TREE_OPERAND (var, 0);
break;
}
else
{
gcc_assert (TREE_CODE (var) == VAR_DECL
|| TREE_CODE (var) == PARM_DECL
|| TREE_CODE (var) == RESULT_DECL
|| TREE_CODE (var) == STRING_CST);
/* Don't instrument this access if the underlying
variable is not "eligible". This test matches
those arrays that have only known-valid indexes,
and thus are not labeled TREE_ADDRESSABLE. */
if (! mf_decl_eligible_p (var) || component_ref_only)
return;
else
{
base = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (var)), var);
break;
}
}
}
/* Handle the case of ordinary non-indirection structure
accesses. These have only nested COMPONENT_REF nodes (no
INDIRECT_REF), but pass through the above filter loop.
Note that it's possible for such a struct variable to match
the eligible_p test because someone else might take its
address sometime. */
/* We need special processing for bitfield components, because
their addresses cannot be taken. */
if (bitfield_ref_p)
{
tree field = TREE_OPERAND (t, 1);
if (TREE_CODE (DECL_SIZE_UNIT (field)) == INTEGER_CST)
size = DECL_SIZE_UNIT (field);
if (elt)
elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)), elt);
addr = fold_convert (ptr_type_node, elt ? elt : base);
addr = fold_build2 (PLUS_EXPR, ptr_type_node,
addr, fold_convert (ptr_type_node,
byte_position (field)));
}
else
addr = build1 (ADDR_EXPR, build_pointer_type (type), t);
limit = fold_build2 (MINUS_EXPR, mf_uintptr_type,
fold_build2 (PLUS_EXPR, mf_uintptr_type,
convert (mf_uintptr_type, addr),
size),
integer_one_node);
}
break;
case INDIRECT_REF:
addr = TREE_OPERAND (t, 0);
base = addr;
limit = fold_build2 (MINUS_EXPR, ptr_type_node,
fold_build2 (PLUS_EXPR, ptr_type_node, base, size),
integer_one_node);
break;
tree-ssa-address.c: New file. * tree-ssa-address.c: New file. * Makefile.in (tree-ssa-address.o): Add. * expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on INDIRECT_REFs. Handle TARGET_MEM_REFs. * tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs. * tree-flow.h (struct mem_address): New. (struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c. (create_mem_ref, addr_for_mem_ref, get_address_description, maybe_fold_tmr, multiplier_allowed_in_address_p, multiply_by_cost): Declare. * tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs. * tree-pretty-print.c (dump_generic_node): Ditto. * tree-ssa-loop-im.c (for_each_index): Ditto. * tree-ssa-loop-ivopts.c (may_be_unaligned_p, find_interesting_uses_address): Ditto. (rewrite_address_base, build_addr_strip_iref): Removed. (struct affine_tree_combination): Moved to tree-flow.h. (get_ref_tag, copy_ref_info): New functions. (rewrite_use_address): Produce TARGET_MEM_REFs. (tree_ssa_iv_optimize): Do not call update_ssa and rewrite_into_loop_closed_ssa. (tree_to_aff_combination): Use build_fold_addr_expr instead of build_addr_strip_iref. (unshare_aff_combination): New function. (fold_affine_sum): Removed. (get_computation_at): Use get_computation_aff. Unshare the result. (get_computation_aff, multiplier_allowed_in_address_p): New function. (multiply_by_cost): Exported. (get_address_cost): Use multiplier_allowed_in_address_p. * tree-ssa-operands.c (get_tmr_operands): New function. (get_expr_operands): Handle TARGET_MEM_REFs. * tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs. (build): Handle 7 arguments. (build7_stat): New function. * tree.def (TARGET_MEM_DEF): New. * tree.h (REF_ORIGINAL): Removed. (TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL, TMR_TAG, build7): New macros. (build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare. * tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr. * doc/c-tree.texi: Document TARGET_MEM_REF. * doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar. * gcc.dg/tree-ssa/loop-2.c: Update outcome. * gcc.dg/tree-ssa/loop-3.c: Update outcome. * gcc.dg/tree-ssa/loop-4.c: Update outcome. * gcc.dg/tree-ssa/loop-9.c: New test. From-SVN: r100708
2005-06-07 14:01:47 +02:00
case TARGET_MEM_REF:
addr = tree_mem_ref_addr (ptr_type_node, t);
base = addr;
limit = fold_build2 (MINUS_EXPR, ptr_type_node,
fold_build2 (PLUS_EXPR, ptr_type_node, base, size),
build_int_cst (ptr_type_node, 1));
tree-ssa-address.c: New file. * tree-ssa-address.c: New file. * Makefile.in (tree-ssa-address.o): Add. * expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on INDIRECT_REFs. Handle TARGET_MEM_REFs. * tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs. * tree-flow.h (struct mem_address): New. (struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c. (create_mem_ref, addr_for_mem_ref, get_address_description, maybe_fold_tmr, multiplier_allowed_in_address_p, multiply_by_cost): Declare. * tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs. * tree-pretty-print.c (dump_generic_node): Ditto. * tree-ssa-loop-im.c (for_each_index): Ditto. * tree-ssa-loop-ivopts.c (may_be_unaligned_p, find_interesting_uses_address): Ditto. (rewrite_address_base, build_addr_strip_iref): Removed. (struct affine_tree_combination): Moved to tree-flow.h. (get_ref_tag, copy_ref_info): New functions. (rewrite_use_address): Produce TARGET_MEM_REFs. (tree_ssa_iv_optimize): Do not call update_ssa and rewrite_into_loop_closed_ssa. (tree_to_aff_combination): Use build_fold_addr_expr instead of build_addr_strip_iref. (unshare_aff_combination): New function. (fold_affine_sum): Removed. (get_computation_at): Use get_computation_aff. Unshare the result. (get_computation_aff, multiplier_allowed_in_address_p): New function. (multiply_by_cost): Exported. (get_address_cost): Use multiplier_allowed_in_address_p. * tree-ssa-operands.c (get_tmr_operands): New function. (get_expr_operands): Handle TARGET_MEM_REFs. * tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs. (build): Handle 7 arguments. (build7_stat): New function. * tree.def (TARGET_MEM_DEF): New. * tree.h (REF_ORIGINAL): Removed. (TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL, TMR_TAG, build7): New macros. (build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare. * tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr. * doc/c-tree.texi: Document TARGET_MEM_REF. * doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar. * gcc.dg/tree-ssa/loop-2.c: Update outcome. * gcc.dg/tree-ssa/loop-3.c: Update outcome. * gcc.dg/tree-ssa/loop-4.c: Update outcome. * gcc.dg/tree-ssa/loop-9.c: New test. From-SVN: r100708
2005-06-07 14:01:47 +02:00
break;
case ARRAY_RANGE_REF:
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "mudflap checking not yet implemented for ARRAY_RANGE_REF");
return;
case BIT_FIELD_REF:
/* ??? merge with COMPONENT_REF code above? */
{
tree ofs, rem, bpu;
/* If we're not dereferencing something, then the access
must be ok. */
if (TREE_CODE (TREE_OPERAND (t, 0)) != INDIRECT_REF)
return;
bpu = bitsize_int (BITS_PER_UNIT);
ofs = convert (bitsizetype, TREE_OPERAND (t, 2));
rem = size_binop (TRUNC_MOD_EXPR, ofs, bpu);
ofs = size_binop (TRUNC_DIV_EXPR, ofs, bpu);
size = convert (bitsizetype, TREE_OPERAND (t, 1));
size = size_binop (PLUS_EXPR, size, rem);
size = size_binop (CEIL_DIV_EXPR, size, bpu);
size = convert (sizetype, size);
addr = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
addr = convert (ptr_type_node, addr);
addr = fold_build2 (PLUS_EXPR, ptr_type_node, addr, ofs);
base = addr;
limit = fold_build2 (MINUS_EXPR, ptr_type_node,
fold_build2 (PLUS_EXPR, ptr_type_node, base, size),
integer_one_node);
}
break;
default:
return;
}
mf_build_check_statement_for (base, limit, iter, locus, dirflag);
}
static void
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
mf_xform_derefs (void)
{
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
basic_block bb, next;
block_stmt_iterator i;
int saved_last_basic_block = last_basic_block;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
bb = ENTRY_BLOCK_PTR ->next_bb;
do
{
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
next = bb->next_bb;
for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
{
tree s = bsi_stmt (i);
/* Only a few GIMPLE statements can reference memory. */
switch (TREE_CODE (s))
{
case GIMPLE_MODIFY_STMT:
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 0),
EXPR_LOCUS (s), integer_one_node);
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 1),
EXPR_LOCUS (s), integer_zero_node);
break;
case RETURN_EXPR:
if (TREE_OPERAND (s, 0) != NULL_TREE)
{
if (TREE_CODE (TREE_OPERAND (s, 0)) == GIMPLE_MODIFY_STMT)
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND
(TREE_OPERAND (s, 0), 1),
EXPR_LOCUS (s), integer_zero_node);
else
mf_xform_derefs_1 (&i, &TREE_OPERAND (s, 0), EXPR_LOCUS (s),
integer_zero_node);
}
break;
default:
;
}
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
bb = next;
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
while (bb && bb->index <= saved_last_basic_block);
}
/* ------------------------------------------------------------------------ */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* ADDR_EXPR transforms. Perform the declaration-related mudflap tree
transforms on the current function.
This is the first part of the mudflap instrumentation. It works on
high-level GIMPLE because after lowering, all variables are moved out
of their BIND_EXPR binding context, and we lose liveness information
for the declarations we wish to instrument. */
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
static unsigned int
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
execute_mudflap_function_decls (void)
{
/* Don't instrument functions such as the synthetic constructor
built during mudflap_finish_file. */
if (mf_marked_p (current_function_decl) ||
DECL_ARTIFICIAL (current_function_decl))
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
return 0;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
push_gimplify_context ();
mf_xform_decls (DECL_SAVED_TREE (current_function_decl),
DECL_ARGUMENTS (current_function_decl));
pop_gimplify_context (NULL);
tree-vrp.c (execute_vrp): Return value. 2006-03-02 Daniel Berlin <dberlin@dberlin.org> * gcc/tree-vrp.c (execute_vrp): Return value. * gcc/regrename.c (rest_of_handle_regrename): Ditto. * gcc/tree-into-ssa.c (rewrite_into_ssa): Ditto. * gcc/tree-complex.c (tree_lower_complex): Ditto. (tree_lower_complex_O0): Ditto. * gcc/tracer.c (rest_of_handle_tracer): Ditto. * gcc/postreload-gcse.c (rest_of_handle_gcse2): Ditto. * gcc/postreload.c (rest_of_handle_postreload): Ditto. * gcc/tree-tailcall.c (execute_tail_recursion): Ditto. (execute_tail_calls): Ditto. * gcc/tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * gcc/tree.h (init_function_for_compilation): Ditto. * gcc/ipa-cp.c (ipcp_driver): Ditto. * gcc/tree-scalar-evolution.c (scev_const_prop): Ditto. * gcc/tree-scalar-evolution.h (scev_const_prop): Ditto. * gcc/final.c (compute_alignments): Ditto. (rest_of_handle_final): Ditto. (rest_of_handle_shorten_branches): Ditto. (rest_of_clean_state): Ditto. * gcc/omp-low.c (execute_expand_omp): Ditto. (execute_lower_omp): Ditto. * gcc/tree-ssa-dse.c (tree_ssa_dse): Ditto. * gcc/ipa-reference.c (static_execute): Ditto. * gcc/tree-ssa-uncprop.c (tree_ssa_uncprop): Ditto. * gcc/reorg.c (rest_of_handle_delay_slots): Ditto. (rest_of_handle_machine_reorg): Ditto. * gcc/cgraphunit.c (rebuild_cgraph_edges): Ditto. * gcc/flow.c (recompute_reg_usage): Ditto. (rest_of_handle_remove_death_notes): Ditto. (rest_of_handle_life): Ditto. (rest_of_handle_flow2): Ditto. * gcc/tree-ssa-copyrename.c (rename_ssa_copies): Ditto. * gcc/tree-ssa-ccp.c (do_ssa_ccp): Ditto. (do_ssa_store_ccp): Ditto. (execute_fold_all_builtins): Ditto. * gcc/mode-switching.c (rest_of_handle_mode_switching): Ditto. * gcc/modulo-sched.c (rest_of_handle_sms): Ditto. * gcc/ipa-pure-const.c (static_execute): Ditto. * gcc/cse.c (rest_of_handle_cse): Ditto. (rest_of_handle_cse2): Ditto. * gcc/web.c (rest_of_handle_web): Ditto. * gcc/tree-stdarg.c (execute_optimize_stdarg): Ditto. * gcc/tree-ssa-math-opts.c (execute_cse_reciprocals): Ditto. * gcc/tree-ssa-dom.c (tree_ssa_dominator_optimize): Ditto. * gcc/tree-nrv.c (tree_nrv): Ditto. (execute_return_slot_opt): Ditto. * gcc/tree-ssa-alias.c (compute_may_aliases): Ditto. (create_structure_vars): Ditto. * gcc/loop-init.c (rtl_loop_init): Ditto. (rtl_loop_done): Ditto. (rtl_move_loop_invariants): Ditto. (rtl_unswitch): Ditto. (rtl_unroll_and_peel_loops): Ditto. (rtl_doloop): Ditto. * gcc/gimple-low.c (lower_function_body): Ditto. (mark_used_blocks): Ditto. * gcc/tree-ssa-sink.c (execute_sink_code): Ditto. * gcc/ipa-inline.c (cgraph_decide_inlining): Ditto. (cgraph_early_inlining): Ditto. * gcc/global.c (rest_of_handle_global_alloc): Ditto. * gcc/jump.c (cleanup_barriers): Ditto. (purge_line_number_notes): Ditto. * gcc/ifcvt.c (rest_of_handle_if_conversion): Ditto. (rest_of_handle_if_after_reload): Ditto. * gcc/tree-ssa-loop.c (tree_ssa_loop_init): Ditto. (tree_ssa_loop_im): Ditto. (tree_ssa_loop_unswitch): Ditto. (tree_vectorize): Ditto. (tree_linear_transform): Ditto. (tree_ssa_loop_ivcanon): Ditto. (tree_ssa_empty_loop): Ditto. (tree_ssa_loop_bounds): Ditto. (tree_complete_unroll): Ditto. (tree_ssa_loop_prefetch): Ditto. (tree_ssa_loop_ivopts): Ditto. (tree_ssa_loop_done): Ditto. * gcc/predict.c (tree_estimate_probability): Ditto. * gcc/recog.c (split_all_insns_noflow): Ditto. (rest_of_handle_peephole2): Ditto. (rest_of_handle_split_all_insns): Ditto. * gcc/tree-eh.c (lower_eh_constructs): Ditto. * gcc/regmove.c (rest_of_handle_regmove): Ditto. (rest_of_handle_stack_adjustments): Ditto. * gcc/local-alloc.c (rest_of_handle_local_alloc): Ditto. * gcc/function.c (instantiate_virtual_regs): Ditto. (init_function_for_compilation): Ditto. (rest_of_handle_check_leaf_regs): Ditto. * gcc/gcse.c (rest_of_handle_jump_bypass): Ditto. (rest_of_handle_gcse): Ditto. * gcc/ipa-type-escape.c (type_escape_execute): Ditto. * gcc/alias.c (rest_of_handle_cfg): Ditto. * gcc/tree-if-conv.c (main_tree_if_conversion): Ditto. * gcc/profile.c (rest_of_handle_branch_prob): Ditto. * gcc/tree-ssa-phiopt.c (tree_ssa_phiopt): Ditto. * gcc/rtl-factoring.c (rest_of_rtl_seqabstr): Ditto. * gcc/bt-load.c (rest_of_handle_branch_target_load_optimize): Ditto * gcc/tree-dfa.c (find_referenced_vars): Ditto. * gcc/except.c (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. (rest_of_handle_eh): Ditto. * gcc/emit-rtl.c (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. * gcc/except.h (set_nothrow_function_flags): Ditto. (convert_to_eh_region_ranges): Ditto. * gcc/cfgexpand.c (tree_expand_cfg): Ditto. * gcc/tree-cfgcleanup.c (merge_phi_nodes): Ditto. * gcc/tree-ssa-pre.c (do_pre): Ditto. (execute_fre): Ditto. * gcc/cfgcleanup.c (rest_of_handle_jump): Ditto. (rest_of_handle_jump2): Ditto. * gcc/tree-sra.c (tree_sra): Ditto. * gcc/tree-mudflap.c (execute_mudflap_function_ops): Ditto. (execute_mudflap_function_decls): Ditto. * gcc/tree-ssa-copy.c (do_copy_prop): Ditto. (do_store_copy_prop): Ditto. * gcc/ipa-prop.h (ipcp_driver): Ditto. * gcc/cfglayout.c (insn_locators_initialize): Ditto. * gcc/tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_vars): Ditto. * gcc/cfglayout.h (insn_locators_initialize): Ditto. * gcc/tree-ssa-dce.c (tree_ssa_dce): Ditto. * gcc/tree-ssa.c (execute_early_warn_uninitialized): Ditto. (execute_late_warn_uninitialized): Ditto. * gcc/rtl.h (cleanup_barriers): Ditto. (split_all_insns_noflow): Ditto. (purge_line_number_notes): Ditto. (unshare_all_rtl): Ditto. (remove_unnecessary_notes): Ditto. (recompute_reg_usage): Ditto. (variable_tracking_main): Ditto. * gcc/integrate.c (emit_initial_value_sets): Ditto. * gcc/integrate.h (emit_initial_value_sets): Ditto. * gcc/tree-optimize.c (execute_free_datastructures): Ditto (execute_free_cfg_annotations): Ditto. (execute_fixup_cfg): Ditto. (execute_cleanup_cfg_pre_ipa): Ditto. (execute_cleanup_cfg_post_optimizing): Ditto. (execute_init_datastructures): Ditto. * gcc/tree-object-size.c (compute_object_sizes): Ditto. * gcc/combine.c (rest_of_handle_combine): Ditto. * gcc/tree-outof-ssa.c (rewrite_out_of_ssa): Ditto. * gcc/bb-reorder.c (duplicate_computed_gotos): Ditto. (rest_of_handle_reorder_blocks): Ditto. (rest_of_handle_partition_blocks): Ditto. * gcc/var-tracking.c (variable_tracking_main): Ditto. * gcc/tree-profile.c (tree_profiling): Ditto. * gcc/tree-vect-generic.c (expand_vector_operations): Ditto. * gcc/reg-stack.c (rest_of_handle_stack_regs): Ditto. * gcc/sched-rgn.c (rest_of_handle_sched): Ditto. (rest_of_handle_sched2): Ditto. * gcc/basic-block.h (free_bb_insn): Ditto. * gcc/tree-ssa-structalias.c (ipa_pta_execute): Ditto. * gcc/tree-cfg.c (execute_build_cfg): Ditto. (remove_useless_stmts): Ditto. (split_critical_edges): Ditto. (execute_warn_function_return): Ditto. (execute_warn_function_noreturn): Ditto. * gcc/tree-ssa-reassoc.c (execute_reassoc): Ditto. * gcc/cfgrtl.c (free_bb_for_insn): Ditto. * gcc/passes.c (execute_one_pass): Run additional todos returned by execute function. * gcc/tree-pass.h (struct tree_opt_pass): Make execute return a value. From-SVN: r111643
2006-03-02 20:00:11 +01:00
return 0;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
}
/* This struct is passed between mf_xform_decls to store state needed
during the traversal searching for objects that have their
addresses taken. */
struct mf_xform_decls_data
{
tree param_decls;
};
/* Synthesize a CALL_EXPR and a TRY_FINALLY_EXPR, for this chain of
_DECLs if appropriate. Arrange to call the __mf_register function
now, and the __mf_unregister function later for each. */
static void
mx_register_decls (tree decl, tree *stmt_list)
{
tree finally_stmts = NULL_TREE;
tree_stmt_iterator initially_stmts = tsi_start (*stmt_list);
while (decl != NULL_TREE)
{
if (mf_decl_eligible_p (decl)
/* Not already processed. */
&& ! mf_marked_p (decl)
/* Automatic variable. */
&& ! DECL_EXTERNAL (decl)
&& ! TREE_STATIC (decl))
{
tree size = NULL_TREE, variable_name;
tree unregister_fncall, unregister_fncall_params;
tree register_fncall, register_fncall_params;
size = convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (decl)));
/* (& VARIABLE, sizeof (VARIABLE), __MF_TYPE_STACK) */
unregister_fncall_params =
tree_cons (NULL_TREE,
convert (ptr_type_node,
mf_mark (build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (decl)),
decl))),
tree_cons (NULL_TREE,
size,
tree.h (build_int_cst): New. .: * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. From-SVN: r86022
2004-08-15 17:45:33 +02:00
tree_cons (NULL_TREE,
/* __MF_TYPE_STACK */
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
build_int_cst (NULL_TREE, 3),
NULL_TREE)));
/* __mf_unregister (...) */
unregister_fncall = build_function_call_expr (mf_unregister_fndecl,
unregister_fncall_params);
/* (& VARIABLE, sizeof (VARIABLE), __MF_TYPE_STACK, "name") */
variable_name = mf_varname_tree (decl);
register_fncall_params =
tree_cons (NULL_TREE,
convert (ptr_type_node,
mf_mark (build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (decl)),
decl))),
tree_cons (NULL_TREE,
size,
tree_cons (NULL_TREE,
tree.h (build_int_cst): New. .: * tree.h (build_int_cst): New. (build_int_2): Remove. * tree.c (build_int_2): Remove. (build_int_cst): New. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Use build_int_cst. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Use build_int_cst. * c-common.c (start_fname_decls, fix_string_type, c_common_nodes_and_builtins, c_init_attributes, shorten_compare): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. * convert.c (convert_to_pointer): Likewise. * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_end_case_type, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Use build_int_cst. ada: * cuintp.c (UI_To_gnu): Use build_int_cst.. * trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise. * utils.c (init_gigi_decls): Likewise. * utils2.c (build_call_raise): Likewise. cp: * call.c (convert_class_to_reference, build_user_type_conversion_1, convert_like_real, build_java_interface_fn_ref, build_special_member_call): Use build_int_cst. * class.c (build_vtbl_initializer): Likewise. * cp-gimplify.c (cp_gimplify_expr): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. * decl2.c (start_static_initialization_or_destruction, generate_ctor_or_dtor_function): Likewise. * except.c (build_throw): Likewise. * lex.c (cxx_init): Likewise. * mangle.c (write_integer_cst): Likewise. * rtti.c (build_headof, get_tinfo_decl_dynamic, build_dynamic_cast_1, ptr_initializer, ptm_initializer, get_pseudo_ti_init): Likewise. * search.c (get_dynamic_cast_base_type): Likewise. * tree.c (build_shared_int_cst): Likewise. fortran: * trans-array.c (gfc_trans_array_constructor_value): Use build_int_cst. * trans-const.c (gfc_build_string_const, gfc_init_constants, gfc_conv_mpz_to_tree, gfc_conv_constant_to_tree): Likewise. * trans-decl.c (gfc_get_symbol_decl): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_len, prepare_arg_info): Likewise. * trans-io.c (add_case, set_error_locus, build_dt, transfer_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause, gfc_trans_stop, gfc_trans_character_select): Likewise. * trans-types.c (gfc_init_types, gfc_get_dtype): Likewise. * trans.c (gfc_trans_runtime_check): Likewise. java: * boehm.c (get_boehm_type_descriptor): Use build_int_cst. * class.c (build_utf8_ref, build_static_field_ref, make_field_value, make_method_value, get_dispatch_table, make_class_data, emit_symbol_table, emit_catch_table): Likewise. * constants.c (get_tag_node, build_ref_from_constant_pool, build_constants_constructor): Likewise. * decl.c (java_init_decl_processing): Likewise. * expr.c (build_java_array_length_access, build_newarray, expand_java_multianewarray, expand_java_pushc, expand_iinc, build_java_binop, build_field_ref, expand_java_add_case, expand_java_call, build_known_method_ref, build_invokevirtual, build_invokeinterface, build_jni_stub): Likewise. * java-gimplify.c (java_gimplify_new_array_init): Likewise. * jcf-parse.c (get_constant): Likewise. * lex.c (do_java_lex): Likewise. * parse.y (patch_binop, patch_unaryop, patch_cast, build_null_of_type, patch_newarray): Likewise. * resource.c (compile_resource_data): Likewise. * typeck.c (build_prim_array_type): Likewise. From-SVN: r86022
2004-08-15 17:45:33 +02:00
/* __MF_TYPE_STACK */
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
build_int_cst (NULL_TREE, 3),
tree_cons (NULL_TREE,
variable_name,
NULL_TREE))));
/* __mf_register (...) */
register_fncall = build_function_call_expr (mf_register_fndecl,
register_fncall_params);
/* Accumulate the two calls. */
/* ??? Set EXPR_LOCATION. */
gimplify_stmt (&register_fncall);
gimplify_stmt (&unregister_fncall);
/* Add the __mf_register call at the current appending point. */
if (tsi_end_p (initially_stmts))
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "mudflap cannot track %qs in stub function",
IDENTIFIER_POINTER (DECL_NAME (decl)));
else
{
tsi_link_before (&initially_stmts, register_fncall, TSI_SAME_STMT);
/* Accumulate the FINALLY piece. */
append_to_statement_list (unregister_fncall, &finally_stmts);
}
mf_mark (decl);
}
decl = TREE_CHAIN (decl);
}
/* Actually, (initially_stmts!=NULL) <=> (finally_stmts!=NULL) */
if (finally_stmts != NULL_TREE)
{
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. 2005-12-02 Richard Guenther <rguenther@suse.de> * tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build. * tree-complex.c (update_complex_assignment, expand_complex_div_wide): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref, maybe_fold_offset_to_component_ref): Likewise. * tree-ssa-dom.c (thread_across_edge, simplify_rhs_and_lookup_avail_expr, find_equivalent_equality_comparison, record_equivalences_from_stmt): Likewise. * gimple-low.c (lower_function_body, lower_return_expr): Likewise. * tree-eh.c (do_return_redirection, honor_protect_cleanup_actions, lower_try_finally_switch): Likewise. * tree-if-conv.c (add_to_dst_predicate_list, replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise. * gimplify.c (internal_get_tmp_var, gimple_build_eh_filter, voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr, gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr, gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr, shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr, gimplify_init_ctor_eval, gimplify_init_constructor, gimplify_variable_sized_compare, gimplify_boolean_expr, gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr, gimplify_expr, gimplify_body, gimplify_function_tree, force_gimple_operand): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Likewise. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for, mx_register_decls): Likewise. * tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain, get_frame_field, finalize_nesting_tree_1): Likewise. * tree-inline.c (setup_one_parameter): Likewise. * tree-vect-transform.c (vectorizable_condition): Likewise. * tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies): Likewise. * tree-profile.c (tree_gen_edge_profiler): Likewise. * tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise. * c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. From-SVN: r107907
2005-12-02 18:09:40 +01:00
tree t = build2 (TRY_FINALLY_EXPR, void_type_node,
*stmt_list, finally_stmts);
*stmt_list = NULL;
append_to_statement_list (t, stmt_list);
}
}
/* Process every variable mentioned in BIND_EXPRs. */
static tree
mx_xfn_xform_decls (tree *t, int *continue_p, void *data)
{
struct mf_xform_decls_data* d = (struct mf_xform_decls_data*) data;
if (*t == NULL_TREE || *t == error_mark_node)
{
*continue_p = 0;
return NULL_TREE;
}
*continue_p = 1;
switch (TREE_CODE (*t))
{
case BIND_EXPR:
{
/* Process function parameters now (but only once). */
mx_register_decls (d->param_decls, &BIND_EXPR_BODY (*t));
d->param_decls = NULL_TREE;
mx_register_decls (BIND_EXPR_VARS (*t), &BIND_EXPR_BODY (*t));
}
break;
default:
break;
}
return NULL_TREE;
}
/* Perform the object lifetime tracking mudflap transform on the given function
tree. The tree is mutated in place, with possibly copied subtree nodes.
For every auto variable declared, if its address is ever taken
within the function, then supply its lifetime to the mudflap
runtime with the __mf_register and __mf_unregister calls.
*/
static void
mf_xform_decls (tree fnbody, tree fnparams)
{
struct mf_xform_decls_data d;
d.param_decls = fnparams;
walk_tree_without_duplicates (&fnbody, mx_xfn_xform_decls, &d);
}
/* ------------------------------------------------------------------------ */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
/* Externally visible mudflap functions. */
/* Mark and return the given tree node to prevent further mudflap
transforms. */
static GTY ((param_is (union tree_node))) htab_t marked_trees = NULL;
tree
mf_mark (tree t)
{
void **slot;
if (marked_trees == NULL)
marked_trees = htab_create_ggc (31, htab_hash_pointer, htab_eq_pointer, NULL);
slot = htab_find_slot (marked_trees, t, INSERT);
*slot = t;
return t;
}
int
mf_marked_p (tree t)
{
void *entry;
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
if (marked_trees == NULL)
return 0;
entry = htab_find (marked_trees, t);
return (entry != NULL);
}
/* Remember given node as a static of some kind: global data,
function-scope static, or an anonymous constant. Its assembler
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
label is given. */
/* A list of globals whose incomplete declarations we encountered.
Instead of emitting the __mf_register call for them here, it's
delayed until program finish time. If they're still incomplete by
then, warnings are emitted. */
static GTY (()) VEC(tree,gc) *deferred_static_decls;
/* A list of statements for calling __mf_register() at startup time. */
static GTY (()) tree enqueued_call_stmt_chain;
static void
mudflap_register_call (tree obj, tree object_size, tree varname)
{
tree arg, args, call_stmt;
args = tree_cons (NULL_TREE, varname, NULL_TREE);
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
arg = build_int_cst (NULL_TREE, 4); /* __MF_TYPE_STATIC */
args = tree_cons (NULL_TREE, arg, args);
arg = convert (size_type_node, object_size);
args = tree_cons (NULL_TREE, arg, args);
arg = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (obj)), obj);
arg = convert (ptr_type_node, arg);
args = tree_cons (NULL_TREE, arg, args);
call_stmt = build_function_call_expr (mf_register_fndecl, args);
append_to_statement_list (call_stmt, &enqueued_call_stmt_chain);
}
void
mudflap_enqueue_decl (tree obj)
{
if (mf_marked_p (obj))
return;
/* We don't need to process variable decls that are internally
generated extern. If we did, we'd end up with warnings for them
during mudflap_finish_file (). That would confuse the user,
since the text would refer to variables that don't show up in the
user's source code. */
if (DECL_P (obj) && DECL_EXTERNAL (obj) && DECL_ARTIFICIAL (obj))
return;
VEC_safe_push (tree, gc, deferred_static_decls, obj);
}
void
mudflap_enqueue_constant (tree obj)
{
tree object_size, varname;
if (mf_marked_p (obj))
return;
if (TREE_CODE (obj) == STRING_CST)
tree.h (build_int_cst): New, sign extended constant. * tree.h (build_int_cst): New, sign extended constant. (build_int_cstu): New, zero extended constant. (build_int_cst_wide): Renamed from build_int_cst. * tree.c (build_int_cst, build_int_cstu): New. (build_int_cst_wide): Renamed from build_int_cst. (make_vector_type, build_common_tree_nodes, build_common_tree_nodes_2): Adjust build_int_cst calls. * builtins.c (expand_builtin_prefetch, expand_builtin_strstr, expand_builtin_strpbrk, expand_builtin_fputs, build_string_literal, expand_builtin_printf, expand_builtin_sprintf, fold_builtin_classify_type, fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii, fold_builtin_isdigit, simplify_builtin_strstr, simplify_builtin_strpbrk, fold_builtin_fputs, simplify_builtin_sprintf): Likewise. * c-common.c (start_fname_decls, fix_string_type, shorten_compare, DEF_ATTR_INT): Likewise. * c-decl.c (complete_array_type, check_bitfield_type_and_width): Likewise. * c-lex.c (interpret_integer, lex_charconst): Likewise. * c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init_from_string): Likewise. * calls.c (load_register_parameters): Likewise. convert.c (convert_to_pointer): Likewise. coverage.c (coverage_counter_alloc, tree_coverage_counter_ref, build_fn_info_type, build_fn_info_value, build_ctr_info_value, build_gcov_info): Likewise. * except.c (init_eh, assign_filter_values): Likewise. * expmed.c (store_fixed_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_shift, expand_mult_const, expand_mult_highpart_adjust, extract_high_half, expand_sdiv_pow2, expand_divmod, make_tree): Likewise. * expr.c (convert_move, emit_group_load, emit_group_store, expand_assignment, store_constructor, store_field, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. fold-const.c (force_fit_type, int_const_binop, fold_convert_const, invert_truthvalue, optimize_bit_field_compare, decode_field_reference, all_ones_mask_p, constant_boolean_node, fold_div_compare, fold, fold_read_from_constant_string, fold_negate_const, fold_abs_const, fold_not_const, round_up, round_down): Likewise. * function.c (assign_parm_setup_block): Likewise. * stmt.c (shift_return_value, expand_case, estimate_case_costs): Likewise. * stor-layout.c (layout_type, initialize_sizetypes, set_min_and_max_values_for_integral_type): Likewise. * tree-chrec.c (chrec_fold_multiply_poly_poly, reset_evolution_in_loop): Likewise. * tree-chrec.h (build_polynomial_chrec): Likewise. * tree-complex.c (build_replicated_const): Likewise. * tree-eh.c (honor_protect_cleanup_actions, lower_try_finally_onedest, lower_try_finally_copy, lower_try_finally_switch): Likewise. * tree-mudflap.c (mf_build_string, mx_register_decls, mudflap_register_call, mudflap_enqueue_constant): Likewise. * tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref): Likewise. * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise. * tree-ssa-loop-niter.c (number_of_iterations_cond, loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type): Likewise. * tree-ssa-loop-ivcanon.c (create_canonical_iv, canonicalize_loop_induction_variables): Likewise. * tree-vectorizer.c (vect_create_index_for_array_ref, vect_transform_loop_bound, vect_compute_data_ref_alignment): Likewise. * config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start, alpha_gimplify_va_arg_1): Likewise. * config/arm/arm.c (arm_get_cookie_size): Likewise. * config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_build_builtin_va_list, mips_va_start, mips_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg, add_compiler_branch_island): Likewise. * config/s390/s390.c (s390_va_start): Likewise. * config/sh/sh.c (sh_va_start): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_gimplify_va_arg_expr): Likewise. * objc/objc-act.c (build_objc_string_object, build_objc_symtab_template, init_def_list, init_objc_symtab, init_module_descriptor, generate_static_references, build_selector_translation_table, get_proto_encoding, build_typed_selector_reference, build_selector_reference, build_next_objc_exception_stuff, build_method_prototype_list_template, generate_descriptor_table, generate_protocols, build_protocol_initializer, build_ivar_list_template, build_method_list_template, build_ivar_list_initializer, generate_ivars_list, generate_dispatch_table, generate_protocol_list, build_category_initializer, build_shared_structure_initializer, generate_shared_structures, handle_impent, generate_objc_image_info): Likewise. 2004-04-25 Paolo Bonzini <bonzini@gnu.org> * cfglayout.c (duplicate_insn_chain): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator. * cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT. * final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove. * jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT. * loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop, check_dbra_loop, loop_dump_aux): Remove references to removed notes and fields. * reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs. * unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove references to removed notes and fields. (subtract_reg_term, ujump_to_loop_cont): Remove. From-SVN: r86544
2004-08-25 11:52:54 +02:00
object_size = build_int_cst (NULL_TREE, TREE_STRING_LENGTH (obj));
else
object_size = size_in_bytes (TREE_TYPE (obj));
if (TREE_CODE (obj) == STRING_CST)
varname = mf_build_string ("string literal");
else
varname = mf_build_string ("constant");
mudflap_register_call (obj, object_size, varname);
}
/* Emit any file-wide instrumentation. */
void
mudflap_finish_file (void)
{
tree ctor_statements = NULL_TREE;
/* No need to continue when there were errors. */
if (errorcount != 0 || sorrycount != 0)
return;
/* Insert a call to __mf_init. */
{
tree call2_stmt = build_function_call_expr (mf_init_fndecl, NULL_TREE);
append_to_statement_list (call2_stmt, &ctor_statements);
}
/* If appropriate, call __mf_set_options to pass along read-ignore mode. */
if (flag_mudflap_ignore_reads)
{
tree arg = tree_cons (NULL_TREE,
mf_build_string ("-ignore-reads"), NULL_TREE);
tree call_stmt = build_function_call_expr (mf_set_options_fndecl, arg);
append_to_statement_list (call_stmt, &ctor_statements);
}
/* Process all enqueued object decls. */
if (deferred_static_decls)
{
size_t i;
tree obj;
for (i = 0; VEC_iterate (tree, deferred_static_decls, i, obj); i++)
{
gcc_assert (DECL_P (obj));
if (mf_marked_p (obj))
continue;
/* Omit registration for static unaddressed objects. NB:
Perform registration for non-static objects regardless of
TREE_USED or TREE_ADDRESSABLE, because they may be used
from other compilation units. */
if (! TREE_PUBLIC (obj) && ! TREE_ADDRESSABLE (obj))
continue;
if (! COMPLETE_TYPE_P (TREE_TYPE (obj)))
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "mudflap cannot track unknown size extern %qs",
IDENTIFIER_POINTER (DECL_NAME (obj)));
continue;
}
mudflap_register_call (obj,
size_in_bytes (TREE_TYPE (obj)),
mf_varname_tree (obj));
}
VEC_truncate (tree, deferred_static_decls, 0);
}
/* Append all the enqueued registration calls. */
if (enqueued_call_stmt_chain)
{
append_to_statement_list (enqueued_call_stmt_chain, &ctor_statements);
enqueued_call_stmt_chain = NULL_TREE;
}
cgraph_build_static_cdtor ('I', ctor_statements,
MAX_RESERVED_INIT_PRIORITY-1);
}
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
static bool
gate_mudflap (void)
{
return flag_mudflap != 0;
}
struct tree_opt_pass pass_mudflap_1 =
{
"mudflap1", /* name */
gate_mudflap, /* gate */
execute_mudflap_function_decls, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
PROP_gimple_any, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
Unify the management of RTL and tree-level dump files. 2004-09-06 Paolo Bonzini <bonzini@gnu.org> Unify the management of RTL and tree-level dump files. * cfgexpand.c (tree_expand_cfg): Fix incorrect comment. Don't print function name to the dump file, the pass manager would do this for us. Add code from the top of rest_of_compilation, up to the initial RTL dump. * passes.c (rest_of_handle_jump): Call fixup_tail_calls and close the DFI_sibling dump file. (rest_of_compilation): Don't do that here. Remove code up to the initial RTL dump. (init_optimization_passes): Remove. (pass_rest_of_compilation): Change pass name to NULL. * toplev.c (lang_dependent_init): Do not use an empty dump file prefix. Do not call init_optimization_passes. * toplev.h (init_optimization_passes): Remove. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Remove SUFFIX parameter. * graph.h (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * tree-pass.h (struct tree_opt_pass): Add `letter' field. * cfgexpand.c (pass_expand): Adjust. * gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust. * passes.c (pass_rest_of_compilation): Adjust. * predict.c (pass_profile): Adjust. * tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust. * tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts, pass_split_crit_edges, pass_warn_function_return): Adjust. * tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust. * tree-dfa.c (pass_referenced_vars): Adjust. * tree-eh.c (pass_lower_eh): Adjust. * tree-if-conv.c (pass_build_ssa): Adjust. * tree-into-ssa.c (pass_build_ssa): Adjust. * tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nrv.c (pass_nrv): Adjust. * tree-optimize.c (pass_gimple, pass_all_optimizations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures): Adjust. * tree-outof-ssa.c (pass_del_ssa): Adjust. * tree-profile.c (pass_tree_profile): Adjust. * tree-sra.c (pass_sra): Adjust. * tree-ssa-alias.c (pass_may_alias): Adjust. * tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust. * tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust. * tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust. * tree-ssa-dom.c (pass_dominator): Adjust. * tree-ssa-dse.c (pass_dse): Adjust. * tree-ssa-forwprop.c (pass_forwprop): Adjust. * tree-ssa-if-conv.c (pass_if_conversion): Adjust. * tree-ssa-loop-ch.c (pass_ch): Adjust. * tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim, pass_loop_done, pass_complete_unroll, pass_iv_canon, pass_iv_optimize, pass_vectorize): Adjust. * tree-ssa-phiopt.c (pass_phiopt): Adjust. * tree-ssa-pre.c (pass_pre, pass_fre): Adjust. * tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized, pass_late_warn_uninnitialized): Adjust. * tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust. * Makefile.in (tree-dump.o): Add new dependencies. * cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all. * cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize): Likewise. * toplev.c (dump_file_name): New. * tree-dump.c (dump_enable_all): Add LETTER parameter. (struct dump_file_info): Add NUM and LETTER fields. (dump_files): Adjust and add RTL dump files. (dump_register): Add NUM and LETTER fields. (get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New. (dump_begin): Use get_dump_file_name. (dump_switch_p_1): Adjust call to dump_enable_all. * tree-dump.h (dump_register): Adjust prototype. * tree-optimize.c (register_one_dump_file): Take dump file index. Support flags for RTL dumps. (register_dump_files): Fill in NUM field of struct dump_file_info. Track properties both when the gate is executed and when it is not. (execute_todo): Dump RTL. Add PROPERTIES parameter. (execute_one_pass): Pass properties to execute_todo. Handle VCG dumps of RTL. * tree-pass.h (dump_file_name): New. * tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p): New. * Makefile.in (passes.o): Add new dependencies. * passes.c (struct dump_file_info, enum dump_file_index, dump_file_tbl, init_optimization_passes): Remove. (open_dump_file, close_dump_file): Use tree-dumping infrastructure. (rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use dump_enabled_p. (finish_optimization_passes): Update finish_graph_dump_file loop. (enable_rtl_dump_file): Remove. * tree-dump.c (dump_files): Adjust and add RTL dump files. (enable_rtl_dump_file): Add here. * tree.h (enum tree_dump_index): Add RTL dump file indices. * doc/invoke.texi (Debugging options): Document new RTL debugging options. Update. From-SVN: r87113
2004-09-06 12:08:17 +02:00
TODO_dump_func, /* todo_flags_finish */
0 /* letter */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
};
struct tree_opt_pass pass_mudflap_2 =
{
"mudflap2", /* name */
gate_mudflap, /* gate */
execute_mudflap_function_ops, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
0, /* tv_id */
PROP_gimple_leh, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_verify_flow | TODO_verify_stmts
Unify the management of RTL and tree-level dump files. 2004-09-06 Paolo Bonzini <bonzini@gnu.org> Unify the management of RTL and tree-level dump files. * cfgexpand.c (tree_expand_cfg): Fix incorrect comment. Don't print function name to the dump file, the pass manager would do this for us. Add code from the top of rest_of_compilation, up to the initial RTL dump. * passes.c (rest_of_handle_jump): Call fixup_tail_calls and close the DFI_sibling dump file. (rest_of_compilation): Don't do that here. Remove code up to the initial RTL dump. (init_optimization_passes): Remove. (pass_rest_of_compilation): Change pass name to NULL. * toplev.c (lang_dependent_init): Do not use an empty dump file prefix. Do not call init_optimization_passes. * toplev.h (init_optimization_passes): Remove. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Remove SUFFIX parameter. * graph.h (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * tree-pass.h (struct tree_opt_pass): Add `letter' field. * cfgexpand.c (pass_expand): Adjust. * gimple-low.c (pass_lower_cf, pass_remove_useless_vars): Adjust. * passes.c (pass_rest_of_compilation): Adjust. * predict.c (pass_profile): Adjust. * tree-alias-common.c (pass_build_pta, pass_del_pta): Adjust. * tree-cfg.c (pass_build_cfg, pass_remove_useless_stmts, pass_split_crit_edges, pass_warn_function_return): Adjust. * tree-complex.c (pass_lower_vector_ssa, pass_pre_expand): Adjust. * tree-dfa.c (pass_referenced_vars): Adjust. * tree-eh.c (pass_lower_eh): Adjust. * tree-if-conv.c (pass_build_ssa): Adjust. * tree-into-ssa.c (pass_build_ssa): Adjust. * tree-mudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nomudflap.c (pass_mudflap_1, pass_mudflap_2): Adjust. * tree-nrv.c (pass_nrv): Adjust. * tree-optimize.c (pass_gimple, pass_all_optimizations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures): Adjust. * tree-outof-ssa.c (pass_del_ssa): Adjust. * tree-profile.c (pass_tree_profile): Adjust. * tree-sra.c (pass_sra): Adjust. * tree-ssa-alias.c (pass_may_alias): Adjust. * tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Adjust. * tree-ssa-copyrename.c (pass_rename_ssa_copies): Adjust. * tree-ssa-dce.c (pass_dce, pass_cd_dce): Adjust. * tree-ssa-dom.c (pass_dominator): Adjust. * tree-ssa-dse.c (pass_dse): Adjust. * tree-ssa-forwprop.c (pass_forwprop): Adjust. * tree-ssa-if-conv.c (pass_if_conversion): Adjust. * tree-ssa-loop-ch.c (pass_ch): Adjust. * tree-ssa-loop.c (pass_loop, pass_loop_init, pass_lim, pass_loop_done, pass_complete_unroll, pass_iv_canon, pass_iv_optimize, pass_vectorize): Adjust. * tree-ssa-phiopt.c (pass_phiopt): Adjust. * tree-ssa-pre.c (pass_pre, pass_fre): Adjust. * tree-ssa.c (pass_redundant_phi, pass_early_warn_uninitialized, pass_late_warn_uninnitialized): Adjust. * tree-tailcall.c (pass_tail_recursion, pass_tail_calls): Adjust. * Makefile.in (tree-dump.o): Add new dependencies. * cgraph.c (cgraph_remove_node): TDF_all -> TDF_tree_all. * cgraphunit.c (cgraph_preserve_function_body_p, cgraph_optimize): Likewise. * toplev.c (dump_file_name): New. * tree-dump.c (dump_enable_all): Add LETTER parameter. (struct dump_file_info): Add NUM and LETTER fields. (dump_files): Adjust and add RTL dump files. (dump_register): Add NUM and LETTER fields. (get_dump_file_name, dump_initialized_p, enable_rtl_dump_file): New. (dump_begin): Use get_dump_file_name. (dump_switch_p_1): Adjust call to dump_enable_all. * tree-dump.h (dump_register): Adjust prototype. * tree-optimize.c (register_one_dump_file): Take dump file index. Support flags for RTL dumps. (register_dump_files): Fill in NUM field of struct dump_file_info. Track properties both when the gate is executed and when it is not. (execute_todo): Dump RTL. Add PROPERTIES parameter. (execute_one_pass): Pass properties to execute_todo. Handle VCG dumps of RTL. * tree-pass.h (dump_file_name): New. * tree.h (TDF_TREE, TDF_RTL, get_dump_file_name, dump_initialized_p): New. * Makefile.in (passes.o): Add new dependencies. * passes.c (struct dump_file_info, enum dump_file_index, dump_file_tbl, init_optimization_passes): Remove. (open_dump_file, close_dump_file): Use tree-dumping infrastructure. (rest_of_handle_new_regalloc, rest_of_handle_old_regalloc): Use dump_enabled_p. (finish_optimization_passes): Update finish_graph_dump_file loop. (enable_rtl_dump_file): Remove. * tree-dump.c (dump_files): Adjust and add RTL dump files. (enable_rtl_dump_file): Add here. * tree.h (enum tree_dump_index): Add RTL dump file indices. * doc/invoke.texi (Debugging options): Document new RTL debugging options. Update. From-SVN: r87113
2004-09-06 12:08:17 +02:00
| TODO_dump_func, /* todo_flags_finish */
0 /* letter */
CFG transparent RTL expansion: * Makefile.in (cfgexpand.o): New object file. (builtins.o): Add dependency on basic-block.h * builtins.c: Include basic-block.h (entry_of_function): New function. (expand_builtin_apply_args, expand_builtin_saveargs): Use it. * cfgexpand.c: New file. * expr.c (execute_expand, pass_expand): Kill. * pass.c (rest_of_compilation): Do not build CFG unless called from coverage code. * tree-cfg.c (delete_tree_cfg): Rename to.. (delete_tree_cfg_annotations): ... this one; Do not remove the CFG itself. * tree-flow.h (delete_tree_cfg_annotations): Declare. (dleete_tree_cfg): Kill. * tree-optimize.c (execute_rebuild_bind, pass_rebuild_bind): Kill. (execute_del_cfg): Rename to... (execute_free_datastructures): This one... (pass_del_cfg): Rename to... (pass_free_datastructures): ... this one; Do not kill PROP_cfg. (init_tree_optimization_passes): Make cfg build and profiling to happen unconditionally. * tree-mudflap.c (mf_decl_cache_locals): Skip labels before inserting the cache variables. * tree-mudflap.c: Include headers to make basic_block available. Move functions around such that related functions are near each other. Add prototypes for all static functions. Add comments briefly explaining what IR the mudflap1 and mudflap2 work on and what they do. (mudflap_function_decls): Rename to execute_mudflap_function_decls. (mudflap_function_ops): Rename to execute_mudflap_function_ops. (pass_mudflap_1, pass_mudflap_2): Update. (mf_decl_cache_locals): Make it work on the CFG instead of the saved function tree. (mf_build_check_statement_for): Make it work on the CFG. (mf_xform_derefs_1): Likewise. Cleanup code style. (mf_xform_derefs): Likewise. * tree-cfg.c (label_to_block): Invent the label destination for undefined labels. (cleanup_dead_labels): Update table in the case label_to_block added new label. From-SVN: r83385
2004-06-19 17:33:06 +02:00
};
#include "gt-tree-mudflap.h"