1 /* Top-level control of tree optimizations.
2 Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
24 #include "coretypes.h"
29 #include "hard-reg-set.h"
30 #include "basic-block.h"
33 #include "diagnostic.h"
34 #include "basic-block.h"
36 #include "tree-flow.h"
37 #include "tree-dump.h"
40 #include "langhooks.h"
44 #include "tree-inline.h"
45 #include "tree-mudflap.h"
46 #include "tree-pass.h"
53 /* Global variables used to communicate with passes. */
57 /* The root of the compilation pass tree, once constructed. */
58 static struct tree_opt_pass *all_passes, *all_ipa_passes, * all_lowering_passes;
60 /* Gate: execute, or not, all of the non-trivial optimizations. */
63 gate_all_optimizations (void)
66 /* Don't bother doing anything if the program has errors. */
67 && !(errorcount || sorrycount));
70 static struct tree_opt_pass pass_all_optimizations =
73 gate_all_optimizations, /* gate */
77 0, /* static_pass_number */
79 0, /* properties_required */
80 0, /* properties_provided */
81 0, /* properties_destroyed */
82 0, /* todo_flags_start */
83 0, /* todo_flags_finish */
87 /* Pass: cleanup the CFG just before expanding trees to RTL.
88 This is just a round of label cleanups and case node grouping
89 because after the tree optimizers have run such cleanups may
93 execute_cleanup_cfg_post_optimizing (void)
96 cleanup_dead_labels ();
100 static struct tree_opt_pass pass_cleanup_cfg_post_optimizing =
102 "final_cleanup", /* name */
104 execute_cleanup_cfg_post_optimizing, /* execute */
107 0, /* static_pass_number */
109 PROP_cfg, /* properties_required */
110 0, /* properties_provided */
111 0, /* properties_destroyed */
112 0, /* todo_flags_start */
113 TODO_dump_func, /* todo_flags_finish */
117 /* Pass: do the actions required to finish with tree-ssa optimization
121 execute_free_datastructures (void)
123 /* ??? This isn't the right place for this. Worse, it got computed
124 more or less at random in various passes. */
125 free_dominance_info (CDI_DOMINATORS);
126 free_dominance_info (CDI_POST_DOMINATORS);
128 /* Remove the ssa structures. Do it here since this includes statement
129 annotations that need to be intact during disband_implicit_edges. */
133 static struct tree_opt_pass pass_free_datastructures =
137 execute_free_datastructures, /* execute */
140 0, /* static_pass_number */
142 PROP_cfg, /* properties_required */
143 0, /* properties_provided */
144 0, /* properties_destroyed */
145 0, /* todo_flags_start */
146 0, /* todo_flags_finish */
149 /* Pass: free cfg annotations. */
152 execute_free_cfg_annotations (void)
155 block_stmt_iterator bsi;
157 /* Emit gotos for implicit jumps. */
158 disband_implicit_edges ();
160 /* Remove annotations from every tree in the function. */
162 for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
164 tree stmt = bsi_stmt (bsi);
165 ggc_free (stmt->common.ann);
166 stmt->common.ann = NULL;
169 /* And get rid of annotations we no longer need. */
170 delete_tree_cfg_annotations ();
173 static struct tree_opt_pass pass_free_cfg_annotations =
177 execute_free_cfg_annotations, /* execute */
180 0, /* static_pass_number */
182 PROP_cfg, /* properties_required */
183 0, /* properties_provided */
184 0, /* properties_destroyed */
185 0, /* todo_flags_start */
186 0, /* todo_flags_finish */
189 /* Pass: fixup_cfg - IPA passes or compilation of earlier functions might've
190 changed some properties - such as marked functions nothrow. Remove now
191 redundant edges and basic blocks. */
194 execute_fixup_cfg (void)
197 block_stmt_iterator bsi;
202 for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
204 tree stmt = bsi_stmt (bsi);
205 tree call = get_call_expr_in (stmt);
207 if (call && call_expr_flags (call) & (ECF_CONST | ECF_PURE))
208 TREE_SIDE_EFFECTS (call) = 0;
209 if (!tree_could_throw_p (stmt) && lookup_stmt_eh_region (stmt))
210 remove_stmt_from_eh_region (stmt);
212 tree_purge_dead_eh_edges (bb);
218 static struct tree_opt_pass pass_fixup_cfg =
222 execute_fixup_cfg, /* execute */
225 0, /* static_pass_number */
227 PROP_cfg, /* properties_required */
228 0, /* properties_provided */
229 0, /* properties_destroyed */
230 0, /* todo_flags_start */
231 0, /* todo_flags_finish */
235 /* Do the actions required to initialize internal data structures used
236 in tree-ssa optimization passes. */
239 execute_init_datastructures (void)
241 /* Allocate hash tables, arrays and other structures. */
245 static struct tree_opt_pass pass_init_datastructures =
249 execute_init_datastructures, /* execute */
252 0, /* static_pass_number */
254 PROP_cfg, /* properties_required */
255 0, /* properties_provided */
256 0, /* properties_destroyed */
257 0, /* todo_flags_start */
258 0, /* todo_flags_finish */
262 /* Iterate over the pass tree allocating dump file numbers. We want
263 to do this depth first, and independent of whether the pass is
267 register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int n)
269 char *dot_name, *flag_name, *glob_name;
272 /* See below in next_pass_1. */
274 if (pass->static_pass_number != -1)
275 sprintf (num, "%d", ((int) pass->static_pass_number < 0
276 ? 1 : pass->static_pass_number));
278 dot_name = concat (".", pass->name, num, NULL);
281 flag_name = concat ("ipa-", pass->name, num, NULL);
282 glob_name = concat ("ipa-", pass->name, NULL);
283 /* First IPA dump is cgraph that is dumped via separate channels. */
284 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
287 else if (pass->properties_provided & PROP_trees)
289 flag_name = concat ("tree-", pass->name, num, NULL);
290 glob_name = concat ("tree-", pass->name, NULL);
291 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
292 TDF_TREE, n + TDI_tree_all, 0);
296 flag_name = concat ("rtl-", pass->name, num, NULL);
297 glob_name = concat ("rtl-", pass->name, NULL);
298 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
299 TDF_RTL, n, pass->letter);
304 register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
312 pass->properties_required = properties;
314 (properties | pass->properties_provided) & ~pass->properties_destroyed;
316 /* Reset the counter when we reach RTL-based passes. */
317 if ((pass->properties_provided ^ pass->properties_required) & PROP_rtl)
325 new_properties = register_dump_files (pass->sub, ipa, new_properties);
327 /* If we have a gate, combine the properties that we could have with
328 and without the pass being examined. */
330 properties &= new_properties;
332 properties = new_properties;
334 pass->properties_provided = properties;
336 register_one_dump_file (pass, ipa, pass_number);
345 /* Add a pass to the pass list. Duplicate the pass if it's already
348 static struct tree_opt_pass **
349 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
352 /* A nonzero static_pass_number indicates that the
353 pass is already in the list. */
354 if (pass->static_pass_number)
356 struct tree_opt_pass *new;
358 new = xmalloc (sizeof (*new));
359 memcpy (new, pass, sizeof (*new));
361 /* Indicate to register_dump_files that this pass has duplicates,
362 and so it should rename the dump file. The first instance will
363 be -1, and be number of duplicates = -static_pass_number - 1.
364 Subsequent instances will be > 0 and just the duplicate number. */
367 pass->static_pass_number -= 1;
368 new->static_pass_number = -pass->static_pass_number;
375 pass->static_pass_number = -1;
379 return &(*list)->next;
383 /* Construct the pass tree. */
386 init_tree_optimization_passes (void)
388 struct tree_opt_pass **p;
390 #define NEXT_PASS(PASS) (p = next_pass_1 (p, &PASS))
391 /* Intraprocedural optimization passes. */
393 NEXT_PASS (pass_ipa_inline);
396 /* All passes needed to lower the function into shape optimizers can operate
397 on. These passes are performed before interprocedural passes, unlike rest
398 of local passes (all_passes). */
399 p = &all_lowering_passes;
400 NEXT_PASS (pass_remove_useless_stmts);
401 NEXT_PASS (pass_mudflap_1);
402 NEXT_PASS (pass_lower_cf);
403 NEXT_PASS (pass_lower_eh);
404 NEXT_PASS (pass_build_cfg);
405 NEXT_PASS (pass_lower_complex_O0);
406 NEXT_PASS (pass_lower_vector);
407 NEXT_PASS (pass_warn_function_return);
408 NEXT_PASS (pass_tree_profile);
412 NEXT_PASS (pass_fixup_cfg);
413 NEXT_PASS (pass_init_datastructures);
414 NEXT_PASS (pass_all_optimizations);
415 NEXT_PASS (pass_warn_function_noreturn);
416 NEXT_PASS (pass_mudflap_2);
417 NEXT_PASS (pass_free_datastructures);
418 NEXT_PASS (pass_free_cfg_annotations);
419 NEXT_PASS (pass_expand);
420 NEXT_PASS (pass_rest_of_compilation);
423 p = &pass_all_optimizations.sub;
424 NEXT_PASS (pass_referenced_vars);
425 NEXT_PASS (pass_create_structure_vars);
426 NEXT_PASS (pass_build_ssa);
427 NEXT_PASS (pass_build_pta);
428 NEXT_PASS (pass_may_alias);
429 NEXT_PASS (pass_return_slot);
430 NEXT_PASS (pass_del_pta);
431 NEXT_PASS (pass_rename_ssa_copies);
432 NEXT_PASS (pass_early_warn_uninitialized);
434 /* Initial scalar cleanups. */
435 NEXT_PASS (pass_ccp);
436 NEXT_PASS (pass_fre);
437 NEXT_PASS (pass_dce);
438 NEXT_PASS (pass_forwprop);
439 NEXT_PASS (pass_copy_prop);
440 NEXT_PASS (pass_vrp);
441 NEXT_PASS (pass_dce);
442 NEXT_PASS (pass_merge_phi);
443 NEXT_PASS (pass_dominator);
445 NEXT_PASS (pass_phiopt);
446 NEXT_PASS (pass_build_pta);
447 NEXT_PASS (pass_may_alias);
448 NEXT_PASS (pass_del_pta);
449 NEXT_PASS (pass_tail_recursion);
450 NEXT_PASS (pass_profile);
452 NEXT_PASS (pass_stdarg);
453 NEXT_PASS (pass_lower_complex);
454 NEXT_PASS (pass_sra);
455 /* FIXME: SRA may generate arbitrary gimple code, exposing new
456 aliased and call-clobbered variables. As mentioned below,
457 pass_may_alias should be a TODO item. */
458 NEXT_PASS (pass_may_alias);
459 NEXT_PASS (pass_rename_ssa_copies);
460 NEXT_PASS (pass_dominator);
461 NEXT_PASS (pass_copy_prop);
462 NEXT_PASS (pass_dce);
463 NEXT_PASS (pass_dse);
464 NEXT_PASS (pass_may_alias);
465 NEXT_PASS (pass_forwprop);
466 NEXT_PASS (pass_phiopt);
467 NEXT_PASS (pass_object_sizes);
468 NEXT_PASS (pass_store_ccp);
469 NEXT_PASS (pass_store_copy_prop);
470 NEXT_PASS (pass_fold_builtins);
471 /* FIXME: May alias should a TODO but for 4.0.0,
472 we add may_alias right after fold builtins
473 which can create arbitrary GIMPLE. */
474 NEXT_PASS (pass_may_alias);
475 NEXT_PASS (pass_cse_reciprocals);
476 NEXT_PASS (pass_split_crit_edges);
477 NEXT_PASS (pass_reassoc);
478 NEXT_PASS (pass_pre);
479 NEXT_PASS (pass_sink_code);
480 NEXT_PASS (pass_loop);
481 NEXT_PASS (pass_dominator);
482 NEXT_PASS (pass_copy_prop);
483 NEXT_PASS (pass_cd_dce);
484 /* FIXME: If DCE is not run before checking for uninitialized uses,
485 we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
486 However, this also causes us to misdiagnose cases that should be
487 real warnings (e.g., testsuite/gcc.dg/pr18501.c).
489 To fix the false positives in uninit-5.c, we would have to
490 account for the predicates protecting the set and the use of each
491 variable. Using a representation like Gated Single Assignment
493 NEXT_PASS (pass_late_warn_uninitialized);
494 NEXT_PASS (pass_dse);
495 NEXT_PASS (pass_forwprop);
496 NEXT_PASS (pass_phiopt);
497 NEXT_PASS (pass_tail_calls);
498 NEXT_PASS (pass_rename_ssa_copies);
499 NEXT_PASS (pass_uncprop);
500 NEXT_PASS (pass_del_ssa);
501 NEXT_PASS (pass_nrv);
502 NEXT_PASS (pass_remove_useless_vars);
503 NEXT_PASS (pass_mark_used_blocks);
504 NEXT_PASS (pass_cleanup_cfg_post_optimizing);
508 NEXT_PASS (pass_loop_init);
509 NEXT_PASS (pass_copy_prop);
510 NEXT_PASS (pass_lim);
511 NEXT_PASS (pass_unswitch);
512 NEXT_PASS (pass_scev_cprop);
513 NEXT_PASS (pass_record_bounds);
514 NEXT_PASS (pass_linear_transform);
515 NEXT_PASS (pass_iv_canon);
516 NEXT_PASS (pass_if_conversion);
517 NEXT_PASS (pass_vectorize);
518 /* NEXT_PASS (pass_may_alias) cannot be done again because the
519 vectorizer creates alias relations that are not supported by
521 NEXT_PASS (pass_lower_vector_ssa);
522 NEXT_PASS (pass_complete_unroll);
523 NEXT_PASS (pass_iv_optimize);
524 NEXT_PASS (pass_loop_done);
529 register_dump_files (all_lowering_passes, false, PROP_gimple_any);
530 register_dump_files (all_passes, false, PROP_gimple_any
534 register_dump_files (all_ipa_passes, true, PROP_gimple_any
540 static unsigned int last_verified;
543 execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
546 = use_required ? pass->properties_required : pass->properties_provided;
548 #if defined ENABLE_CHECKING
549 if (need_ssa_update_p ())
550 gcc_assert (flags & TODO_update_ssa_any);
553 if (flags & TODO_update_ssa_any)
555 unsigned update_flags = flags & TODO_update_ssa_any;
556 update_ssa (update_flags);
559 if (flags & TODO_cleanup_cfg)
562 cleanup_tree_cfg_loop ();
567 if ((flags & TODO_dump_func)
568 && dump_file && current_function_decl)
570 if (properties & PROP_trees)
571 dump_function_to_file (current_function_decl,
572 dump_file, dump_flags);
573 else if (properties & PROP_cfg)
574 print_rtl_with_bb (dump_file, get_insns ());
576 print_rtl (dump_file, get_insns ());
578 /* Flush the file. If verification fails, we won't be able to
579 close the file before dieing. */
582 if ((flags & TODO_dump_cgraph)
583 && dump_file && !current_function_decl)
585 dump_cgraph (dump_file);
586 /* Flush the file. If verification fails, we won't be able to
587 close the file before aborting. */
591 if (flags & TODO_ggc_collect)
596 #if defined ENABLE_CHECKING
597 if ((pass->properties_required & PROP_ssa)
598 && !(pass->properties_destroyed & PROP_ssa))
600 if (flags & TODO_verify_flow)
602 if (flags & TODO_verify_stmts)
604 if (flags & TODO_verify_loops)
605 verify_loop_closed_ssa ();
610 execute_one_pass (struct tree_opt_pass *pass)
614 /* See if we're supposed to run this pass. */
615 if (pass->gate && !pass->gate ())
618 /* Note that the folders should only create gimple expressions.
619 This is a hack until the new folder is ready. */
620 in_gimple_form = (pass->properties_provided & PROP_trees) != 0;
622 /* Run pre-pass verification. */
623 todo = pass->todo_flags_start & ~last_verified;
625 execute_todo (pass, todo, true);
627 /* If a dump file name is present, open it if enabled. */
628 if (pass->static_pass_number != -1)
630 bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
631 dump_file_name = get_dump_file_name (pass->static_pass_number);
632 dump_file = dump_begin (pass->static_pass_number, &dump_flags);
633 if (dump_file && current_function_decl)
635 const char *dname, *aname;
636 dname = lang_hooks.decl_printable_name (current_function_decl, 2);
637 aname = (IDENTIFIER_POINTER
638 (DECL_ASSEMBLER_NAME (current_function_decl)));
639 fprintf (dump_file, "\n;; Function %s (%s)%s\n\n", dname, aname,
640 cfun->function_frequency == FUNCTION_FREQUENCY_HOT
642 : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
643 ? " (unlikely executed)"
647 if (initializing_dump
648 && graph_dump_format != no_graph
649 && (pass->properties_provided & (PROP_cfg | PROP_rtl))
650 == (PROP_cfg | PROP_rtl))
651 clean_graph_dump_file (dump_file_name);
654 /* If a timevar is present, start it. */
656 timevar_push (pass->tv_id);
664 timevar_pop (pass->tv_id);
667 && (pass->properties_provided & (PROP_cfg | PROP_rtl))
668 == (PROP_cfg | PROP_rtl))
669 print_rtl_with_bb (dump_file, get_insns ());
671 /* Run post-pass cleanup and verification. */
672 todo = pass->todo_flags_finish;
673 last_verified = todo & TODO_verify_all;
675 execute_todo (pass, todo, false);
677 /* Flush and close dump file. */
680 free ((char *) dump_file_name);
681 dump_file_name = NULL;
685 dump_end (pass->static_pass_number, dump_file);
693 execute_pass_list (struct tree_opt_pass *pass)
697 if (execute_one_pass (pass) && pass->sub)
698 execute_pass_list (pass->sub);
704 /* Same as execute_pass_list but assume that subpasses of IPA passes
707 execute_ipa_pass_list (struct tree_opt_pass *pass)
711 if (execute_one_pass (pass) && pass->sub)
713 struct cgraph_node *node;
714 for (node = cgraph_nodes; node; node = node->next)
717 push_cfun (DECL_STRUCT_FUNCTION (node->decl));
718 current_function_decl = node->decl;
719 execute_pass_list (pass);
720 free_dominance_info (CDI_DOMINATORS);
721 free_dominance_info (CDI_POST_DOMINATORS);
722 current_function_decl = NULL;
733 tree_lowering_passes (tree fn)
735 tree saved_current_function_decl = current_function_decl;
737 current_function_decl = fn;
738 push_cfun (DECL_STRUCT_FUNCTION (fn));
739 tree_register_cfg_hooks ();
740 bitmap_obstack_initialize (NULL);
741 execute_pass_list (all_lowering_passes);
742 free_dominance_info (CDI_POST_DOMINATORS);
744 current_function_decl = saved_current_function_decl;
745 bitmap_obstack_release (NULL);
749 /* Execute all IPA passes. */
754 tree_register_cfg_hooks ();
755 bitmap_obstack_initialize (NULL);
756 execute_ipa_pass_list (all_ipa_passes);
757 bitmap_obstack_release (NULL);
761 /* Update recursively all inlined_to pointers of functions
762 inlined into NODE to INLINED_TO. */
764 update_inlined_to_pointers (struct cgraph_node *node,
765 struct cgraph_node *inlined_to)
767 struct cgraph_edge *e;
768 for (e = node->callees; e; e = e->next_callee)
770 if (e->callee->global.inlined_to)
772 e->callee->global.inlined_to = inlined_to;
773 update_inlined_to_pointers (e->callee, inlined_to);
779 /* For functions-as-trees languages, this performs all optimization and
780 compilation for FNDECL. */
783 tree_rest_of_compilation (tree fndecl)
785 location_t saved_loc;
786 struct cgraph_node *saved_node = NULL, *node;
788 timevar_push (TV_EXPAND);
790 gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
792 /* Initialize the RTL code for the function. */
793 current_function_decl = fndecl;
794 saved_loc = input_location;
795 input_location = DECL_SOURCE_LOCATION (fndecl);
796 init_function_start (fndecl);
798 /* Even though we're inside a function body, we still don't want to
799 call expand_expr to calculate the size of a variable-sized array.
800 We haven't necessarily assigned RTL to all variables yet, so it's
801 not safe to try to expand expressions involving them. */
802 cfun->x_dont_save_pending_sizes_p = 1;
803 cfun->after_inlining = true;
805 node = cgraph_node (fndecl);
807 /* We might need the body of this function so that we can expand
808 it inline somewhere else. This means not lowering some constructs
809 such as exception handling. */
810 if (cgraph_preserve_function_body_p (fndecl))
812 if (!flag_unit_at_a_time)
814 struct cgraph_edge *e;
816 saved_node = cgraph_clone_node (node, node->count, 1);
817 for (e = saved_node->callees; e; e = e->next_callee)
818 if (!e->inline_failed)
819 cgraph_clone_inlined_nodes (e, true);
821 cfun->saved_static_chain_decl = cfun->static_chain_decl;
822 save_body (fndecl, &cfun->saved_args, &cfun->saved_static_chain_decl);
825 if (flag_inline_trees)
827 struct cgraph_edge *e;
828 for (e = node->callees; e; e = e->next_callee)
829 if (!e->inline_failed || warn_inline)
833 timevar_push (TV_INTEGRATION);
834 optimize_inline_calls (fndecl);
835 timevar_pop (TV_INTEGRATION);
838 /* We are not going to maintain the cgraph edges up to date.
839 Kill it so it won't confuse us. */
840 while (node->callees)
842 /* In non-unit-at-a-time we must mark all referenced functions as needed.
844 if (node->callees->callee->analyzed && !flag_unit_at_a_time)
845 cgraph_mark_needed_node (node->callees->callee);
846 cgraph_remove_edge (node->callees);
849 /* We are not going to maintain the cgraph edges up to date.
850 Kill it so it won't confuse us. */
851 cgraph_node_remove_callees (node);
854 /* Initialize the default bitmap obstack. */
855 bitmap_obstack_initialize (NULL);
856 bitmap_obstack_initialize (®_obstack); /* FIXME, only at RTL generation*/
858 tree_register_cfg_hooks ();
859 /* Perform all tree transforms and optimizations. */
860 execute_pass_list (all_passes);
862 bitmap_obstack_release (®_obstack);
864 /* Release the default bitmap obstack. */
865 bitmap_obstack_release (NULL);
867 /* Restore original body if still needed. */
870 DECL_ARGUMENTS (fndecl) = cfun->saved_args;
871 cfun->cfg = cfun->saved_cfg;
872 cfun->eh = cfun->saved_eh;
873 cfun->saved_cfg = NULL;
874 cfun->saved_eh = NULL;
875 cfun->saved_args = NULL_TREE;
876 cfun->static_chain_decl = cfun->saved_static_chain_decl;
877 cfun->saved_static_chain_decl = NULL;
878 /* When not in unit-at-a-time mode, we must preserve out of line copy
879 representing node before inlining. Restore original outgoing edges
880 using clone we created earlier. */
881 if (!flag_unit_at_a_time)
883 struct cgraph_edge *e;
885 node = cgraph_node (current_function_decl);
886 cgraph_node_remove_callees (node);
887 node->callees = saved_node->callees;
888 saved_node->callees = NULL;
889 update_inlined_to_pointers (node, node);
890 for (e = node->callees; e; e = e->next_callee)
892 cgraph_remove_node (saved_node);
896 DECL_SAVED_TREE (fndecl) = NULL;
899 /* If requested, warn about function definitions where the function will
900 return a value (usually of some struct or union type) which itself will
901 take up a lot of stack space. */
902 if (warn_larger_than && !DECL_EXTERNAL (fndecl) && TREE_TYPE (fndecl))
904 tree ret_type = TREE_TYPE (TREE_TYPE (fndecl));
906 if (ret_type && TYPE_SIZE_UNIT (ret_type)
907 && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
908 && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
911 unsigned int size_as_int
912 = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
914 if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
915 warning (0, "%Jsize of return value of %qD is %u bytes",
916 fndecl, fndecl, size_as_int);
918 warning (0, "%Jsize of return value of %qD is larger than %wd bytes",
919 fndecl, fndecl, larger_than_size);
923 if (!flag_inline_trees)
925 DECL_SAVED_TREE (fndecl) = NULL;
926 if (DECL_STRUCT_FUNCTION (fndecl) == 0
927 && !cgraph_node (fndecl)->origin)
929 /* Stop pointing to the local nodes about to be freed.
930 But DECL_INITIAL must remain nonzero so we know this
931 was an actual function definition.
932 For a nested function, this is done in c_pop_function_context.
933 If rest_of_compilation set this to 0, leave it 0. */
934 if (DECL_INITIAL (fndecl) != 0)
935 DECL_INITIAL (fndecl) = error_mark_node;
939 input_location = saved_loc;
942 timevar_pop (TV_EXPAND);