aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
AgeCommit message (Collapse)AuthorFilesLines
2003-08-19cgraph.c (cgraph_mark_needed_node): Call notice_global_symbol.Jan Hubicka1-0/+2
* cgraph.c (cgraph_mark_needed_node): Call notice_global_symbol. (cgraph_varpool_mark_needed_node): Likewise. * cgraph.h (notice_global_symbol): Declare * varasm.c (notice_global_symbol): Break out from ... (assemble_start_function): ... here; update for variables. (assemble_variable): Use notice_global_symbol. From-SVN: r70559
2003-08-16i386.c (ix86_fntype_regparm): Rename from ...Jan Hubicka1-10/+15
* i386.c (ix86_fntype_regparm): Rename from ... (ix86_function_regparm): ... this one; add fastcall and local functions. (ix86_function_ok_for_sibcall): Update. (ix86_return_pops_args): Likewise. (init_cumulative_args): Likewise. (x86_can_output_mi_thunk): Likewise. (function_arg): Fix formating. (x86_this_parameter): Fix fastcall. (x86_output_mi_thunk): Likewise. * cgraph.c (cgraph_mark_needed_node): Do not mark functions without body as reachable; mark nested functions as needed too. (dump_cgraph): Do not output global.calls. * cgraph.h (cgraph_global_info): Kill. * cgraphunit.c (cgraph_finalize_function): Enqueue needed functions. (record_call_1): Speedup. (cgraph_analyze_function): Break out from ...; compute inlining parameters. (cgraph_finalize_compilation_unit): ... here. (cgraph_mark_inline): Kill computation of calls. (cgraph_decide_inlining): Do not compute most of initial values. From-SVN: r70504
2003-08-05tree.h (DID_INLINE_FUNC): Remove macro.Steven Bosscher1-1/+1
2003-08-05 Steven Bosscher <steven@gcc.gnu.org> * tree.h (DID_INLINE_FUNC): Remove macro. (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h, add tree check for FUNCTION_DECL. (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h. (struct tree_decl): Rename inlined_function_flag to declared_inline_flag. * c-common.h (c_lang_decl): Remove. (DECL_ESTIMATED_INSNS): Remove. * c-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * c-decl.c (grokdeclarator): Update comment. With -finline-functions, do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC. (finish_function): Make uninlinable a bool. Fixup call to tree_inlinable_function_p() and fix some code style issues. * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'. * cgraph.c (dump_cgraph): Likewise. * cgraphunit.c (cgraph_decide_inlining): Likewise (cgraph_finalize_compilation_unit): Likewise. Also update call to tree_inlinable_function_p(). (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead look at DECL_DECLARED_INLINE and reverse logic. * print-tree.c (print_node): Likewise. * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC. * tree-inline.h (tree_inlinable_function_p): Make a bool. Update prototype. * tree-inline.c (inlinable_function_p): Split up in this function to check for basic inlining inhibiting conditions, and new limits_allow_inlining() function. Warn if inlining is impossible because the inline candidate calls alloca or uses sjlj exceptions. (limits_allow_inlining): this new function to check if the inlining limits are satisfied. Throttle from currfn_max_inline_insns, not from MAX_INLINE_INSNS_SINGLE. The latter only makes sense if MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal. Update prototypes. (tree_inlinable_function_p): Make a bool. Update call to inlinable_function_p (expand_call_inline): Use limits_allow_inlining() when not in unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC, instead see if the function was declared `inline'. cp/ * cp-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P if decl is a FUNCTION_DECL. This never made sense, but now it is required to avoid a tree check failure. * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. * optimize.c (maybe_clone_body): Likewise. java/ * java-tree.h (DECL_ESTIMATED_INSNS): Remove. From-SVN: r70174
2003-07-31cgraph.c (create_edge): Fix typo.Jan Hubicka1-1/+1
* cgraph.c (create_edge): Fix typo. * i386.c (pic_symbolic_operand): Reorder tests. From-SVN: r70006
2003-07-18* cgraph.c (cgraph_remove_node): Clear the hash table slot.Jan Hubicka1-0/+6
From-SVN: r69562
2003-07-12fp-test.c (main): Use ISO C90 prototype.Andreas Jaeger1-43/+25
* fp-test.c (main): Use ISO C90 prototype. * version.c: Remove unneded include of ansidecl.h. * cgraph.h: Convert prototypes to ISO C90. * cgraph.c: Likewise. * fix-header.c: Likewise. * ra.h: Likewise. * protoize.c: Likewise. From-SVN: r69265
2003-07-12cgraph.c (cgraph_max_uid): New global variable.Jan Hubicka1-2/+40
* cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-09cgraph.c (cgraph_node_name): New function.Jan Hubicka1-7/+11
* cgraph.c (cgraph_node_name): New function. (dump_cgraph): Use it. * cgraph.h (cgraph_dump_file): Declare. (cgraph_node_name): Declare. * cgraphunit.c: Include timevar.h (cgraph_finalize_compilation_unit): Use timevar; reorganize dumps. (cgraph_optimize_function): Use TV_INTEGRATION. (cgraph_mark_local_functions): reorganize dumps. (cgraph_mark_functions_to_inline_once): Likewise. (cgraph_optimize): Likewise; use timevar. * timevar.def (TV_CGRAPH, TV_CGRAPHOPT): New. * toplev.c (dump_file_index): Add DFI_cgraph. (dump_file_info): Likewise. (cgraph_dump_file): New global variable. (do_compile): Open and close cgraph dump. * invoke.texi (-d): Document new flag; renumber. From-SVN: r69120
2003-07-02cgraph.c (cgraph_mark_needed_node, [...]): Use next_needed field instead of ↵Jan Hubicka1-5/+5
aux to maintain the queue. * cgraph.c (cgraph_mark_needed_node, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls): Use next_needed field instead of aux to maintain the queue. * cgraph.h (cgraph_node): Add next_needed. (cgraph_varpool_node): Add next_needed; remove aux. * cgraphunit.c (cgraph_finalize_compilation_unit): Use next_needed. From-SVN: r68807
2003-06-30Makefile.in (GTFILES): Add cgraph.h.Jan Hubicka1-47/+33
* Makefile.in (GTFILES): Add cgraph.h. * cgraph.c (known_decls): Remove. (cgraph_hash, cgraph_nodes, cgraph_nodes_queue, cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize. (cgraph_node): Do not allocate known_decls; use polutate hashtable. (cgraph_varpool_node): Likewise; add next pointer. (cgraph_varpool_nodes): New static variable. * cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info, cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes, cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize. * gengtype.c (open_base_files): Include cgraph.h From-SVN: r68742
2003-06-28builtins.c: Follow spelling conventions.Kazu Hirata1-1/+1
* builtins.c: Follow spelling conventions. * cgraph.c: Likewise. * cpplex.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/iwmmxt.md: Likewise. * config/c4x/c4x-modes.def: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.h: Likewise. * config/c4x/c4x.md: Likewise. * config/i386/i386-interix.h: Likewise. * config/mips/mips.h: Likewise. From-SVN: r68648
2003-06-27cgraph.c (cgraph_node, [...]): Avoid re-initializing of known_decls.Jan Hubicka1-2/+4
* cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing of known_decls. From-SVN: r68573
2003-06-24Makefile.in (cgraph.o): Depend on output.h, not depend on tree-inline.hJan Hubicka1-8/+145
* Makefile.in (cgraph.o): Depend on output.h, not depend on tree-inline.h * cgraph.c: Do not include tree-inline.h; include output.h (known_fns): Rename to ... (known_decls): ... this one; update all uses. (cgraph_varpool_hash): New static variable. (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global variables. (cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node, cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls): New functions. * cgraph.h (cgraph_varpool_node): New structure. (cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare. (cgraph_varpool_node, cgraph_varpool_node_for_identifier, cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node, cgraph_varpool_asemble_pending_decls): Declare. * cgraphunit.c (record_call_1): Notice variable references. (cgraph_finalize_compilation_unit): Assemble pending variables. * toplev.c (wrapup_global_declarations): Use varpool. (compile_file): Assemble pending declarations. (rest_of_decl_compilation): Use varpool in unit-at-a-time mode. * varasm.c (assemble_name): Notice varpool references. From-SVN: r68426
2003-06-23cgraph.c (cgraph_nodes_queue): Declare.Jan Hubicka1-2/+52
* cgraph.c (cgraph_nodes_queue): Declare. (eq_node): Take identifier as p2. (cgraph_node): Update htab_find_slot_with_hash call. (cgraph_node_for_identifier): New. (cgraph_mark_needed_node): Move here from cgraphunit.c. * cgraph.h (cgraph_nodes_queue): Declare. (cgraph_node_for_identifier): Declare. * cgraphunit.c (cgraph_finalize_function): Collect entry points here instead of in cgraph_finalize_compilation_unit; constructors and destructors are entry points. (cgraph_finalize_compilation_unit): Reorganize debug outout; examine nested functions after lowerng; call collect_functions hook. (cgraph_mark_local_functions): DECL_COMDAT functions are not local. (cgraph_finalize_compilation_unit): Do not collect entry points. * varasm.c: Include cgraph.h (assemble_name): Mark referenced identifier as needed. * cgraphunit.c (record_call_1): Use get_callee_fndecl. From-SVN: r68390
2003-06-16decl.c, [...]: Don't use the PTR macro.Kaveh R. Ghazi1-5/+5
cp: * cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR macro. gcc: * bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c, config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c, dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c, function.c, gcc.c, genoutput.c, gensupport.c, global.c, haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c, loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c, read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c, stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use the PTR macro. From-SVN: r68043
2003-06-12ChangeLog: Follow spelling conventions.Kazu Hirata1-1/+1
* ChangeLog: Follow spelling conventions. * ChangeLog.2: Likewise. * c-decl.c: Likewise. * cfgloop.h: Likewise. * cgraph.c: Likewise. * coverage.c: Likewise. * cppcharset.c: Likewise. * cpphash.h: Likewise. * cpplex.c: Likewise. * cpplib.c: Likewise. * dbxout.c: Likewise. * df.c: Likewise. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gengtype.c: Likewise. * ggc.h: Likewise. * opts.c: Likewise. * real.c: Likewise. * reload.c: Likewise. * stmt.c: Likewise. From-SVN: r67849
2003-03-08Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.Jan Hubicka1-1/+18
* Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h. * gt-cgraph.h: New GC file. * cgraph.c (known_fns): New static variable. (cgraph_node): Add the decl into varray. From-SVN: r63998
2003-03-08inline-3.c: New test.Jan Hubicka1-3/+37
* gcc.dg/inline-3.c: New test. * c-decl.c: (finish_function): Update call of tree_inlinable_function_p. * cgraph.h: (cgraph_local_info): Add can_inline_once (cgraph_global_info): Add inline_once. (cgraph_node): Add previous. (cgraph_remove_node): New. * cgraphunit.c (cgraph_mark_functions_to_inline_once): New static function. (cgraph_optimize): Call it. (cgraph_finalize_function): Set inlinable flags. (cgraph_finalize_compilation_unit): Actually remove the reclaimed nodes. (cgraph_mark_functions_to_output): Use new inlining heuristics flags. (cgraph_expand_function): Likewise. * cgraph.c (cgraph_node): Put nodes into doubly linked chain. (cgraph_remove_node): New function. * flags.h (flag_inline_functions_called_once): Declare. * tree-inline.c: Include cgraph.h (inlinable_functions_p): Add extra argument to bypass limits. (expand_call_inline): Obey cgraph flag. * tree-inline.h (tree_inlinable_function_p): Update prototype. From-SVN: r63983
2003-03-06* cgraph.c (cgraph_node): Do not confuse nested functions and methods.Jan Hubicka1-1/+1
From-SVN: r63889
2003-03-05Makefile.in (calls.o, [...]): Depend on cgraph.hJan Hubicka1-0/+16
* Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h * alias.c: Include cgraph.h (mark_constant_function): Use cgraph_rtl_info. * calls.c: Include cgraph.h (flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const calls. (expand_call): Use cgraph_rtl_info to set preferred stack boundary. * cgraph.c (cgraph_rtl_info): New function. * cgraph.h (cgraph_rtl_info): Declare (cgraph_rtl_info): Likewise. * function.h (struct function): Add recursive_call_emit. * toplev.c: Include cgraph.h. (rest_of_compilation): Set preferred_incoming_stack_boundary. * gcc.dg/i386-local2.c: New. From-SVN: r63868
2003-03-05i386-local.c: New.Jan Hubicka1-0/+30
* gcc.dg/i386-local.c: New. * toplev.c (rest_of_compilation): Deffer RTL compilation only when RTL inlining is done. * cgraphunit.c (cgraph_mark_local_functions): New local function. (cgraph_optimize): Mark local functions. * i386-protos.h (init_cumulative_args): Update prototype. * i386.c (init_cumulative_args): Use register passing convention for local functions. * cgraph.c (cgraph_global_info_ready): New global variable (cgraph_local_info, cgraph_global_info): New functions. * cgraph.h (struct cgraph_local_info, cgraph_global_info): New structures. (cgraph_local_info, cgraph_global_info, cgraph_global_info_ready): Declare. * cgraphunit.c (cgraph_finalize_function): Set inline_many. (cgraph_mark_functions_to_output): Use inline_many. (cgraph_expand_function): Free DECL_SAVED_TREE uncondtionally. (cgraph_expand_functions): Expand inline functions last. (cgraph_optimize): Do not emit uneeded functions. From-SVN: r63822
2003-02-22expmed.c (expand_divmod): Undo sign extensions for unsigned operandsJan Hubicka1-371/+6
* expmed.c (expand_divmod): Undo sign extensions for unsigned operands * cfgcleanup.c (try_forward_edges): Don't check loop structures when not optimizing. (cleanup_cfg): Do not iterate trought delete_trivially_dead_insns when not expensive. * toplev.c (rest_of_compilation): Duplicate loop headers only when optimizing; Delete trivially dead insns early; fix optimize check. * Makefile.in (c-decl.o, c-objc-common.o, cgraph.o, tree-inline.o): Add dependency on cgraph.h * c-decl.c: Include cgraph.h (finish_function): Update call of tree_inlinable_function_p. * c-objc-common.c: Include cgraph.h * cgraph.h: New file. * cgraphunit.c: New file. * cgraph.c (cgraph_node, cgraph_edge): Move into cgraph.h (cgraph_nodes, cgraph_n_nodes): Globalize. (cgraph_finalize_function, cgraph_finalize_compilation_unit cgraph_create_edges, cgraph_optimize, cgraph_mark_needed_node): Move into cgraphunit.c * tree-inline.c: Include cgraph.h * tree-inline.c: Include cgraph.h From-SVN: r63281
2003-02-19cgraph.c (NPREDECESORC, [...]): Kill.Jan Hubicka1-39/+53
* cgraph.c (NPREDECESORC, SET_NPREDECESORS): Kill. (cgraph_expand_function): Rewrite. * gcc.dg/funcorder.c: New test. From-SVN: r63098
2003-02-13cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t.Andreas Schwab1-2/+2
* cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t. Parenthesize properly. (NPREDECESORS): Parenthesize properly. From-SVN: r62838
2003-02-12Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-timeJan Hubicka1-0/+563
* Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time (OBJS): Add callgraph.o (callgraph.o): New. * c-decl.c (expand_body_1): Break out from ... (expand_body): This one; change calling convention (finish_function): Move some of expand_body logic here. (c_expand_deferred_function): Update call of expand_body (c_expand_stmt): Use c_expand_body_1. * c-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define. * c-objc-commin.c (c_objc_common_finish_file): Use callgraph code. * c-tree.h (c_expand_body): Declare. * callgraph.c: New file. * flags.h (flag_unit_at_a_time): Declare. * langhooks.h (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION, LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_CALLGRAPH_INITIALIZER): New macros. * langhooks.h (struct lang_hooks_for_callgraph): New. (struct lang_hooks): Add callgraph field. * toplev.c (flag_unit_at_a_time): New. (lang_independent_options): Add flag_unit_at_a_time. (process_options): Disable unit-at-a-time mode for frontends not supporting callgraph. * tree-inline.c (typedef struct inline_data): Add "decl" (expand_call_inline): Update callgraph. (optimize_inline_calls): Set id.decl. * tree.h (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_create_edges, dump_cgraph, cgraph_optimize, cgraph_remove_call cgraph_calls_p): Declare. * invoke.texi (-funit-at-a-time): Document From-SVN: r62789