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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, 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)
125 /* ??? This isn't the right place for this. Worse, it got computed
126 more or less at random in various passes. */
127 free_dominance_info (CDI_DOMINATORS);
129 /* Emit gotos for implicit jumps. */
130 disband_implicit_edges ();
132 /* Remove the ssa structures. Do it here since this includes statement
133 annotations that need to be intact during disband_implicit_edges. */
136 /* Re-chain the statements from the blocks. */
137 chain = &DECL_SAVED_TREE (current_function_decl);
138 *chain = alloc_stmt_list ();
140 /* And get rid of annotations we no longer need. */
141 delete_tree_cfg_annotations ();
144 static struct tree_opt_pass pass_free_datastructures =
148 execute_free_datastructures, /* execute */
151 0, /* static_pass_number */
153 PROP_cfg, /* properties_required */
154 0, /* properties_provided */
155 0, /* properties_destroyed */
156 0, /* todo_flags_start */
157 0, /* todo_flags_finish */
161 /* Pass: fixup_cfg - IPA passes or compilation of earlier functions might've
162 changed some properties - such as marked functions nothrow. Remove now
163 redundant edges and basic blocks. */
166 execute_fixup_cfg (void)
169 block_stmt_iterator bsi;
174 for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
176 tree stmt = bsi_stmt (bsi);
177 tree call = get_call_expr_in (stmt);
179 if (call && call_expr_flags (call) & (ECF_CONST | ECF_PURE))
180 TREE_SIDE_EFFECTS (call) = 0;
181 if (!tree_could_throw_p (stmt) && lookup_stmt_eh_region (stmt))
182 remove_stmt_from_eh_region (stmt);
184 tree_purge_dead_eh_edges (bb);
190 static struct tree_opt_pass pass_fixup_cfg =
194 execute_fixup_cfg, /* execute */
197 0, /* static_pass_number */
199 PROP_cfg, /* properties_required */
200 0, /* properties_provided */
201 0, /* properties_destroyed */
202 0, /* todo_flags_start */
203 0, /* todo_flags_finish */
207 /* Do the actions required to initialize internal data structures used
208 in tree-ssa optimization passes. */
211 execute_init_datastructures (void)
213 /* Allocate hash tables, arrays and other structures. */
217 static struct tree_opt_pass pass_init_datastructures =
221 execute_init_datastructures, /* execute */
224 0, /* static_pass_number */
226 PROP_cfg, /* properties_required */
227 0, /* properties_provided */
228 0, /* properties_destroyed */
229 0, /* todo_flags_start */
230 0, /* todo_flags_finish */
234 /* Iterate over the pass tree allocating dump file numbers. We want
235 to do this depth first, and independent of whether the pass is
239 register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int n)
241 char *dot_name, *flag_name, *glob_name;
244 /* See below in next_pass_1. */
246 if (pass->static_pass_number != -1)
247 sprintf (num, "%d", ((int) pass->static_pass_number < 0
248 ? 1 : pass->static_pass_number));
250 dot_name = concat (".", pass->name, num, NULL);
253 flag_name = concat ("ipa-", pass->name, num, NULL);
254 glob_name = concat ("ipa-", pass->name, NULL);
255 /* First IPA dump is cgraph that is dumped via separate channels. */
256 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
259 else if (pass->properties_provided & PROP_trees)
261 flag_name = concat ("tree-", pass->name, num, NULL);
262 glob_name = concat ("tree-", pass->name, NULL);
263 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
264 TDF_TREE, n + TDI_tree_all, 0);
268 flag_name = concat ("rtl-", pass->name, num, NULL);
269 glob_name = concat ("rtl-", pass->name, NULL);
270 pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
271 TDF_RTL, n, pass->letter);
276 register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
284 pass->properties_required = properties;
286 (properties | pass->properties_provided) & ~pass->properties_destroyed;
288 /* Reset the counter when we reach RTL-based passes. */
289 if ((pass->properties_provided ^ pass->properties_required) & PROP_rtl)
297 new_properties = register_dump_files (pass->sub, ipa, new_properties);
299 /* If we have a gate, combine the properties that we could have with
300 and without the pass being examined. */
302 properties &= new_properties;
304 properties = new_properties;
306 pass->properties_provided = properties;
308 register_one_dump_file (pass, ipa, pass_number);
317 /* Add a pass to the pass list. Duplicate the pass if it's already
320 static struct tree_opt_pass **
321 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
324 /* A nonzero static_pass_number indicates that the
325 pass is already in the list. */
326 if (pass->static_pass_number)
328 struct tree_opt_pass *new;
330 new = xmalloc (sizeof (*new));
331 memcpy (new, pass, sizeof (*new));
333 /* Indicate to register_dump_files that this pass has duplicates,
334 and so it should rename the dump file. The first instance will
335 be -1, and be number of duplicates = -static_pass_number - 1.
336 Subsequent instances will be > 0 and just the duplicate number. */
339 pass->static_pass_number -= 1;
340 new->static_pass_number = -pass->static_pass_number;
347 pass->static_pass_number = -1;
351 return &(*list)->next;
355 /* Construct the pass tree. */
358 init_tree_optimization_passes (void)
360 struct tree_opt_pass **p;
362 #define NEXT_PASS(PASS) (p = next_pass_1 (p, &PASS))
363 /* Intraprocedural optimization passes. */
365 NEXT_PASS (pass_ipa_inline);
368 /* All passes needed to lower the function into shape optimizers can operate
369 on. These passes are performed before interprocedural passes, unlike rest
370 of local passes (all_passes). */
371 p = &all_lowering_passes;
372 NEXT_PASS (pass_remove_useless_stmts);
373 NEXT_PASS (pass_mudflap_1);
374 NEXT_PASS (pass_lower_cf);
375 NEXT_PASS (pass_lower_eh);
376 NEXT_PASS (pass_build_cfg);
377 NEXT_PASS (pass_lower_complex_O0);
378 NEXT_PASS (pass_lower_vector);
379 NEXT_PASS (pass_warn_function_return);
380 NEXT_PASS (pass_tree_profile);
384 NEXT_PASS (pass_fixup_cfg);
385 NEXT_PASS (pass_init_datastructures);
386 NEXT_PASS (pass_all_optimizations);
387 NEXT_PASS (pass_warn_function_noreturn);
388 NEXT_PASS (pass_mudflap_2);
389 NEXT_PASS (pass_free_datastructures);
390 NEXT_PASS (pass_expand);
391 NEXT_PASS (pass_rest_of_compilation);
394 p = &pass_all_optimizations.sub;
395 NEXT_PASS (pass_referenced_vars);
396 NEXT_PASS (pass_create_structure_vars);
397 NEXT_PASS (pass_build_ssa);
398 NEXT_PASS (pass_build_pta);
399 NEXT_PASS (pass_may_alias);
400 NEXT_PASS (pass_del_pta);
401 NEXT_PASS (pass_rename_ssa_copies);
402 NEXT_PASS (pass_early_warn_uninitialized);
404 /* Initial scalar cleanups. */
405 NEXT_PASS (pass_ccp);
406 NEXT_PASS (pass_fre);
407 NEXT_PASS (pass_dce);
408 NEXT_PASS (pass_forwprop);
409 NEXT_PASS (pass_vrp);
410 NEXT_PASS (pass_copy_prop);
411 NEXT_PASS (pass_dce);
412 NEXT_PASS (pass_merge_phi);
413 NEXT_PASS (pass_dominator);
415 NEXT_PASS (pass_phiopt);
416 NEXT_PASS (pass_build_pta);
417 NEXT_PASS (pass_may_alias);
418 NEXT_PASS (pass_del_pta);
419 NEXT_PASS (pass_tail_recursion);
420 NEXT_PASS (pass_profile);
422 NEXT_PASS (pass_stdarg);
423 NEXT_PASS (pass_lower_complex);
424 NEXT_PASS (pass_sra);
425 /* FIXME: SRA may generate arbitrary gimple code, exposing new
426 aliased and call-clobbered variables. As mentioned below,
427 pass_may_alias should be a TODO item. */
428 NEXT_PASS (pass_may_alias);
429 NEXT_PASS (pass_rename_ssa_copies);
430 NEXT_PASS (pass_dominator);
431 NEXT_PASS (pass_copy_prop);
432 NEXT_PASS (pass_dce);
433 NEXT_PASS (pass_dse);
434 NEXT_PASS (pass_may_alias);
435 NEXT_PASS (pass_forwprop);
436 NEXT_PASS (pass_phiopt);
437 NEXT_PASS (pass_store_ccp);
438 NEXT_PASS (pass_store_copy_prop);
439 NEXT_PASS (pass_fold_builtins);
440 /* FIXME: May alias should a TODO but for 4.0.0,
441 we add may_alias right after fold builtins
442 which can create arbitrary GIMPLE. */
443 NEXT_PASS (pass_may_alias);
444 NEXT_PASS (pass_cse_reciprocals);
445 NEXT_PASS (pass_split_crit_edges);
446 NEXT_PASS (pass_reassoc);
447 NEXT_PASS (pass_pre);
448 NEXT_PASS (pass_sink_code);
449 NEXT_PASS (pass_loop);
450 NEXT_PASS (pass_dominator);
451 NEXT_PASS (pass_copy_prop);
452 NEXT_PASS (pass_cd_dce);
453 /* FIXME: If DCE is not run before checking for uninitialized uses,
454 we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
455 However, this also causes us to misdiagnose cases that should be
456 real warnings (e.g., testsuite/gcc.dg/pr18501.c).
458 To fix the false positives in uninit-5.c, we would have to
459 account for the predicates protecting the set and the use of each
460 variable. Using a representation like Gated Single Assignment
462 NEXT_PASS (pass_late_warn_uninitialized);
463 NEXT_PASS (pass_dse);
464 NEXT_PASS (pass_forwprop);
465 NEXT_PASS (pass_phiopt);
466 NEXT_PASS (pass_tail_calls);
467 NEXT_PASS (pass_rename_ssa_copies);
468 NEXT_PASS (pass_uncprop);
469 NEXT_PASS (pass_del_ssa);
470 NEXT_PASS (pass_nrv);
471 NEXT_PASS (pass_remove_useless_vars);
472 NEXT_PASS (pass_mark_used_blocks);
473 NEXT_PASS (pass_cleanup_cfg_post_optimizing);
477 NEXT_PASS (pass_loop_init);
478 NEXT_PASS (pass_copy_prop);
479 NEXT_PASS (pass_lim);
480 NEXT_PASS (pass_unswitch);
481 NEXT_PASS (pass_scev_cprop);
482 NEXT_PASS (pass_record_bounds);
483 NEXT_PASS (pass_linear_transform);
484 NEXT_PASS (pass_iv_canon);
485 NEXT_PASS (pass_if_conversion);
486 NEXT_PASS (pass_vectorize);
487 /* NEXT_PASS (pass_may_alias) cannot be done again because the
488 vectorizer creates alias relations that are not supported by
490 NEXT_PASS (pass_lower_vector_ssa);
491 NEXT_PASS (pass_complete_unroll);
492 NEXT_PASS (pass_iv_optimize);
493 NEXT_PASS (pass_loop_done);
498 register_dump_files (all_lowering_passes, false, PROP_gimple_any);
499 register_dump_files (all_passes, false, PROP_gimple_any
503 register_dump_files (all_ipa_passes, true, PROP_gimple_any
509 static unsigned int last_verified;
512 execute_todo (struct tree_opt_pass *pass, unsigned int flags, bool use_required)
515 = use_required ? pass->properties_required : pass->properties_provided;
517 #if defined ENABLE_CHECKING
518 if (need_ssa_update_p ())
519 gcc_assert (flags & TODO_update_ssa_any);
522 if (flags & TODO_update_ssa_any)
524 unsigned update_flags = flags & TODO_update_ssa_any;
525 update_ssa (update_flags);
528 if (flags & TODO_cleanup_cfg)
531 cleanup_tree_cfg_loop ();
536 if ((flags & TODO_dump_func)
537 && dump_file && current_function_decl)
539 if (properties & PROP_trees)
540 dump_function_to_file (current_function_decl,
541 dump_file, dump_flags);
542 else if (properties & PROP_cfg)
543 print_rtl_with_bb (dump_file, get_insns ());
545 print_rtl (dump_file, get_insns ());
547 /* Flush the file. If verification fails, we won't be able to
548 close the file before dieing. */
551 if ((flags & TODO_dump_cgraph)
552 && dump_file && !current_function_decl)
554 dump_cgraph (dump_file);
555 /* Flush the file. If verification fails, we won't be able to
556 close the file before aborting. */
560 if (flags & TODO_ggc_collect)
565 #if defined ENABLE_CHECKING
566 if ((pass->properties_required & PROP_ssa)
567 && !(pass->properties_destroyed & PROP_ssa))
569 if (flags & TODO_verify_flow)
571 if (flags & TODO_verify_stmts)
573 if (flags & TODO_verify_loops)
574 verify_loop_closed_ssa ();
579 execute_one_pass (struct tree_opt_pass *pass)
583 /* See if we're supposed to run this pass. */
584 if (pass->gate && !pass->gate ())
587 /* Note that the folders should only create gimple expressions.
588 This is a hack until the new folder is ready. */
589 in_gimple_form = (pass->properties_provided & PROP_trees) != 0;
591 /* Run pre-pass verification. */
592 todo = pass->todo_flags_start & ~last_verified;
594 execute_todo (pass, todo, true);
596 /* If a dump file name is present, open it if enabled. */
597 if (pass->static_pass_number != -1)
599 bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
600 dump_file_name = get_dump_file_name (pass->static_pass_number);
601 dump_file = dump_begin (pass->static_pass_number, &dump_flags);
602 if (dump_file && current_function_decl)
604 const char *dname, *aname;
605 dname = lang_hooks.decl_printable_name (current_function_decl, 2);
606 aname = (IDENTIFIER_POINTER
607 (DECL_ASSEMBLER_NAME (current_function_decl)));
608 fprintf (dump_file, "\n;; Function %s (%s)%s\n\n", dname, aname,
609 cfun->function_frequency == FUNCTION_FREQUENCY_HOT
611 : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
612 ? " (unlikely executed)"
616 if (initializing_dump
617 && graph_dump_format != no_graph
618 && (pass->properties_provided & (PROP_cfg | PROP_rtl))
619 == (PROP_cfg | PROP_rtl))
620 clean_graph_dump_file (dump_file_name);
623 /* If a timevar is present, start it. */
625 timevar_push (pass->tv_id);
633 timevar_pop (pass->tv_id);
636 && (pass->properties_provided & (PROP_cfg | PROP_rtl))
637 == (PROP_cfg | PROP_rtl))
638 print_rtl_with_bb (dump_file, get_insns ());
640 /* Run post-pass cleanup and verification. */
641 todo = pass->todo_flags_finish;
642 last_verified = todo & TODO_verify_all;
644 execute_todo (pass, todo, false);
646 /* Flush and close dump file. */
649 free ((char *) dump_file_name);
650 dump_file_name = NULL;
654 dump_end (pass->static_pass_number, dump_file);
662 execute_pass_list (struct tree_opt_pass *pass)
666 if (execute_one_pass (pass) && pass->sub)
667 execute_pass_list (pass->sub);
673 /* Same as execute_pass_list but assume that subpasses of IPA passes
676 execute_ipa_pass_list (struct tree_opt_pass *pass)
680 if (execute_one_pass (pass) && pass->sub)
682 struct cgraph_node *node;
683 for (node = cgraph_nodes; node; node = node->next)
686 push_cfun (DECL_STRUCT_FUNCTION (node->decl));
687 current_function_decl = node->decl;
688 execute_pass_list (pass);
689 free_dominance_info (CDI_DOMINATORS);
690 free_dominance_info (CDI_POST_DOMINATORS);
691 current_function_decl = NULL;
702 tree_lowering_passes (tree fn)
704 tree saved_current_function_decl = current_function_decl;
706 current_function_decl = fn;
707 push_cfun (DECL_STRUCT_FUNCTION (fn));
708 tree_register_cfg_hooks ();
709 bitmap_obstack_initialize (NULL);
710 execute_pass_list (all_lowering_passes);
711 free_dominance_info (CDI_POST_DOMINATORS);
713 current_function_decl = saved_current_function_decl;
714 bitmap_obstack_release (NULL);
718 /* Execute all IPA passes. */
723 tree_register_cfg_hooks ();
724 bitmap_obstack_initialize (NULL);
725 execute_ipa_pass_list (all_ipa_passes);
726 bitmap_obstack_release (NULL);
730 /* Update recursively all inlined_to pointers of functions
731 inlined into NODE to INLINED_TO. */
733 update_inlined_to_pointers (struct cgraph_node *node,
734 struct cgraph_node *inlined_to)
736 struct cgraph_edge *e;
737 for (e = node->callees; e; e = e->next_callee)
739 if (e->callee->global.inlined_to)
741 e->callee->global.inlined_to = inlined_to;
742 update_inlined_to_pointers (e->callee, inlined_to);
748 /* For functions-as-trees languages, this performs all optimization and
749 compilation for FNDECL. */
752 tree_rest_of_compilation (tree fndecl)
754 location_t saved_loc;
755 struct cgraph_node *saved_node = NULL, *node;
757 timevar_push (TV_EXPAND);
759 gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
761 /* Initialize the RTL code for the function. */
762 current_function_decl = fndecl;
763 saved_loc = input_location;
764 input_location = DECL_SOURCE_LOCATION (fndecl);
765 init_function_start (fndecl);
767 /* Even though we're inside a function body, we still don't want to
768 call expand_expr to calculate the size of a variable-sized array.
769 We haven't necessarily assigned RTL to all variables yet, so it's
770 not safe to try to expand expressions involving them. */
771 cfun->x_dont_save_pending_sizes_p = 1;
772 cfun->after_inlining = true;
774 node = cgraph_node (fndecl);
776 /* We might need the body of this function so that we can expand
777 it inline somewhere else. This means not lowering some constructs
778 such as exception handling. */
779 if (cgraph_preserve_function_body_p (fndecl))
781 if (!flag_unit_at_a_time)
783 struct cgraph_edge *e;
785 saved_node = cgraph_clone_node (node, node->count, 1);
786 for (e = saved_node->callees; e; e = e->next_callee)
787 if (!e->inline_failed)
788 cgraph_clone_inlined_nodes (e, true);
790 cfun->saved_static_chain_decl = cfun->static_chain_decl;
791 save_body (fndecl, &cfun->saved_args, &cfun->saved_static_chain_decl);
794 if (flag_inline_trees)
796 struct cgraph_edge *e;
797 for (e = node->callees; e; e = e->next_callee)
798 if (!e->inline_failed || warn_inline)
802 timevar_push (TV_INTEGRATION);
803 optimize_inline_calls (fndecl);
804 timevar_pop (TV_INTEGRATION);
807 /* We are not going to maintain the cgraph edges up to date.
808 Kill it so it won't confuse us. */
809 while (node->callees)
811 /* In non-unit-at-a-time we must mark all referenced functions as needed.
813 if (node->callees->callee->analyzed && !flag_unit_at_a_time)
814 cgraph_mark_needed_node (node->callees->callee);
815 cgraph_remove_edge (node->callees);
818 /* We are not going to maintain the cgraph edges up to date.
819 Kill it so it won't confuse us. */
820 cgraph_node_remove_callees (node);
823 /* Initialize the default bitmap obstack. */
824 bitmap_obstack_initialize (NULL);
825 bitmap_obstack_initialize (®_obstack); /* FIXME, only at RTL generation*/
827 tree_register_cfg_hooks ();
828 /* Perform all tree transforms and optimizations. */
829 execute_pass_list (all_passes);
831 bitmap_obstack_release (®_obstack);
833 /* Release the default bitmap obstack. */
834 bitmap_obstack_release (NULL);
836 /* Restore original body if still needed. */
839 DECL_ARGUMENTS (fndecl) = cfun->saved_args;
840 cfun->cfg = cfun->saved_cfg;
841 cfun->eh = cfun->saved_eh;
842 cfun->saved_cfg = NULL;
843 cfun->saved_eh = NULL;
844 cfun->saved_args = NULL_TREE;
845 cfun->static_chain_decl = cfun->saved_static_chain_decl;
846 cfun->saved_static_chain_decl = NULL;
847 /* When not in unit-at-a-time mode, we must preserve out of line copy
848 representing node before inlining. Restore original outgoing edges
849 using clone we created earlier. */
850 if (!flag_unit_at_a_time)
852 struct cgraph_edge *e;
854 node = cgraph_node (current_function_decl);
855 cgraph_node_remove_callees (node);
856 node->callees = saved_node->callees;
857 saved_node->callees = NULL;
858 update_inlined_to_pointers (node, node);
859 for (e = node->callees; e; e = e->next_callee)
861 cgraph_remove_node (saved_node);
865 DECL_SAVED_TREE (fndecl) = NULL;
868 /* If requested, warn about function definitions where the function will
869 return a value (usually of some struct or union type) which itself will
870 take up a lot of stack space. */
871 if (warn_larger_than && !DECL_EXTERNAL (fndecl) && TREE_TYPE (fndecl))
873 tree ret_type = TREE_TYPE (TREE_TYPE (fndecl));
875 if (ret_type && TYPE_SIZE_UNIT (ret_type)
876 && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
877 && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
880 unsigned int size_as_int
881 = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
883 if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
884 warning (0, "%Jsize of return value of %qD is %u bytes",
885 fndecl, fndecl, size_as_int);
887 warning (0, "%Jsize of return value of %qD is larger than %wd bytes",
888 fndecl, fndecl, larger_than_size);
892 if (!flag_inline_trees)
894 DECL_SAVED_TREE (fndecl) = NULL;
895 if (DECL_STRUCT_FUNCTION (fndecl) == 0
896 && !cgraph_node (fndecl)->origin)
898 /* Stop pointing to the local nodes about to be freed.
899 But DECL_INITIAL must remain nonzero so we know this
900 was an actual function definition.
901 For a nested function, this is done in c_pop_function_context.
902 If rest_of_compilation set this to 0, leave it 0. */
903 if (DECL_INITIAL (fndecl) != 0)
904 DECL_INITIAL (fndecl) = error_mark_node;
908 input_location = saved_loc;
911 timevar_pop (TV_EXPAND);