Hi,
this patch drops !flag_unit_at_a_time code from compiler along with flag_inline_trees flags.
I decided to take away the second as the code handling both is bit mixed. flag_inline_trees
was never set to 0 in current compilers, it was either 1 or 2, when 2 implied setting
DECL_INLINE on everything (i.e. -finline-functions), but DECL_INLINE is long ignored
by inliner decisions as we inline functions called once and such.
DECL_INLINE was in fact used by c-decl.c on second guessing if we will process function
or we should output warning on missing return statement in non-void. This check was wrong
as with callgraph we always eliminated unused statics, so I've changed test to
static functions and compensated testsuite (there was some missing positives on C++).
I've also removed some of tests that no longer make sense.
I woud like to drop DECL_INLINE flag in followup too.
Bootstrapped/regtested i686-linux, will commit it tomorrow if there are no complains.
* cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
(build_cgraph_edges): Likewise.
* cgraph.c (cgraph_node): Do not update assembler hash.
(cgraph_remove_node): Drop non-unit-at-a-time code.
* tree-pass.h (pass_O0_always_inline): Remove.
* ipa-reference.c (gate_reference): Remove unit-at-a-time check.
* toplev.c (process_options): Flag unit-at-a-time does not imply
no section anchors.
* cgraphunit.c: Update comments.
(decide_is_function_needed): Drop non-unit-at-a-time mode.
(cgraph_assemble_pending_functions): Remove.
(cgraph_reset_node): Drop non-unit-at-a-time code.
(cgraph_finalize_function): Likewise.
(cgraph_analyze_function): Likewise.
(cgraph_finalize_compilation_unit): Likewise.
(cgraph_expand_function): Likewise.
(cgraph_optimize): Likesise.
(save_inline_function_body): Likewise.
* ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check.
* tree-ssa-alias.c (maybe_be_aliased): Likewise.
* ipa-inline.c: Update comments.
(enum inlining_mode): remove INLINE_SPEED.
(cgraph_clone_inlined_nodes): Drop unit-at-a-time check.
(cgraph_mark_inline_edge): Likewise.
(try_inline): Likewise.
(cgraph_decide_inlining_incrementally): Likewise.
(cgraph_gate_inlining): Remove.
(cgraph_early_inlining): Remove flag_unit_at_a_time checks.
(cgraph_gate_early_inlining): Likewise.
(gate_inline_passes): Remove.
(pass_inline_parameters, pass_ipa_inline): Remove gates.
(cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
pass_O0_always_inline): Remove.
* c-pch.c (c_pch_matching): Remove -funit-at-a-time.
* dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
* opts.c (no_unit_at_a_time_default): Remove.
(decode_options): Remove flag_unit_at_a_time reset and warning.
* opts.h (no_unit_at_a_time_default): Remove.
* c-decl.c (diagnose_mismatched_decls): Do not require inline keyword
early in GNU dialect.
(merge_decls): Update comment; drop unit-at-a-time check.
(finish_decl): Likewise.
(grok_declaration): Remove flag_inline_trees code.
(finish_functions): Return on function returning non-void on all
statics.
* ipa-tye-escape.c (gate_type_escape_vars): Remove.
* cfgexpand.c (expand_one_static_var): Remove.
(expand_one_var): Remove expand_one_static_var call.
(expand_used_vars_for_block): Remove flag_unit_a_time check.
* c-opts.c (c_common_post_options): Remove flag_inline_trees code
and flag_unit_at_a-time compatibility checks.
* varasm.c (assemble_alias): Remove flag_unit_at_a_time check.
* tree-inline.c (flag_inline_trees): Remove.
(inlinable_function_p): Don't check it.
(expand_call_inline): Remove non-unit-at-a-time code.
* tree-inline.h (flag_inline_trees): Remove.
* tree-optimize.c (execute_early_local_optimizations): Remove
unit-at-a-time checks.
(tree_rest_of_compilation): Likewise.
* combine.c (setup_incoming_promotions): Likewise.
* tree-profile.c (tree_gen_ic_func_profiler): Likewise.
* tree-ssa-structalias.c (delete_points_to_sets): Likewise.
* passes.c (pass_inline_parameters): Update comments; remove
O0_alwaysinline pass.
(execute_one_ipa_transform_pass): Do not reset in_gimple_form.
(execute_one_pass): Likewise.
* i386.c (ix86_function_regparm): Remove unit-at-a-time check.
(ix86_function_sseregparm): Likewise.
* arm.c (arm_function_in_section_p): Likewise.
* bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise.
* varpool.c: Update comments.
(decide_is_variable_needed): Remove unit-at-a-time checks.
(varpool_finalize_decl): Likewise.
* ada/utils.c (end_subprog_body): Remove inline trees check.
* ada/misc.c (gnat_post_options): Do not set flag_inline_trees.
* fortran/options.c (gfc_post_options): Remove flag_unline_trees code.
* gcc.dg/winline-4.c: Remove.
* gcc.dg/pch/valid-3.hs: Remove.
* gcc.dg/pch/valid-3.c: Remove.
* g++.old-deja/g++.brendan/crash52.C: Accept returning void warning
* g++.old-deja/g++.jason/report.C: Likewise.
* testsuite/g++.dg/warn/pr23075.C: We get returning void warning
instead of control flow warning.
* cp/decl.c (duplicate_decls): Update comment and unit-at-a-time.
(grogfndecl): Drop flag_inline_trees code.
* cp/pt.c (instantiate_decl): Drop flag_iline_trees code.
* cp/lex.c (cxx_init): Do not set unit-at-a-time.
* java/decl.c: Include cgraph.h
(end_java_method): Remove non-unit-at-a-time code.
(java_mark_decl_local): Likewise; sanity check that we don't touch
finalized nodes.
Index: cgraphbuild.c
===================================================================
*** cgraphbuild.c (revision 138005)
--- cgraphbuild.c (working copy)
*************** static tree
*** 38,43 ****
--- 38,44 ----
record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
tree t = *tp;
+ tree decl;
switch (TREE_CODE (t))
{
*************** record_reference (tree *tp, int *walk_su
*** 52,83 ****
case FDESC_EXPR:
case ADDR_EXPR:
! if (flag_unit_at_a_time)
! {
! /* Record dereferences to the functions. This makes the
! functions reachable unconditionally. */
! tree decl = TREE_OPERAND (*tp, 0);
! if (TREE_CODE (decl) == FUNCTION_DECL)
! cgraph_mark_needed_node (cgraph_node (decl));
! }
break;
case OMP_PARALLEL:
! if (flag_unit_at_a_time)
! {
! if (OMP_PARALLEL_FN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
! }
break;
case OMP_TASK:
! if (flag_unit_at_a_time)
! {
! if (OMP_TASK_FN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
! if (OMP_TASK_COPYFN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
! }
break;
default:
--- 53,75 ----
case FDESC_EXPR:
case ADDR_EXPR:
! /* Record dereferences to the functions. This makes the
! functions reachable unconditionally. */
! decl = TREE_OPERAND (*tp, 0);
! if (TREE_CODE (decl) == FUNCTION_DECL)
! cgraph_mark_needed_node (cgraph_node (decl));
break;
case OMP_PARALLEL:
! if (OMP_PARALLEL_FN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
break;
case OMP_TASK:
! if (OMP_TASK_FN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
! if (OMP_TASK_COPYFN (*tp))
! cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
break;
default:
*************** build_cgraph_edges (void)
*** 176,183 ****
{
tree decl = TREE_VALUE (step);
if (TREE_CODE (decl) == VAR_DECL
! && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
! && flag_unit_at_a_time)
varpool_finalize_decl (decl);
else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl))
walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes);
--- 168,174 ----
{
tree decl = TREE_VALUE (step);
if (TREE_CODE (decl) == VAR_DECL
! && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
varpool_finalize_decl (decl);
else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl))
walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes);
Index: java/decl.c
===================================================================
*** java/decl.c (revision 138005)
--- java/decl.c (working copy)
*************** The Free Software Foundation is independ
*** 49,54 ****
--- 49,55 ----
#include "version.h"
#include "tree-iterator.h"
#include "langhooks.h"
+ #include "cgraph.h"
#if defined (DEBUG_JAVA_BINDING_LEVELS)
extern void indent (void);
*************** end_java_method (void)
*** 1797,1810 ****
finish_method (fndecl);
- if (! flag_unit_at_a_time)
- {
- /* Nulling these fields when we no longer need them saves
- memory. */
- DECL_SAVED_TREE (fndecl) = NULL;
- DECL_STRUCT_FUNCTION (fndecl) = NULL;
- DECL_INITIAL (fndecl) = NULL_TREE;
- }
current_function_decl = NULL_TREE;
}
--- 1798,1803 ----
*************** java_mark_decl_local (tree decl)
*** 1854,1868 ****
{
DECL_EXTERNAL (decl) = 0;
! /* If we've already constructed DECL_RTL, give encode_section_info
! a second chance, now that we've changed the flags. */
! /* ??? Ideally, we'd have flag_unit_at_a_time set, and not have done
! anything that would have referenced DECL_RTL so far. But at the
! moment we force flag_unit_at_a_time off due to excessive memory
! consumption when compiling large jar files. Which probably means
! that we need to re-order how we process jar files... */
! if (DECL_RTL_SET_P (decl))
! make_decl_rtl (decl);
}
/* Given appropriate target support, G++ will emit hidden aliases for native
--- 1847,1858 ----
{
DECL_EXTERNAL (decl) = 0;
! #ifdef ENABLE_CHECKING
! /* Double check that we didn't passed function to callgraph early. */
! if (TREE_CODE (decl) == FUNCTION_DECL)
! gcc_assert (!cgraph_node (decl)->local.finalized);
! #endif
! gcc_assert (!DECL_RTL_SET_P (decl));
}
/* Given appropriate target support, G++ will emit hidden aliases for native
Index: java/lang.c
===================================================================
*** java/lang.c (revision 138005)
--- java/lang.c (working copy)
*************** java_post_options (const char **pfilenam
*** 535,542 ****
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* An absolute requirement: if we're not using indirect dispatch, we
must always verify everything. */
--- 535,540 ----
Index: cgraph.c
===================================================================
*** cgraph.c (revision 138010)
--- cgraph.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 23,31 ****
The callgraph:
! The call-graph is data structure designed for intra-procedural optimization
! but it is also used in non-unit-at-a-time compilation to allow easier code
! sharing.
The call-graph consist of nodes and edges represented via linked lists.
Each function (external or not) corresponds to the unique node.
--- 23,29 ----
The callgraph:
! The call-graph is data structure designed for inter-procedural optimization.
The call-graph consist of nodes and edges represented via linked lists.
Each function (external or not) corresponds to the unique node.
*************** cgraph_node (tree decl)
*** 412,428 ****
node->master_clone = node;
}
- /* This code can go away once flag_unit_at_a_mode is removed. */
- if (assembler_name_hash)
- {
- tree name = DECL_ASSEMBLER_NAME (node->decl);
- slot = ((struct cgraph_node **)
- htab_find_slot_with_hash (assembler_name_hash, name,
- decl_assembler_name_hash (name),
- INSERT));
- if (!*slot)
- *slot = node;
- }
return node;
}
--- 410,415 ----
*************** cgraph_remove_node (struct cgraph_node *
*** 893,899 ****
htab_clear_slot (assembler_name_hash, slot);
}
! if (kill_body && flag_unit_at_a_time)
cgraph_release_function_body (node);
node->decl = NULL;
if (node->call_site_hash)
--- 880,886 ----
htab_clear_slot (assembler_name_hash, slot);
}
! if (kill_body)
cgraph_release_function_body (node);
node->decl = NULL;
if (node->call_site_hash)
Index: tree-pass.h
===================================================================
*** tree-pass.h (revision 138005)
--- tree-pass.h (working copy)
*************** extern struct rtl_opt_pass pass_final;
*** 504,510 ****
extern struct rtl_opt_pass pass_rtl_seqabstr;
extern struct gimple_opt_pass pass_release_ssa_names;
extern struct gimple_opt_pass pass_early_inline;
- extern struct gimple_opt_pass pass_O0_always_inline;
extern struct gimple_opt_pass pass_inline_parameters;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;
--- 504,509 ----
Index: ipa-reference.c
===================================================================
*** ipa-reference.c (revision 138005)
--- ipa-reference.c (working copy)
*************** static_execute (void)
*** 1314,1320 ****
static bool
gate_reference (void)
{
! return (flag_unit_at_a_time != 0 && flag_ipa_reference
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
--- 1314,1320 ----
static bool
gate_reference (void)
{
! return (flag_ipa_reference
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
Index: toplev.c
===================================================================
*** toplev.c (revision 138005)
--- toplev.c (working copy)
*************** process_options (void)
*** 1707,1715 ****
if (flag_asynchronous_unwind_tables)
flag_unwind_tables = 1;
- if (!flag_unit_at_a_time)
- flag_section_anchors = 0;
-
if (flag_value_profile_transformations)
flag_profile_values = 1;
--- 1707,1712 ----
Index: cgraphunit.c
===================================================================
*** cgraphunit.c (revision 138005)
--- cgraphunit.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 45,51 ****
This function is called once (source level) compilation unit is finalized
and it will no longer change.
! In the unit-at-a-time the call-graph construction and local function
analysis takes place here. Bodies of unreachable functions are released
to conserve memory usage.
--- 45,51 ----
This function is called once (source level) compilation unit is finalized
and it will no longer change.
! In the the call-graph construction and local function
analysis takes place here. Bodies of unreachable functions are released
to conserve memory usage.
*************** along with GCC; see the file COPYING3.
*** 54,63 ****
- cgraph_optimize
! In this unit-at-a-time compilation the intra procedural analysis takes
! place here. In particular the static functions whose address is never
! taken are marked as local. Backend can then use this information to
! modify calling conventions, do better inlining or similar optimizations.
- cgraph_mark_needed_node
- varpool_mark_needed_node
--- 54,63 ----
- cgraph_optimize
! Inter procedural analysis takes place here. In particular the static
! functions whose address is never taken are marked as local. Backend can
! then use this information to modify calling conventions, do better
! inlining or similar optimizations.
- cgraph_mark_needed_node
- varpool_mark_needed_node
*************** along with GCC; see the file COPYING3.
*** 77,85 ****
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
! We implement two compilation modes.
!
! - unit-at-a-time: In this mode analyzing of all functions is deferred
to cgraph_finalize_compilation_unit and expansion into cgraph_optimize.
In cgraph_finalize_compilation_unit the reachable functions are
--- 77,83 ----
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
! Analyzing of all functions is deferred
to cgraph_finalize_compilation_unit and expansion into cgraph_optimize.
In cgraph_finalize_compilation_unit the reachable functions are
*************** along with GCC; see the file COPYING3.
*** 105,127 ****
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
! where reference has been optimized out.
!
! - non-unit-at-a-time
!
! All functions are variables are output as early as possible to conserve
! memory consumption. This may or may not result in less memory used but
! it is still needed for some legacy code that rely on particular ordering
! of things output from the compiler.
!
! Varpool data structures are not used and variables are output directly.
!
! Functions are output early using call of
! cgraph_assemble_pending_function from cgraph_finalize_function. The
! decision on whether function is needed is made more conservative so
! uninlinable static functions are needed too. During the call-graph
! construction the edge destinations are not marked as reachable and it
! is completely relied upon assemble_variable to mark them. */
#include "config.h"
--- 103,109 ----
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
! where reference has been optimized out. */
#include "config.h"
*************** cgraph_build_cdtor_fns (void)
*** 326,338 ****
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
! configury, or (if not doing unit-at-a-time) to something we haven't
! seen yet. */
static bool
decide_is_function_needed (struct cgraph_node *node, tree decl)
{
- tree origin;
if (MAIN_NAME_P (DECL_NAME (decl))
&& TREE_PUBLIC (decl))
{
--- 308,318 ----
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
! configury */
static bool
decide_is_function_needed (struct cgraph_node *node, tree decl)
{
if (MAIN_NAME_P (DECL_NAME (decl))
&& TREE_PUBLIC (decl))
{
*************** decide_is_function_needed (struct cgraph
*** 344,352 ****
if (node->local.externally_visible)
return true;
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
-
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
in assemble_name then. This is arguably a bug. */
--- 324,329 ----
*************** decide_is_function_needed (struct cgraph
*** 389,420 ****
if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
return true;
- if (flag_unit_at_a_time)
- return false;
-
- /* If not doing unit at a time, then we'll only defer this function
- if its marked for inlining. Otherwise we want to emit it now. */
-
- /* "extern inline" functions are never output locally. */
- if (DECL_EXTERNAL (decl))
- return false;
- /* Nested functions of extern inline function shall not be emit unless
- we inlined the origin. */
- for (origin = decl_function_context (decl); origin;
- origin = decl_function_context (origin))
- if (DECL_EXTERNAL (origin))
- return false;
- /* We want to emit COMDAT functions only when absolutely necessary. */
- if (DECL_COMDAT (decl))
- return false;
- if (!DECL_INLINE (decl)
- || (!node->local.disregard_inline_limits
- /* When declared inline, defer even the uninlinable functions.
- This allows them to be eliminated when unused. */
- && !DECL_DECLARED_INLINE_P (decl)
- && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL))))
- return true;
-
return false;
}
--- 366,371 ----
*************** cgraph_process_new_functions (void)
*** 487,525 ****
return output;
}
- /* When not doing unit-at-a-time, output all functions enqueued.
- Return true when such a functions were found. */
-
- static bool
- cgraph_assemble_pending_functions (void)
- {
- bool output = false;
-
- if (flag_unit_at_a_time || errorcount || sorrycount)
- return false;
-
- cgraph_output_pending_asms ();
-
- while (cgraph_nodes_queue)
- {
- struct cgraph_node *n = cgraph_nodes_queue;
-
- cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
- n->next_needed = NULL;
- if (!n->global.inlined_to
- && !n->alias
- && !DECL_EXTERNAL (n->decl))
- {
- cgraph_expand_function (n);
- output = true;
- }
- output |= cgraph_process_new_functions ();
- }
-
- return output;
- }
-
-
/* As an GCC extension we allow redefinition of the function. The
semantics when both copies of bodies differ is not well defined.
We replace the old body with new body so in unit at a time mode
--- 438,443 ----
*************** cgraph_assemble_pending_functions (void)
*** 533,544 ****
static void
cgraph_reset_node (struct cgraph_node *node)
{
! /* If node->output is set, then this is a unit-at-a-time compilation
! and we have already begun whole-unit analysis. This is *not*
! testing for whether we've already emitted the function. That
! case can be sort-of legitimately seen with real function
! redefinition errors. I would argue that the front end should
! never present us with such a case, but don't enforce that for now. */
gcc_assert (!node->output);
/* Reset our data structures so we can analyze the function again. */
--- 451,461 ----
static void
cgraph_reset_node (struct cgraph_node *node)
{
! /* If node->output is set, then we have already begun whole-unit analysis.
! This is *not* testing for whether we've already emitted the function.
! That case can be sort-of legitimately seen with real function redefinition
! errors. I would argue that the front end should never present us with
! such a case, but don't enforce that for now. */
gcc_assert (!node->output);
/* Reset our data structures so we can analyze the function again. */
*************** cgraph_reset_node (struct cgraph_node *n
*** 549,566 ****
node->local.redefined_extern_inline = true;
node->local.finalized = false;
- if (!flag_unit_at_a_time)
- {
- struct cgraph_node *n, *next;
-
- for (n = cgraph_nodes; n; n = next)
- {
- next = n->next;
- if (n->global.inlined_to == node)
- cgraph_remove_node (n);
- }
- }
-
cgraph_node_remove_callees (node);
/* We may need to re-queue the node for assembling in case
--- 466,471 ----
*************** cgraph_finalize_function (tree decl, boo
*** 609,619 ****
lower_nested_functions (decl);
gcc_assert (!node->nested);
- /* If not unit at a time, then we need to create the call graph
- now, so that called functions can be queued and emitted now. */
- if (!flag_unit_at_a_time)
- cgraph_analyze_function (node);
-
if (decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
--- 514,519 ----
*************** cgraph_finalize_function (tree decl, boo
*** 623,636 ****
if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)))
cgraph_mark_reachable_node (node);
- /* If not unit at a time, go ahead and emit everything we've found
- to be reachable at this time. */
- if (!nested)
- {
- if (!cgraph_assemble_pending_functions ())
- ggc_collect ();
- }
-
/* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl))
(*debug_hooks->deferred_inline_function) (decl);
--- 523,528 ----
*************** cgraph_finalize_function (tree decl, boo
*** 638,643 ****
--- 530,538 ----
/* Possibly warn about unused parameters. */
if (warn_unused_parameter)
do_warn_unused_parameter (decl);
+
+ if (!nested)
+ ggc_collect ();
}
/* C99 extern inline keywords allow changing of declaration after function
*************** cgraph_analyze_function (struct cgraph_n
*** 855,870 ****
cgraph_lower_function (node);
node->analyzed = true;
- if (!flag_unit_at_a_time && !sorrycount && !errorcount)
- {
- bitmap_obstack_initialize (NULL);
- tree_register_cfg_hooks ();
- execute_pass_list (pass_early_local_passes.pass.sub);
- free_dominance_info (CDI_POST_DOMINATORS);
- free_dominance_info (CDI_DOMINATORS);
- bitmap_obstack_release (NULL);
- }
-
pop_cfun ();
current_function_decl = NULL;
}
--- 750,755 ----
*************** cgraph_finalize_compilation_unit (void)
*** 1072,1085 ****
finish_aliases_1 ();
- if (!flag_unit_at_a_time)
- {
- cgraph_output_pending_asms ();
- cgraph_assemble_pending_functions ();
- varpool_output_debug_info ();
- return;
- }
-
if (!quiet_flag)
{
fprintf (stderr, "\nAnalyzing compilation unit\n");
--- 957,962 ----
*************** cgraph_expand_function (struct cgraph_no
*** 1147,1154 ****
/* We ought to not compile any inline clones. */
gcc_assert (!node->global.inlined_to);
! if (flag_unit_at_a_time)
! announce_function (decl);
gcc_assert (node->lowered);
--- 1024,1030 ----
/* We ought to not compile any inline clones. */
gcc_assert (!node->global.inlined_to);
! announce_function (decl);
gcc_assert (node->lowered);
*************** cgraph_optimize (void)
*** 1372,1387 ****
/* Call functions declared with the "constructor" or "destructor"
attribute. */
cgraph_build_cdtor_fns ();
- if (!flag_unit_at_a_time)
- {
- cgraph_assemble_pending_functions ();
- cgraph_process_new_functions ();
- cgraph_state = CGRAPH_STATE_FINISHED;
- cgraph_output_pending_asms ();
- varpool_assemble_pending_decls ();
- varpool_output_debug_info ();
- return;
- }
/* Frontend may output common variables after the unit has been finalized.
It is safe to deal with them here as they are always zero initialized. */
--- 1248,1253 ----
*************** cgraph_optimize (void)
*** 1453,1460 ****
verify_cgraph ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
! if (flag_unit_at_a_time
! && !(sorrycount || errorcount))
{
struct cgraph_node *node;
bool error_found = false;
--- 1319,1325 ----
verify_cgraph ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
! if (!(sorrycount || errorcount))
{
struct cgraph_node *node;
bool error_found = false;
*************** save_inline_function_body (struct cgraph
*** 1683,1711 ****
cgraph_lower_function (node);
! /* In non-unit-at-a-time we construct full fledged clone we never output to
! assembly file. This clone is pointed out by inline_decl of original function
! and inlining infrastructure knows how to deal with this. */
! if (!flag_unit_at_a_time)
! {
! struct cgraph_edge *e;
!
! first_clone = cgraph_clone_node (node, node->count, 0, CGRAPH_FREQ_BASE,
! false);
! first_clone->needed = 0;
! first_clone->reachable = 1;
! /* Recursively clone all bodies. */
! for (e = first_clone->callees; e; e = e->next_callee)
! if (!e->inline_failed)
! cgraph_clone_inlined_nodes (e, true, false);
! }
! else
! first_clone = node->next_clone;
first_clone->decl = copy_node (node->decl);
node->next_clone = NULL;
- if (!flag_unit_at_a_time)
- node->inline_decl = first_clone->decl;
first_clone->prev_clone = NULL;
cgraph_insert_node_to_hashtable (first_clone);
gcc_assert (first_clone == cgraph_node (first_clone->decl));
--- 1548,1557 ----
cgraph_lower_function (node);
! first_clone = node->next_clone;
first_clone->decl = copy_node (node->decl);
node->next_clone = NULL;
first_clone->prev_clone = NULL;
cgraph_insert_node_to_hashtable (first_clone);
gcc_assert (first_clone == cgraph_node (first_clone->decl));
Index: testsuite/gcc.dg/winline-4.c
===================================================================
*** testsuite/gcc.dg/winline-4.c (revision 138005)
--- testsuite/gcc.dg/winline-4.c (working copy)
***************
*** 1,11 ****
- /* { dg-do compile } */
- /* { dg-options "-Winline -O1 -fno-unit-at-a-time" } */
-
- inline int q(void); /* { dg-warning "body not available" } */
- inline int t(void)
- {
- return q(); /* { dg-warning "called from here" } */
- }
- int q(void)
- {
- }
--- 0 ----
Index: testsuite/gcc.dg/pch/valid-3.hs
===================================================================
*** testsuite/gcc.dg/pch/valid-3.hs (revision 138005)
--- testsuite/gcc.dg/pch/valid-3.hs (working copy)
***************
*** 1,3 ****
- /* { dg-options "-I. -Winvalid-pch -funit-at-a-time" } */
-
- extern int x;
--- 0 ----
Index: testsuite/gcc.dg/pch/valid-3.c
===================================================================
*** testsuite/gcc.dg/pch/valid-3.c (revision 138005)
--- testsuite/gcc.dg/pch/valid-3.c (working copy)
***************
*** 1,6 ****
- /* { dg-options "-I. -Winvalid-pch -fno-unit-at-a-time" } */
-
- #include "valid-3.h"/* { dg-warning "settings for -funit-at-a-time do not match" } */
- /* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
- /* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
- int x;
--- 0 ----
Index: testsuite/g++.old-deja/g++.brendan/crash52.C
===================================================================
*** testsuite/g++.old-deja/g++.brendan/crash52.C (revision 138005)
--- testsuite/g++.old-deja/g++.brendan/crash52.C (working copy)
*************** public:
*** 10,13 ****
A &f(A &a) {// { dg-error "" } new decl.*
std::cout << "Blah\n";
! }
--- 10,13 ----
A &f(A &a) {// { dg-error "" } new decl.*
std::cout << "Blah\n";
! } // { dg-error "no return statement" }
Index: testsuite/g++.old-deja/g++.jason/report.C
===================================================================
*** testsuite/g++.old-deja/g++.jason/report.C (revision 138005)
--- testsuite/g++.old-deja/g++.jason/report.C (working copy)
*************** bar2 baz (X::Y y) // { dg-error
*** 56,62 ****
bar2 wa [5];
wa[0] = baz(f);
undef2 (1); // { dg-error "" } implicit declaration
! }
int ninny ()
{
--- 56,62 ----
bar2 wa [5];
wa[0] = baz(f);
undef2 (1); // { dg-error "" } implicit declaration
! } // { dg-error "no return statement" }
int ninny ()
{
*************** int ninny ()
*** 71,74 ****
int darg (char X::*p)
{
undef3 (1); // { dg-error "" } implicit declaration
! }
--- 71,74 ----
int darg (char X::*p)
{
undef3 (1); // { dg-error "" } implicit declaration
! } // { dg-error "no return statement" }
Index: testsuite/g++.dg/warn/pr23075.C
===================================================================
*** testsuite/g++.dg/warn/pr23075.C (revision 138005)
--- testsuite/g++.dg/warn/pr23075.C (working copy)
*************** int
*** 6,9 ****
foo (void)
{
return; // { dg-error "with no value" }
! } // { dg-bogus "control reaches end" }
--- 6,9 ----
foo (void)
{
return; // { dg-error "with no value" }
! } // { dg-bogus "no return statement" }
Index: cp/decl.c
===================================================================
*** cp/decl.c (revision 138005)
--- cp/decl.c (working copy)
*************** duplicate_decls (tree newdecl, tree oldd
*** 1948,1955 ****
}
else if (new_defines_function && DECL_INITIAL (olddecl))
{
! /* C++ is always in in unit-at-a-time mode, so we never
! inline re-defined extern inline functions. */
DECL_INLINE (newdecl) = 0;
DECL_UNINLINABLE (newdecl) = 1;
}
--- 1948,1956 ----
}
else if (new_defines_function && DECL_INITIAL (olddecl))
{
! /* Never inline re-defined extern inline functions.
! FIXME: this could be better handled by keeping both
! function as separate declarations. */
DECL_INLINE (newdecl) = 0;
DECL_UNINLINABLE (newdecl) = 1;
}
*************** grokfndecl (tree ctype,
*** 6606,6612 ****
/* We inline functions that are explicitly declared inline, or, when
the user explicitly asks us to, all functions. */
if (DECL_DECLARED_INLINE_P (decl)
! || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag))
DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
--- 6607,6613 ----
/* We inline functions that are explicitly declared inline, or, when
the user explicitly asks us to, all functions. */
if (DECL_DECLARED_INLINE_P (decl)
! || (!DECL_INLINE (decl) && funcdef_flag))
DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
Index: cp/pt.c
===================================================================
*** cp/pt.c (revision 138005)
--- cp/pt.c (working copy)
*************** instantiate_decl (tree d, int defer_ok,
*** 15226,15232 ****
job, even though we'll not be emitting a copy of this
function. */
if (!(TREE_CODE (d) == FUNCTION_DECL
- && flag_inline_trees
&& DECL_DECLARED_INLINE_P (d)))
goto out;
}
--- 15226,15231 ----
Index: cp/lex.c
===================================================================
*** cp/lex.c (revision 138005)
--- cp/lex.c (working copy)
*************** cxx_init (void)
*** 247,263 ****
cxx_init_decl_processing ();
- /* The fact that G++ uses COMDAT for many entities (inline
- functions, template instantiations, virtual tables, etc.) mean
- that it is fundamentally unreliable to try to make decisions
- about whether or not to output a particular entity until the end
- of the compilation. However, the inliner requires that functions
- be provided to the back end if they are to be inlined.
- Therefore, we always use unit-at-a-time mode; in that mode, we
- can provide entities to the back end and it will decide what to
- emit based on what is actually needed. */
- flag_unit_at_a_time = 1;
-
if (c_common_init () == false)
{
input_location = saved_loc;
--- 247,252 ----
Index: ipa-pure-const.c
===================================================================
*** ipa-pure-const.c (revision 138005)
--- ipa-pure-const.c (working copy)
*************** static_execute (void)
*** 771,777 ****
static bool
gate_pure_const (void)
{
! return (flag_unit_at_a_time != 0 && flag_ipa_pure_const
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
--- 771,777 ----
static bool
gate_pure_const (void)
{
! return (flag_ipa_pure_const
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
Index: tree-ssa-alias.c
===================================================================
*** tree-ssa-alias.c (revision 138005)
--- tree-ssa-alias.c (working copy)
*************** may_be_aliased (tree var)
*** 3714,3730 ****
if (!TREE_STATIC (var))
return false;
! /* If we're in unit-at-a-time mode, then we must have seen all
! occurrences of address-of operators, and so we can trust
! TREE_ADDRESSABLE. Otherwise we can only be sure the variable
! isn't addressable if it's local to the current function. */
! if (flag_unit_at_a_time)
! return false;
!
! if (decl_function_context (var) == current_function_decl)
! return false;
!
! return true;
}
/* The following is based on code in add_stmt_operand to ensure that the
--- 3714,3720 ----
if (!TREE_STATIC (var))
return false;
! return false;
}
/* The following is based on code in add_stmt_operand to ensure that the
Index: ipa-inline.c
===================================================================
*** ipa-inline.c (revision 138005)
--- ipa-inline.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 60,66 ****
cgraph_decide_inlining implements heuristics taking whole callgraph
into account, while cgraph_decide_inlining_incrementally considers
! only one function at a time and is used in non-unit-at-a-time mode.
The inliner itself is split into several passes:
--- 60,66 ----
cgraph_decide_inlining implements heuristics taking whole callgraph
into account, while cgraph_decide_inlining_incrementally considers
! only one function at a time and is used by early inliner.
The inliner itself is split into several passes:
*************** along with GCC; see the file COPYING3.
*** 82,96 ****
to do inlining expanding code size it might result in unbounded growth of
whole unit.
! This is the main inlining pass in non-unit-at-a-time.
!
! With unit-at-a-time the pass is run during conversion into SSA form.
! Only functions already converted into SSA form are inlined, so the
! conversion must happen in topological order on the callgraph (that is
! maintained by pass manager). The functions after inlining are early
! optimized so the early inliner sees unoptimized function itself, but
! all considered callees are already optimized allowing it to unfold
! abstraction penalty on C++ effectively and cheaply.
pass_ipa_early_inlining
--- 82,94 ----
to do inlining expanding code size it might result in unbounded growth of
whole unit.
! The pass is run during conversion into SSA form. Only functions already
! converted into SSA form are inlined, so the conversion must happen in
! topological order on the callgraph (that is maintained by pass manager).
! The functions after inlining are early optimized so the early inliner sees
! unoptimized function itself, but all considered callees are already
! optimized allowing it to unfold abstraction penalty on C++ effectively and
! cheaply.
pass_ipa_early_inlining
*************** along with GCC; see the file COPYING3.
*** 149,164 ****
In SIZE mode, only functions that reduce function body size after inlining
are inlined, this is used during early inlining.
- In SPEED mode, all small functions are inlined. This might result in
- unbounded growth of compilation unit and is used only in non-unit-at-a-time
- mode.
-
in ALL mode, everything is inlined. This is used during flattening. */
enum inlining_mode {
INLINE_NONE = 0,
INLINE_ALWAYS_INLINE,
INLINE_SIZE,
- INLINE_SPEED,
INLINE_ALL
};
static bool
--- 147,157 ----
*************** cgraph_clone_inlined_nodes (struct cgrap
*** 210,217 ****
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
&& !e->callee->needed
! && !cgraph_new_nodes
! && flag_unit_at_a_time)
{
gcc_assert (!e->callee->global.inlined_to);
if (DECL_SAVED_TREE (e->callee->decl))
--- 203,209 ----
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
&& !e->callee->needed
! && !cgraph_new_nodes)
{
gcc_assert (!e->callee->global.inlined_to);
if (DECL_SAVED_TREE (e->callee->decl))
*************** cgraph_mark_inline_edge (struct cgraph_e
*** 261,267 ****
gcc_assert (e->inline_failed);
e->inline_failed = NULL;
! if (!e->callee->global.inlined && flag_unit_at_a_time)
DECL_POSSIBLY_INLINED (e->callee->decl) = true;
e->callee->global.inlined = true;
--- 253,259 ----
gcc_assert (e->inline_failed);
e->inline_failed = NULL;
! if (!e->callee->global.inlined)
DECL_POSSIBLY_INLINED (e->callee->decl) = true;
e->callee->global.inlined = true;
*************** try_inline (struct cgraph_edge *e, enum
*** 1246,1258 ****
if (e->inline_failed)
cgraph_mark_inline (e);
! /* In order to fully inline always_inline functions at -O0, we need to
recurse here, since the inlined functions might not be processed by
incremental inlining at all yet.
Also flattening needs to be done recursively. */
! if (!flag_unit_at_a_time || mode == INLINE_ALL || always_inline)
cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1);
callee->aux = (void *)(size_t) callee_mode;
return true;
--- 1238,1250 ----
if (e->inline_failed)
cgraph_mark_inline (e);
! /* In order to fully inline always_inline functions, we need to
recurse here, since the inlined functions might not be processed by
incremental inlining at all yet.
Also flattening needs to be done recursively. */
! if (mode == INLINE_ALL || always_inline)
cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1);
callee->aux = (void *)(size_t) callee_mode;
return true;
*************** cgraph_decide_inlining_incrementally (st
*** 1420,1439 ****
}
if (cgraph_default_inline_p (e->callee, &failed_reason))
inlined |= try_inline (e, mode, depth);
- else if (!flag_unit_at_a_time)
- e->inline_failed = failed_reason;
}
node->aux = (void *)(size_t) old_mode;
return inlined;
}
- /* When inlining shall be performed. */
- static bool
- cgraph_gate_inlining (void)
- {
- return flag_inline_trees;
- }
-
/* Because inlining might remove no-longer reachable nodes, we need to
keep the array visible to garbage collector to avoid reading collected
out nodes. */
--- 1412,1422 ----
*************** cgraph_early_inlining (void)
*** 1451,1459 ****
if (sorrycount || errorcount)
return 0;
! if (cgraph_decide_inlining_incrementally (node,
! flag_unit_at_a_time || optimize_size
! ? INLINE_SIZE : INLINE_SPEED, 0))
{
timevar_push (TV_INTEGRATION);
todo = optimize_inline_calls (current_function_decl);
--- 1434,1440 ----
if (sorrycount || errorcount)
return 0;
! if (cgraph_decide_inlining_incrementally (node, INLINE_SIZE, 0))
{
timevar_push (TV_INTEGRATION);
todo = optimize_inline_calls (current_function_decl);
*************** cgraph_early_inlining (void)
*** 1466,1472 ****
static bool
cgraph_gate_early_inlining (void)
{
! return flag_inline_trees && flag_early_inlining;
}
struct gimple_opt_pass pass_early_inline =
--- 1447,1453 ----
static bool
cgraph_gate_early_inlining (void)
{
! return flag_early_inlining;
}
struct gimple_opt_pass pass_early_inline =
*************** struct gimple_opt_pass pass_early_inline
*** 1492,1498 ****
static bool
cgraph_gate_ipa_early_inlining (void)
{
! return (flag_inline_trees && flag_early_inlining
&& (flag_branch_probabilities || flag_test_coverage
|| profile_arc_flag));
}
--- 1473,1479 ----
static bool
cgraph_gate_ipa_early_inlining (void)
{
! return (flag_early_inlining
&& (flag_branch_probabilities || flag_test_coverage
|| profile_arc_flag));
}
*************** compute_inline_parameters_for_current (v
*** 1551,1569 ****
return 0;
}
- /* When inlining shall be performed. */
- static bool
- gate_inline_passes (void)
- {
- return flag_inline_trees;
- }
-
struct gimple_opt_pass pass_inline_parameters =
{
{
GIMPLE_PASS,
NULL, /* name */
! gate_inline_passes, /* gate */
compute_inline_parameters_for_current,/* execute */
NULL, /* sub */
NULL, /* next */
--- 1532,1543 ----
return 0;
}
struct gimple_opt_pass pass_inline_parameters =
{
{
GIMPLE_PASS,
NULL, /* name */
! NULL, /* gate */
compute_inline_parameters_for_current,/* execute */
NULL, /* sub */
NULL, /* next */
*************** struct ipa_opt_pass pass_ipa_inline =
*** 1635,1641 ****
{
IPA_PASS,
"inline", /* name */
! cgraph_gate_inlining, /* gate */
cgraph_decide_inlining, /* execute */
NULL, /* sub */
NULL, /* next */
--- 1609,1615 ----
{
IPA_PASS,
"inline", /* name */
! NULL, /* gate */
cgraph_decide_inlining, /* execute */
NULL, /* sub */
NULL, /* next */
*************** struct ipa_opt_pass pass_ipa_inline =
*** 1658,1719 ****
};
- /* When inlining shall be performed. */
- static bool
- cgraph_gate_O0_always_inline (void)
- {
- return !flag_unit_at_a_time || !flag_inline_trees;
- }
-
- static unsigned int
- cgraph_O0_always_inline (void)
- {
- struct cgraph_node *node = cgraph_node (current_function_decl);
- unsigned int todo = 0;
- bool inlined;
-
- if (sorrycount || errorcount)
- return 0;
- inlined = cgraph_decide_inlining_incrementally (node, INLINE_SPEED, 0);
- /* We might need the body of this function so that we can expand
- it inline somewhere else. */
- if (cgraph_preserve_function_body_p (current_function_decl))
- save_inline_function_body (node);
- if (inlined || warn_inline)
- {
- timevar_push (TV_INTEGRATION);
- todo = optimize_inline_calls (current_function_decl);
- timevar_pop (TV_INTEGRATION);
- }
- /* In non-unit-at-a-time we must mark all referenced functions as needed. */
- if (!flag_unit_at_a_time)
- {
- struct cgraph_edge *e;
- for (e = node->callees; e; e = e->next_callee)
- if (e->callee->analyzed)
- cgraph_mark_needed_node (e->callee);
- }
- return todo | execute_fixup_cfg ();
- }
-
- struct gimple_opt_pass pass_O0_always_inline =
- {
- {
- GIMPLE_PASS,
- "always_inline", /* name */
- cgraph_gate_O0_always_inline, /* gate */
- cgraph_O0_always_inline, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_INLINE_HEURISTICS, /* tv_id */
- 0, /* properties_required */
- PROP_cfg, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
- };
-
#include "gt-ipa-inline.h"
--- 1632,1635 ----
Index: c-pch.c
===================================================================
*** c-pch.c (revision 138005)
--- c-pch.c (working copy)
*************** static const struct c_pch_matching
*** 45,51 ****
const char *flag_name;
} pch_matching[] = {
{ &flag_exceptions, "-fexceptions" },
- { &flag_unit_at_a_time, "-funit-at-a-time" }
};
enum {
--- 45,50 ----
Index: dwarf2out.c
===================================================================
*** dwarf2out.c (revision 138005)
--- dwarf2out.c (working copy)
*************** reference_to_unused (tree * tp, int * wa
*** 10448,10455 ****
if (DECL_P (*tp) && ! TREE_PUBLIC (*tp) && ! TREE_USED (*tp)
&& ! TREE_ASM_WRITTEN (*tp))
return *tp;
- else if (!flag_unit_at_a_time)
- return NULL_TREE;
/* ??? The C++ FE emits debug information for using decls, so
putting gcc_unreachable here falls over. See PR31899. For now
be conservative. */
--- 10448,10453 ----
Index: opts.c
===================================================================
*** opts.c (revision 138009)
--- opts.c (working copy)
*************** bool use_gnu_debug_info_extensions;
*** 333,343 ****
/* The default visibility for all symbols (unless overridden) */
enum symbol_visibility default_visibility = VISIBILITY_DEFAULT;
- /* Disable unit-at-a-time for frontends that might be still broken in this
- respect. */
-
- bool no_unit_at_a_time_default;
-
/* Global visibility options. */
struct visibility_flags visibility_options;
--- 333,338 ----
*************** decode_options (unsigned int argc, const
*** 848,860 ****
}
}
}
!
!
if (!flag_unit_at_a_time)
{
flag_section_anchors = 0;
flag_toplevel_reorder = 0;
- flag_unit_at_a_time = 1;
}
if (!flag_toplevel_reorder)
{
--- 843,853 ----
}
}
}
!
if (!flag_unit_at_a_time)
{
flag_section_anchors = 0;
flag_toplevel_reorder = 0;
}
if (!flag_toplevel_reorder)
{
*************** decode_options (unsigned int argc, const
*** 1047,1062 ****
if (flag_really_no_inline == 2)
flag_really_no_inline = flag_no_inline;
- /* Inlining of functions called just once will only work if we can look
- at the complete translation unit. */
- if (flag_inline_functions_called_once && !flag_unit_at_a_time)
- {
- flag_inline_functions_called_once = 0;
- warning (OPT_Wdisabled_optimization,
- "-funit-at-a-time is required for inlining of functions "
- "that are only called once");
- }
-
/* The optimization to partition hot and cold basic blocks into separate
sections of the .o and executable files does not work (currently)
with exception handling. This is because there is no support for
--- 1040,1045 ----
Index: opts.h
===================================================================
*** opts.h (revision 138005)
--- opts.h (working copy)
*************** extern const struct cl_option cl_options
*** 64,70 ****
extern const unsigned int cl_options_count;
extern const char *const lang_names[];
extern const unsigned int cl_lang_count;
- extern bool no_unit_at_a_time_default;
#define CL_PARAMS (1 << 18) /* Fake entry. Used to display --param info with --help. */
#define CL_WARNING (1 << 19) /* Enables an (optional) warning message. */
--- 64,69 ----
Index: ada/utils.c
===================================================================
*** ada/utils.c (revision 138005)
--- ada/utils.c (working copy)
*************** end_subprog_body (tree body)
*** 2217,2224 ****
/* Deal with inline. If declared inline or we should default to inline,
set the flag in the decl. */
! DECL_INLINE (fndecl)
! = DECL_DECLARED_INLINE_P (fndecl) || flag_inline_trees == 2;
/* We handle pending sizes via the elaboration of types, so we don't
need to save them. */
--- 2217,2223 ----
/* Deal with inline. If declared inline or we should default to inline,
set the flag in the decl. */
! DECL_INLINE (fndecl) = 1;
/* We handle pending sizes via the elaboration of types, so we don't
need to save them. */
Index: ada/misc.c
===================================================================
*** ada/misc.c (revision 138005)
--- ada/misc.c (working copy)
*************** gnat_post_options (const char **pfilenam
*** 340,351 ****
/* ??? The warning machinery is outsmarted by Ada. */
warn_unused_parameter = 0;
- flag_inline_trees = 1;
-
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* Force eliminate_unused_debug_types to 0 unless an explicit positive
-f has been passed. This forces the default to 0 for Ada, which might
--- 340,347 ----
Index: c-decl.c
===================================================================
*** c-decl.c (revision 138005)
--- c-decl.c (working copy)
*************** diagnose_mismatched_decls (tree newdecl,
*** 1515,1544 ****
"noinline follows inline declaration ", newdecl);
warned = true;
}
-
- /* Inline declaration after use or definition.
- ??? Should we still warn about this now we have unit-at-a-time
- mode and can get it right?
- Definitely don't complain if the decls are in different translation
- units.
- C99 permits this, so don't warn in that case. (The function
- may not be inlined everywhere in function-at-a-time mode, but
- we still shouldn't warn.) */
- if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl)
- && same_translation_unit_p (olddecl, newdecl)
- && flag_gnu89_inline)
- {
- if (TREE_USED (olddecl))
- {
- warning (0, "%q+D declared inline after being called", olddecl);
- warned = true;
- }
- else if (DECL_INITIAL (olddecl))
- {
- warning (0, "%q+D declared inline after its definition", olddecl);
- warned = true;
- }
- }
}
else /* PARM_DECL, VAR_DECL */
{
--- 1515,1520 ----
*************** merge_decls (tree newdecl, tree olddecl,
*** 1807,1815 ****
if (new_is_definition && DECL_INITIAL (olddecl))
{
if (TREE_USED (olddecl)
! /* In unit-at-a-time mode we never inline re-defined extern
! inline functions. */
! && !flag_unit_at_a_time
&& cgraph_function_possibly_inlined_p (olddecl))
(*debug_hooks->outlining_inline_function) (olddecl);
--- 1783,1791 ----
if (new_is_definition && DECL_INITIAL (olddecl))
{
if (TREE_USED (olddecl)
! /* We never inline re-defined extern inline functions.
! FIXME: This would be better handled by keeping both functions
! as separate declarations. */
&& cgraph_function_possibly_inlined_p (olddecl))
(*debug_hooks->outlining_inline_function) (olddecl);
*************** finish_decl (tree decl, tree init, tree
*** 3612,3621 ****
}
}
- /* If this was marked 'used', be sure it will be output. */
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- mark_decl_referenced (decl);
-
if (TREE_CODE (decl) == TYPE_DECL)
{
if (!DECL_FILE_SCOPE_P (decl)
--- 3588,3593 ----
*************** grokdeclarator (const struct c_declarato
*** 4874,4883 ****
if (initialized)
DECL_INLINE (decl) = 1;
}
! /* If -finline-functions, assume it can be inlined. This does
! two things: let the function be deferred until it is actually
! needed, and let dwarf2 know that the function is inlinable. */
! else if (flag_inline_trees == 2 && initialized)
DECL_INLINE (decl) = 1;
}
else
--- 4846,4852 ----
if (initialized)
DECL_INLINE (decl) = 1;
}
! else if (initialized)
DECL_INLINE (decl) = 1;
}
else
*************** finish_function (void)
*** 6752,6760 ****
&& !MAIN_NAME_P (DECL_NAME (fndecl))
/* Or if they didn't actually specify a return type. */
&& !C_FUNCTION_IMPLICIT_INT (fndecl)
! /* Normally, with -Wreturn-type, flow will complain. Unless we're an
! inline function, as we might never be compiled separately. */
! && DECL_INLINE (fndecl))
{
warning (OPT_Wreturn_type,
"no return statement in function returning non-void");
--- 6721,6729 ----
&& !MAIN_NAME_P (DECL_NAME (fndecl))
/* Or if they didn't actually specify a return type. */
&& !C_FUNCTION_IMPLICIT_INT (fndecl)
! /* Normally, with -Wreturn-type, flow will complain, but we might
! optimize out static functions. */
! && !TREE_PUBLIC (fndecl))
{
warning (OPT_Wreturn_type,
"no return statement in function returning non-void");
Index: fortran/options.c
===================================================================
*** fortran/options.c (revision 138005)
--- fortran/options.c (working copy)
*************** gfc_post_options (const char **pfilename
*** 292,304 ****
gfc_warning_now ("'-fd-lines-as-code' has no effect in free form");
}
- flag_inline_trees = 1;
-
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* If -pedantic, warn about the use of GNU extensions. */
if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0)
--- 292,300 ----
Index: ipa-type-escape.c
===================================================================
*** ipa-type-escape.c (revision 138005)
--- ipa-type-escape.c (working copy)
*************** type_escape_execute (void)
*** 2192,2198 ****
static bool
gate_type_escape_vars (void)
{
! return (flag_unit_at_a_time != 0 && flag_ipa_type_escape
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
--- 2192,2198 ----
static bool
gate_type_escape_vars (void)
{
! return (flag_ipa_type_escape
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
Index: cfgexpand.c
===================================================================
*** cfgexpand.c (revision 138005)
--- cfgexpand.c (working copy)
*************** expand_one_stack_var (tree var)
*** 617,644 ****
expand_one_stack_var_at (var, offset);
}
- /* A subroutine of expand_one_var. Called to assign rtl
- to a TREE_STATIC VAR_DECL. */
-
- static void
- expand_one_static_var (tree var)
- {
- /* In unit-at-a-time all the static variables are expanded at the end
- of compilation process. */
- if (flag_unit_at_a_time)
- return;
- /* If this is an inlined copy of a static local variable,
- look up the original. */
- var = DECL_ORIGIN (var);
-
- /* If we've already processed this variable because of that, do nothing. */
- if (TREE_ASM_WRITTEN (var))
- return;
-
- /* Otherwise, just emit the variable. */
- rest_of_decl_compilation (var, 0, 0);
- }
-
/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL
that will reside in a hard register. */
--- 617,622 ----
*************** expand_one_var (tree var, bool toplevel,
*** 742,751 ****
else if (DECL_HAS_VALUE_EXPR_P (var))
;
else if (TREE_STATIC (var))
! {
! if (really_expand)
! expand_one_static_var (var);
! }
else if (DECL_RTL_SET_P (var))
;
else if (TREE_TYPE (var) == error_mark_node)
--- 720,726 ----
else if (DECL_HAS_VALUE_EXPR_P (var))
;
else if (TREE_STATIC (var))
! ;
else if (DECL_RTL_SET_P (var))
;
else if (TREE_TYPE (var) == error_mark_node)
*************** expand_used_vars_for_block (tree block,
*** 790,801 ****
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
! if (TREE_USED (t)
! /* Force local static variables to be output when marked by
! used attribute. For unit-at-a-time, cgraph code already takes
! care of this. */
! || (!flag_unit_at_a_time && TREE_STATIC (t)
! && DECL_PRESERVE_P (t)))
expand_one_var (t, toplevel, true);
this_sv_num = stack_vars_num;
--- 765,771 ----
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
! if (TREE_USED (t))
expand_one_var (t, toplevel, true);
this_sv_num = stack_vars_num;
Index: c-opts.c
===================================================================
*** c-opts.c (revision 138005)
--- c-opts.c (working copy)
*************** c_common_post_options (const char **pfil
*** 1018,1030 ****
C_COMMON_OVERRIDE_OPTIONS;
#endif
- flag_inline_trees = 1;
-
/* Use tree inlining. */
if (!flag_no_inline)
flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
/* By default we use C99 inline semantics in GNU99 or C99 mode. C99
inline semantics are not supported in GNU89 or C89 mode. */
--- 1018,1026 ----
*************** c_common_post_options (const char **pfil
*** 1033,1046 ****
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
- /* If we are given more than one input file, we must use
- unit-at-a-time mode. */
- if (num_in_fnames > 1)
- flag_unit_at_a_time = 1;
-
- if (pch_file && !flag_unit_at_a_time)
- sorry ("Precompiled headers require -funit-at-a-time");
-
/* Default to ObjC sjlj exception handling if NeXT runtime. */
if (flag_objc_sjlj_exceptions < 0)
flag_objc_sjlj_exceptions = flag_next_runtime;
--- 1029,1034 ----
*************** c_common_post_options (const char **pfil
*** 1091,1102 ****
if (c_dialect_cxx ())
{
if (!flag_no_inline)
! {
! flag_inline_trees = 1;
! flag_no_inline = 1;
! }
! if (flag_inline_functions)
! flag_inline_trees = 2;
}
/* In C, -Wconversion enables -Wsign-conversion (unless disabled
--- 1079,1085 ----
if (c_dialect_cxx ())
{
if (!flag_no_inline)
! flag_no_inline = 1;
}
/* In C, -Wconversion enables -Wsign-conversion (unless disabled
Index: varasm.c
===================================================================
*** varasm.c (revision 138005)
--- varasm.c (working copy)
*************** contains_pointers_p (tree type)
*** 2228,2234 ****
}
}
! /* In unit-at-a-time mode, we delay assemble_external processing until
the compilation unit is finalized. This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final. See PR 17982 for further discussion. */
--- 2228,2234 ----
}
}
! /* We delay assemble_external processing until
the compilation unit is finalized. This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final. See PR 17982 for further discussion. */
*************** assemble_alias (tree decl, tree target)
*** 5380,5386 ****
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
! if (!flag_unit_at_a_time || cgraph_global_info_ready)
target_decl = find_decl_and_mark_needed (decl, target);
else
target_decl= NULL;
--- 5380,5386 ----
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
! if (cgraph_global_info_ready)
target_decl = find_decl_and_mark_needed (decl, target);
else
target_decl= NULL;
Index: tree-inline.c
===================================================================
*** tree-inline.c (revision 138005)
--- tree-inline.c (working copy)
*************** along with GCC; see the file COPYING3.
*** 90,102 ****
See the CALL_EXPR handling case in copy_body_r (). */
- /* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
- int flag_inline_trees = 0;
-
/* To Do:
o In order to make inlining-on-trees work, we pessimized
--- 90,95 ----
*************** inlinable_function_p (tree fn)
*** 2099,2122 ****
if (!DECL_SAVED_TREE (fn))
return false;
- /* If we're not inlining at all, then we cannot inline this function. */
- else if (!flag_inline_trees)
- inlinable = false;
-
- /* Only try to inline functions if DECL_INLINE is set. This should be
- true for all functions declared `inline', and for all other functions
- as well with -finline-functions.
-
- Don't think of disregarding DECL_INLINE when flag_inline_trees == 2;
- it's the front-end that must set DECL_INLINE in this case, because
- dwarf2out loses if a function that does not have DECL_INLINE set is
- inlined anyway. That is why we have both DECL_INLINE and
- DECL_DECLARED_INLINE_P. */
- /* FIXME: When flag_inline_trees dies, the check for flag_unit_at_a_time
- here should be redundant. */
- else if (!DECL_INLINE (fn) && !flag_unit_at_a_time)
- inlinable = false;
-
else if (inline_forbidden_p (fn))
{
/* See if we should warn about uninlinable functions. Previously,
--- 2092,2097 ----
*************** expand_call_inline (basic_block bb, tree
*** 2655,2661 ****
where previous inlining turned indirect call into direct call by
constant propagating arguments. In all other cases we hit a bug
(incorrect node sharing is most common reason for missing edges. */
! gcc_assert (dest->needed || !flag_unit_at_a_time);
cgraph_create_edge (id->dst_node, dest, stmt,
bb->count, CGRAPH_FREQ_BASE,
bb->loop_depth)->inline_failed
--- 2630,2636 ----
where previous inlining turned indirect call into direct call by
constant propagating arguments. In all other cases we hit a bug
(incorrect node sharing is most common reason for missing edges. */
! gcc_assert (dest->needed);
cgraph_create_edge (id->dst_node, dest, stmt,
bb->count, CGRAPH_FREQ_BASE,
bb->loop_depth)->inline_failed
*************** expand_call_inline (basic_block bb, tree
*** 2674,2680 ****
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
! && (!flag_unit_at_a_time || cgraph_global_info_ready))
{
sorry ("inlining failed in call to %q+F: %s", fn, reason);
sorry ("called from here");
--- 2649,2655 ----
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
! && cgraph_global_info_ready)
{
sorry ("inlining failed in call to %q+F: %s", fn, reason);
sorry ("called from here");
*************** expand_call_inline (basic_block bb, tree
*** 2684,2690 ****
&& strlen (reason)
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
! && (!flag_unit_at_a_time || cgraph_global_info_ready))
{
warning (OPT_Winline, "inlining failed in call to %q+F: %s",
fn, reason);
--- 2659,2665 ----
&& strlen (reason)
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
! && cgraph_global_info_ready)
{
warning (OPT_Winline, "inlining failed in call to %q+F: %s",
fn, reason);
Index: tree-inline.h
===================================================================
*** tree-inline.h (revision 138005)
--- tree-inline.h (working copy)
*************** extern tree remap_type (tree type, copy_
*** 156,166 ****
extern HOST_WIDE_INT estimated_stack_frame_size (void);
- /* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
- extern int flag_inline_trees;
-
#endif /* GCC_TREE_INLINE_H */
--- 156,159 ----
Index: tree-optimize.c
===================================================================
*** tree-optimize.c (revision 138010)
--- tree-optimize.c (working copy)
*************** execute_early_local_optimizations (void)
*** 115,121 ****
cgraph state so newly inserted functions are also early optimized.
However we execute early local optimizations for lately inserted
functions, in that case don't reset cgraph state back to IPA_SSA. */
! if (flag_unit_at_a_time && cgraph_state < CGRAPH_STATE_IPA_SSA)
cgraph_state = CGRAPH_STATE_IPA_SSA;
return 0;
}
--- 115,121 ----
cgraph state so newly inserted functions are also early optimized.
However we execute early local optimizations for lately inserted
functions, in that case don't reset cgraph state back to IPA_SSA. */
! if (cgraph_state < CGRAPH_STATE_IPA_SSA)
cgraph_state = CGRAPH_STATE_IPA_SSA;
return 0;
}
*************** tree_rest_of_compilation (tree fndecl)
*** 391,397 ****
timevar_push (TV_EXPAND);
! gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
node = cgraph_node (fndecl);
--- 391,397 ----
timevar_push (TV_EXPAND);
! gcc_assert (cgraph_global_info_ready);
node = cgraph_node (fndecl);
*************** tree_rest_of_compilation (tree fndecl)
*** 448,467 ****
}
}
! if (!flag_inline_trees)
{
! DECL_SAVED_TREE (fndecl) = NULL;
! if (DECL_STRUCT_FUNCTION (fndecl) == 0
! && !cgraph_node (fndecl)->origin)
! {
! /* Stop pointing to the local nodes about to be freed.
! But DECL_INITIAL must remain nonzero so we know this
! was an actual function definition.
! For a nested function, this is done in c_pop_function_context.
! If rest_of_compilation set this to 0, leave it 0. */
! if (DECL_INITIAL (fndecl) != 0)
! DECL_INITIAL (fndecl) = error_mark_node;
! }
}
input_location = saved_loc;
--- 448,464 ----
}
}
! DECL_SAVED_TREE (fndecl) = NULL;
! if (DECL_STRUCT_FUNCTION (fndecl) == 0
! && !cgraph_node (fndecl)->origin)
{
! /* Stop pointing to the local nodes about to be freed.
! But DECL_INITIAL must remain nonzero so we know this
! was an actual function definition.
! For a nested function, this is done in c_pop_function_context.
! If rest_of_compilation set this to 0, leave it 0. */
! if (DECL_INITIAL (fndecl) != 0)
! DECL_INITIAL (fndecl) = error_mark_node;
}
input_location = saved_loc;
Index: combine.c
===================================================================
*** combine.c (revision 138005)
--- combine.c (working copy)
*************** setup_incoming_promotions (rtx first)
*** 1340,1347 ****
function lie within the current compilation unit. (This does
take into account the exporting of a function via taking its
address, and so forth.) */
! if (flag_unit_at_a_time)
! strictly_local = cgraph_local_info (current_function_decl)->local;
/* The mode and signedness of the argument before any promotions happen
(equal to the mode of the pseudo holding it at that stage). */
--- 1340,1346 ----
function lie within the current compilation unit. (This does
take into account the exporting of a function via taking its
address, and so forth.) */
! strictly_local = cgraph_local_info (current_function_decl)->local;
/* The mode and signedness of the argument before any promotions happen
(equal to the mode of the pseudo holding it at that stage). */
Index: tree-profile.c
===================================================================
*** tree-profile.c (revision 138005)
--- tree-profile.c (working copy)
*************** tree_gen_ic_func_profiler (void)
*** 311,321 ****
tree stmt1, stmt2;
tree tree_uid, cur_func;
! if (flag_unit_at_a_time)
! {
! if (!c_node->needed)
! return;
! }
tree_init_edge_profiler ();
--- 311,318 ----
tree stmt1, stmt2;
tree tree_uid, cur_func;
! if (!c_node->needed)
! return;
tree_init_edge_profiler ();
Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c (revision 138005)
--- tree-ssa-structalias.c (working copy)
*************** delete_points_to_sets (void)
*** 5559,5566 ****
static bool
gate_ipa_pta (void)
{
! return (flag_unit_at_a_time != 0
! && flag_ipa_pta
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
--- 5559,5565 ----
static bool
gate_ipa_pta (void)
{
! return (flag_ipa_pta
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
Index: passes.c
===================================================================
*** passes.c (revision 138010)
--- passes.c (working copy)
*************** rest_of_decl_compilation (tree decl,
*** 180,186 ****
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them.
! We do output all variables when unit-at-a-time is active and rely on
callgraph code to defer them except for forward declarations
(see gcc.c-torture/compile/920624-1.c) */
if ((at_end
--- 180,186 ----
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them.
! We do output all variables and rely on
callgraph code to defer them except for forward declarations
(see gcc.c-torture/compile/920624-1.c) */
if ((at_end
*************** init_optimization_passes (void)
*** 523,531 ****
NEXT_PASS (pass_inline_parameters);
*p = NULL;
! /* Interprocedural optimization passes.
! All these passes are ignored in -fno-unit-at-a-time
! except for subpasses of early_local_passes. */
p = &all_ipa_passes;
NEXT_PASS (pass_ipa_function_and_variable_visibility);
NEXT_PASS (pass_ipa_early_inline);
--- 523,529 ----
NEXT_PASS (pass_inline_parameters);
*p = NULL;
! /* Interprocedural optimization passes. */
p = &all_ipa_passes;
NEXT_PASS (pass_ipa_function_and_variable_visibility);
NEXT_PASS (pass_ipa_early_inline);
*************** init_optimization_passes (void)
*** 593,599 ****
/* These passes are run after IPA passes on every function that is being
output to the assembler file. */
p = &all_passes;
- NEXT_PASS (pass_O0_always_inline);
NEXT_PASS (pass_all_optimizations);
{
struct opt_pass **p = &pass_all_optimizations.pass.sub;
--- 591,596 ----
*************** execute_one_ipa_transform_pass (struct c
*** 1228,1235 ****
pass_fini_dump_file (pass);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
}
static bool
--- 1225,1230 ----
*************** execute_one_pass (struct opt_pass *pass)
*** 1329,1336 ****
|| pass->type != RTL_PASS);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
return true;
}
--- 1324,1329 ----
Index: config/i386/i386.c
===================================================================
*** config/i386/i386.c (revision 138005)
--- config/i386/i386.c (working copy)
*************** ix86_function_regparm (const_tree type,
*** 3341,3347 ****
/* Use register calling convention for local functions when possible. */
if (decl && TREE_CODE (decl) == FUNCTION_DECL
! && flag_unit_at_a_time && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
--- 3341,3347 ----
/* Use register calling convention for local functions when possible. */
if (decl && TREE_CODE (decl) == FUNCTION_DECL
! && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
*************** ix86_function_sseregparm (const_tree typ
*** 3428,3434 ****
/* For local functions, pass up to SSE_REGPARM_MAX SFmode
(and DFmode for SSE2) arguments in SSE registers. */
! if (decl && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
--- 3428,3434 ----
/* For local functions, pass up to SSE_REGPARM_MAX SFmode
(and DFmode for SSE2) arguments in SSE registers. */
! if (decl && TARGET_SSE_MATH && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
Index: config/arm/arm.c
===================================================================
*** config/arm/arm.c (revision 138005)
--- config/arm/arm.c (working copy)
*************** arm_function_in_section_p (tree decl, se
*** 3267,3277 ****
/* If DECL_SECTION_NAME is set, assume it is trustworthy. */
if (!DECL_SECTION_NAME (decl))
{
- /* Only cater for unit-at-a-time mode, where we know that the user
- cannot later specify a section for DECL. */
- if (!flag_unit_at_a_time)
- return false;
-
/* Make sure that we will not create a unique section for DECL. */
if (flag_function_sections || DECL_ONE_ONLY (decl))
return false;
--- 3267,3272 ----
Index: config/bfin/bfin.c
===================================================================
*** config/bfin/bfin.c (revision 138005)
--- config/bfin/bfin.c (working copy)
*************** bfin_load_pic_reg (rtx dest)
*** 1129,1136 ****
struct cgraph_local_info *i = NULL;
rtx addr, insn;
! if (flag_unit_at_a_time)
! i = cgraph_local_info (current_function_decl);
/* Functions local to the translation unit don't need to reload the
pic reg, since the caller always passes a usable one. */
--- 1129,1135 ----
struct cgraph_local_info *i = NULL;
rtx addr, insn;
! i = cgraph_local_info (current_function_decl);
/* Functions local to the translation unit don't need to reload the
pic reg, since the caller always passes a usable one. */
*************** static bool
*** 1906,1911 ****
--- 1905,1911 ----
bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
tree exp ATTRIBUTE_UNUSED)
{
+ struct cgraph_local_info *this_func, *called_func;
e_funkind fkind = funkind (TREE_TYPE (current_function_decl));
if (fkind != SUBROUTINE)
return false;
*************** bfin_function_ok_for_sibcall (tree decl
*** 1917,1933 ****
not need to reload P5 in the prologue, but the sibcall wil pop P5 in the
sibcall epilogue, and we end up with the wrong value in P5. */
- if (!flag_unit_at_a_time || decl == NULL)
- /* Not enough information. */
- return false;
-
- {
- struct cgraph_local_info *this_func, *called_func;
! this_func = cgraph_local_info (current_function_decl);
! called_func = cgraph_local_info (decl);
! return !called_func->local || this_func->local;
! }
}
/* Emit RTL insns to initialize the variable parts of a trampoline at
--- 1917,1926 ----
not need to reload P5 in the prologue, but the sibcall wil pop P5 in the
sibcall epilogue, and we end up with the wrong value in P5. */
! this_func = cgraph_local_info (current_function_decl);
! called_func = cgraph_local_info (decl);
! return !called_func->local || this_func->local;
}
/* Emit RTL insns to initialize the variable parts of a trampoline at
Index: varpool.c
===================================================================
*** varpool.c (revision 138005)
--- varpool.c (working copy)
*************** struct varpool_node *varpool_nodes;
*** 61,67 ****
maintained in forward order. GTY is needed to make it friendly to
PCH.
! During unit-at-a-time compilation we construct the queue of needed variables
twice: first time it is during cgraph construction, second time it is at the
end of compilation in VARPOOL_REMOVE_UNREFERENCED_DECLS so we can avoid
optimized out variables being output.
--- 61,67 ----
maintained in forward order. GTY is needed to make it friendly to
PCH.
! During compilation we construct the queue of needed variables
twice: first time it is during cgraph construction, second time it is at the
end of compilation in VARPOOL_REMOVE_UNREFERENCED_DECLS so we can avoid
optimized out variables being output.
*************** varpool_reset_queue (void)
*** 214,230 ****
/* Determine if variable DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
! configury, or (if not doing unit-at-a-time) to something we haven't
! seen yet. */
bool
decide_is_variable_needed (struct varpool_node *node, tree decl)
{
/* If the user told us it is used, then it must be so. */
if (node->externally_visible || node->force_output)
return true;
- if (!flag_unit_at_a_time
- && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
--- 214,226 ----
/* Determine if variable DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
! configury */
bool
decide_is_variable_needed (struct varpool_node *node, tree decl)
{
/* If the user told us it is used, then it must be so. */
if (node->externally_visible || node->force_output)
return true;
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
*************** decide_is_variable_needed (struct varpoo
*** 257,263 ****
/* When not reordering top level variables, we have to assume that
we are going to keep everything. */
! if (flag_unit_at_a_time && flag_toplevel_reorder)
return false;
/* We want to emit COMDAT variables only when absolutely necessary. */
--- 253,259 ----
/* When not reordering top level variables, we have to assume that
we are going to keep everything. */
! if (flag_toplevel_reorder)
return false;
/* We want to emit COMDAT variables only when absolutely necessary. */
*************** varpool_finalize_decl (tree decl)
*** 280,286 ****
if this function has already run. */
if (node->finalized)
{
! if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
varpool_assemble_pending_decls ();
return;
}
--- 276,282 ----
if this function has already run. */
if (node->finalized)
{
! if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
return;
}
*************** varpool_finalize_decl (tree decl)
*** 295,301 ****
there. */
else if (TREE_PU