OSDN Git Service

2005-02-14 Daniel Berlin <dberlin@dberlin.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-optimize.c
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>
4
5 This file is part of GCC.
6
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)
10 any later version.
11
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.
16
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.  */
21
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include "tree.h"
27 #include "rtl.h"
28 #include "tm_p.h"
29 #include "hard-reg-set.h"
30 #include "basic-block.h"
31 #include "output.h"
32 #include "expr.h"
33 #include "diagnostic.h"
34 #include "basic-block.h"
35 #include "flags.h"
36 #include "tree-flow.h"
37 #include "tree-dump.h"
38 #include "timevar.h"
39 #include "function.h"
40 #include "langhooks.h"
41 #include "toplev.h"
42 #include "flags.h"
43 #include "cgraph.h"
44 #include "tree-inline.h"
45 #include "tree-mudflap.h"
46 #include "tree-pass.h"
47 #include "ggc.h"
48 #include "cgraph.h"
49 #include "graph.h"
50
51
52 /* Global variables used to communicate with passes.  */
53 int dump_flags;
54 bitmap vars_to_rename;
55 bool in_gimple_form;
56
57 /* The root of the compilation pass tree, once constructed.  */
58 static struct tree_opt_pass *all_passes;
59
60 /* Pass: dump the gimplified, inlined, functions.  */
61
62 static struct tree_opt_pass pass_gimple = 
63 {
64   "gimple",                             /* name */
65   NULL,                                 /* gate */
66   NULL,                                 /* execute */
67   NULL,                                 /* sub */
68   NULL,                                 /* next */
69   0,                                    /* static_pass_number */
70   0,                                    /* tv_id */
71   0,                                    /* properties_required */
72   PROP_gimple_any,                      /* properties_provided */
73   0,                                    /* properties_destroyed */
74   0,                                    /* todo_flags_start */
75   TODO_dump_func,                       /* todo_flags_finish */
76   0                                     /* letter */
77 };
78
79 /* Gate: execute, or not, all of the non-trivial optimizations.  */
80
81 static bool
82 gate_all_optimizations (void)
83 {
84   return (optimize >= 1
85           /* Don't bother doing anything if the program has errors.  */
86           && !(errorcount || sorrycount));
87 }
88
89 static struct tree_opt_pass pass_all_optimizations =
90 {
91   NULL,                                 /* name */
92   gate_all_optimizations,               /* gate */
93   NULL,                                 /* execute */
94   NULL,                                 /* sub */
95   NULL,                                 /* next */
96   0,                                    /* static_pass_number */
97   0,                                    /* tv_id */
98   0,                                    /* properties_required */
99   0,                                    /* properties_provided */
100   0,                                    /* properties_destroyed */
101   0,                                    /* todo_flags_start */
102   0,                                    /* todo_flags_finish */
103   0                                     /* letter */
104 };
105
106 /* Pass: cleanup the CFG just before expanding trees to RTL.
107    This is just a round of label cleanups and case node grouping
108    because after the tree optimizers have run such cleanups may
109    be necessary.  */
110
111 static void 
112 execute_cleanup_cfg_post_optimizing (void)
113 {
114   cleanup_tree_cfg ();
115   cleanup_dead_labels ();
116   group_case_labels ();
117 }
118
119 static struct tree_opt_pass pass_cleanup_cfg_post_optimizing =
120 {
121   "final_cleanup",                      /* name */
122   NULL,                                 /* gate */
123   execute_cleanup_cfg_post_optimizing,  /* execute */
124   NULL,                                 /* sub */
125   NULL,                                 /* next */
126   0,                                    /* static_pass_number */
127   0,                                    /* tv_id */
128   PROP_cfg,                             /* properties_required */
129   0,                                    /* properties_provided */
130   0,                                    /* properties_destroyed */
131   0,                                    /* todo_flags_start */
132   TODO_dump_func,                                       /* todo_flags_finish */
133   0                                     /* letter */
134 };
135
136 /* Pass: do the actions required to finish with tree-ssa optimization
137    passes.  */
138
139 static void
140 execute_free_datastructures (void)
141 {
142   tree *chain;
143
144   /* ??? This isn't the right place for this.  Worse, it got computed
145      more or less at random in various passes.  */
146   free_dominance_info (CDI_DOMINATORS);
147
148   /* Emit gotos for implicit jumps.  */
149   disband_implicit_edges ();
150
151   /* Remove the ssa structures.  Do it here since this includes statement
152      annotations that need to be intact during disband_implicit_edges.  */
153   delete_tree_ssa ();
154
155   /* Re-chain the statements from the blocks.  */
156   chain = &DECL_SAVED_TREE (current_function_decl);
157   *chain = alloc_stmt_list ();
158
159   /* And get rid of annotations we no longer need.  */
160   delete_tree_cfg_annotations ();
161 }
162
163 static struct tree_opt_pass pass_free_datastructures =
164 {
165   NULL,                                 /* name */
166   NULL,                                 /* gate */
167   execute_free_datastructures,                  /* execute */
168   NULL,                                 /* sub */
169   NULL,                                 /* next */
170   0,                                    /* static_pass_number */
171   0,                                    /* tv_id */
172   PROP_cfg,                             /* properties_required */
173   0,                                    /* properties_provided */
174   0,                                    /* properties_destroyed */
175   0,                                    /* todo_flags_start */
176   0,                                    /* todo_flags_finish */
177   0                                     /* letter */
178 };
179
180
181 /* Do the actions required to initialize internal data structures used
182    in tree-ssa optimization passes.  */
183
184 static void
185 execute_init_datastructures (void)
186 {
187   /* Allocate hash tables, arrays and other structures.  */
188   init_tree_ssa ();
189 }
190
191 static struct tree_opt_pass pass_init_datastructures =
192 {
193   NULL,                                 /* name */
194   NULL,                                 /* gate */
195   execute_init_datastructures,          /* execute */
196   NULL,                                 /* sub */
197   NULL,                                 /* next */
198   0,                                    /* static_pass_number */
199   0,                                    /* tv_id */
200   PROP_cfg,                             /* properties_required */
201   0,                                    /* properties_provided */
202   0,                                    /* properties_destroyed */
203   0,                                    /* todo_flags_start */
204   0,                                    /* todo_flags_finish */
205   0                                     /* letter */
206 };
207
208 /* Iterate over the pass tree allocating dump file numbers.  We want
209    to do this depth first, and independent of whether the pass is
210    enabled or not.  */
211
212 static void
213 register_one_dump_file (struct tree_opt_pass *pass, int n)
214 {
215   char *dot_name, *flag_name, *glob_name;
216   char num[10];
217
218   /* See below in next_pass_1.  */
219   num[0] = '\0';
220   if (pass->static_pass_number != -1)
221     sprintf (num, "%d", ((int) pass->static_pass_number < 0
222                          ? 1 : pass->static_pass_number));
223
224   dot_name = concat (".", pass->name, num, NULL);
225   if (pass->properties_provided & PROP_trees)
226     {
227       flag_name = concat ("tree-", pass->name, num, NULL);
228       glob_name = concat ("tree-", pass->name, NULL);
229       pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
230                                                 TDF_TREE, n + TDI_tree_all, 0);
231     }
232   else
233     {
234       flag_name = concat ("rtl-", pass->name, num, NULL);
235       glob_name = concat ("rtl-", pass->name, NULL);
236       pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
237                                                 TDF_RTL, n, pass->letter);
238     }
239 }
240
241 static int 
242 register_dump_files (struct tree_opt_pass *pass, int properties)
243 {
244   static int n = 0;
245   do
246     {
247       int new_properties;
248       int pass_number;
249
250       pass->properties_required = properties;
251       new_properties =
252         (properties | pass->properties_provided) & ~pass->properties_destroyed;
253
254       /* Reset the counter when we reach RTL-based passes.  */
255       if ((pass->properties_provided ^ pass->properties_required) & PROP_rtl)
256         n = 0;
257
258       pass_number = n;
259       if (pass->name)
260         n++;
261
262       if (pass->sub)
263         new_properties = register_dump_files (pass->sub, new_properties);
264
265       /* If we have a gate, combine the properties that we could have with
266          and without the pass being examined.  */
267       if (pass->gate)
268         properties &= new_properties;
269       else
270         properties = new_properties;
271
272       pass->properties_provided = properties;
273       if (pass->name)
274         register_one_dump_file (pass, pass_number);
275
276       pass = pass->next;
277     }
278   while (pass);
279
280   return properties;
281 }
282
283 /* Add a pass to the pass list. Duplicate the pass if it's already
284    in the list.  */
285
286 static struct tree_opt_pass **
287 next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
288 {
289
290   /* A nonzero static_pass_number indicates that the
291      pass is already in the list.  */
292   if (pass->static_pass_number)
293     {
294       struct tree_opt_pass *new;
295
296       new = xmalloc (sizeof (*new));
297       memcpy (new, pass, sizeof (*new));
298
299       /* Indicate to register_dump_files that this pass has duplicates,
300          and so it should rename the dump file.  The first instance will
301          be -1, and be number of duplicates = -static_pass_number - 1.
302          Subsequent instances will be > 0 and just the duplicate number.  */
303       if (pass->name)
304         {
305           pass->static_pass_number -= 1;
306           new->static_pass_number = -pass->static_pass_number;
307         }
308       
309       *list = new;
310     }
311   else
312     {
313       pass->static_pass_number = -1;
314       *list = pass;
315     }  
316   
317   return &(*list)->next;
318           
319 }
320
321 /* Construct the pass tree.  */
322
323 void
324 init_tree_optimization_passes (void)
325 {
326   struct tree_opt_pass **p;
327
328 #define NEXT_PASS(PASS)  (p = next_pass_1 (p, &PASS))
329
330   p = &all_passes;
331   NEXT_PASS (pass_gimple);
332   NEXT_PASS (pass_remove_useless_stmts);
333   NEXT_PASS (pass_mudflap_1);
334   NEXT_PASS (pass_lower_cf);
335   NEXT_PASS (pass_lower_eh);
336   NEXT_PASS (pass_build_cfg);
337   NEXT_PASS (pass_pre_expand);
338   NEXT_PASS (pass_tree_profile);
339   NEXT_PASS (pass_init_datastructures);
340   NEXT_PASS (pass_all_optimizations);
341   NEXT_PASS (pass_warn_function_return);
342   NEXT_PASS (pass_mudflap_2);
343   NEXT_PASS (pass_free_datastructures);
344   NEXT_PASS (pass_expand);
345   NEXT_PASS (pass_rest_of_compilation);
346   *p = NULL;
347
348   p = &pass_all_optimizations.sub;
349   NEXT_PASS (pass_referenced_vars);
350   NEXT_PASS (pass_maybe_create_global_var);
351   NEXT_PASS (pass_build_ssa);
352   NEXT_PASS (pass_may_alias);
353   NEXT_PASS (pass_rename_ssa_copies);
354   NEXT_PASS (pass_early_warn_uninitialized);
355   NEXT_PASS (pass_dce);
356   NEXT_PASS (pass_dominator);
357   NEXT_PASS (pass_redundant_phi);
358   NEXT_PASS (pass_dce);
359   NEXT_PASS (pass_merge_phi);
360   NEXT_PASS (pass_forwprop);
361   NEXT_PASS (pass_phiopt);
362   NEXT_PASS (pass_may_alias);
363   NEXT_PASS (pass_tail_recursion);
364   NEXT_PASS (pass_ch);
365   NEXT_PASS (pass_profile);
366   NEXT_PASS (pass_sra);
367   NEXT_PASS (pass_rename_ssa_copies);
368   NEXT_PASS (pass_dominator);
369   NEXT_PASS (pass_redundant_phi);
370   NEXT_PASS (pass_dce);
371   NEXT_PASS (pass_dse);
372   NEXT_PASS (pass_may_alias);
373   NEXT_PASS (pass_forwprop);
374   NEXT_PASS (pass_phiopt);
375   NEXT_PASS (pass_ccp);
376   NEXT_PASS (pass_redundant_phi);
377   NEXT_PASS (pass_fold_builtins);
378   /* FIXME: May alias should a TODO but for 4.0.0,
379      we add may_alias right after fold builtins
380      which can create arbitrary GIMPLE.  */
381   NEXT_PASS (pass_may_alias);
382   NEXT_PASS (pass_split_crit_edges);
383   NEXT_PASS (pass_pre);
384   NEXT_PASS (pass_loop);
385   NEXT_PASS (pass_dominator);
386   NEXT_PASS (pass_redundant_phi);
387   /* FIXME: If DCE is not run before checking for uninitialized uses,
388      we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
389      However, this also causes us to misdiagnose cases that should be
390      real warnings (e.g., testsuite/gcc.dg/pr18501.c).
391      
392      To fix the false positives in uninit-5.c, we would have to
393      account for the predicates protecting the set and the use of each
394      variable.  Using a representation like Gated Single Assignment
395      may help.  */
396   NEXT_PASS (pass_late_warn_uninitialized);
397   NEXT_PASS (pass_cd_dce);
398   NEXT_PASS (pass_dse);
399   NEXT_PASS (pass_forwprop);
400   NEXT_PASS (pass_phiopt);
401   NEXT_PASS (pass_tail_calls);
402   NEXT_PASS (pass_rename_ssa_copies);
403   NEXT_PASS (pass_del_ssa);
404   NEXT_PASS (pass_nrv);
405   NEXT_PASS (pass_remove_useless_vars);
406   NEXT_PASS (pass_mark_used_blocks);
407   NEXT_PASS (pass_cleanup_cfg_post_optimizing);
408   *p = NULL;
409
410   p = &pass_loop.sub;
411   NEXT_PASS (pass_loop_init);
412   NEXT_PASS (pass_lim);
413   NEXT_PASS (pass_unswitch);
414   NEXT_PASS (pass_record_bounds);
415   NEXT_PASS (pass_linear_transform);
416   NEXT_PASS (pass_iv_canon);
417   NEXT_PASS (pass_if_conversion);
418   NEXT_PASS (pass_vectorize);
419   NEXT_PASS (pass_complete_unroll);
420   NEXT_PASS (pass_iv_optimize);
421   NEXT_PASS (pass_loop_done);
422   *p = NULL;
423
424 #undef NEXT_PASS
425
426   /* Register the passes with the tree dump code.  */
427   register_dump_files (all_passes, 0);
428 }
429
430 static void execute_pass_list (struct tree_opt_pass *);
431
432 static unsigned int last_verified;
433
434 static void
435 execute_todo (int properties, unsigned int flags)
436 {
437   if (flags & TODO_rename_vars)
438     {
439       rewrite_into_ssa (false);
440       bitmap_clear (vars_to_rename);
441     }
442   if (flags & TODO_fix_def_def_chains)
443     {
444       rewrite_def_def_chains ();
445       bitmap_clear (vars_to_rename);
446     }
447
448   if (flags & TODO_cleanup_cfg)
449     cleanup_tree_cfg ();
450
451   if ((flags & TODO_dump_func) && dump_file)
452     {
453       if (properties & PROP_trees)
454         dump_function_to_file (current_function_decl,
455                                dump_file, dump_flags);
456       else if (properties & PROP_cfg)
457         print_rtl_with_bb (dump_file, get_insns ());
458       else
459         print_rtl (dump_file, get_insns ());
460
461       /* Flush the file.  If verification fails, we won't be able to
462          close the file before aborting.  */
463       fflush (dump_file);
464     }
465
466   if (flags & TODO_ggc_collect)
467     ggc_collect ();
468
469 #ifdef ENABLE_CHECKING
470   if (flags & TODO_verify_ssa)
471     verify_ssa ();
472   if (flags & TODO_verify_flow)
473     verify_flow_info ();
474   if (flags & TODO_verify_stmts)
475     verify_stmts ();
476 #endif
477 }
478
479 static bool
480 execute_one_pass (struct tree_opt_pass *pass)
481 {
482   unsigned int todo; 
483
484   /* See if we're supposed to run this pass.  */
485   if (pass->gate && !pass->gate ())
486     return false;
487
488   /* Note that the folders should only create gimple expressions.
489      This is a hack until the new folder is ready.  */
490   in_gimple_form = (pass->properties_provided & PROP_trees) != 0;
491
492   /* Run pre-pass verification.  */
493   todo = pass->todo_flags_start & ~last_verified;
494   if (todo)
495     execute_todo (pass->properties_required, todo);
496
497   /* If a dump file name is present, open it if enabled.  */
498   if (pass->static_pass_number != -1)
499     {
500       bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
501       dump_file_name = get_dump_file_name (pass->static_pass_number);
502       dump_file = dump_begin (pass->static_pass_number, &dump_flags);
503       if (dump_file)
504         {
505           const char *dname, *aname;
506           dname = lang_hooks.decl_printable_name (current_function_decl, 2);
507           aname = (IDENTIFIER_POINTER
508                    (DECL_ASSEMBLER_NAME (current_function_decl)));
509           fprintf (dump_file, "\n;; Function %s (%s)%s\n\n", dname, aname,
510              cfun->function_frequency == FUNCTION_FREQUENCY_HOT
511              ? " (hot)"
512              : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
513              ? " (unlikely executed)"
514              : "");
515         }
516
517       if (initializing_dump
518           && graph_dump_format != no_graph
519           && (pass->properties_provided & (PROP_cfg | PROP_rtl))
520               == (PROP_cfg | PROP_rtl))
521         clean_graph_dump_file (dump_file_name);
522     }
523
524   /* If a timevar is present, start it.  */
525   if (pass->tv_id)
526     timevar_push (pass->tv_id);
527
528   /* Do it!  */
529   if (pass->execute)
530     pass->execute ();
531
532   /* Stop timevar.  */
533   if (pass->tv_id)
534     timevar_pop (pass->tv_id);
535
536   if (dump_file
537       && (pass->properties_provided & (PROP_cfg | PROP_rtl))
538           == (PROP_cfg | PROP_rtl))
539     print_rtl_with_bb (dump_file, get_insns ());
540
541   /* Run post-pass cleanup and verification.  */
542   todo = pass->todo_flags_finish;
543   last_verified = todo & TODO_verify_all;
544   if (todo)
545     execute_todo (pass->properties_provided, todo);
546
547   /* Flush and close dump file.  */
548   if (dump_file_name)
549     {
550       free ((char *) dump_file_name);
551       dump_file_name = NULL;
552     }
553   if (dump_file)
554     {
555       dump_end (pass->static_pass_number, dump_file);
556       dump_file = NULL;
557     }
558
559   return true;
560 }
561
562 static void
563 execute_pass_list (struct tree_opt_pass *pass)
564 {
565   do
566     {
567       if (execute_one_pass (pass) && pass->sub)
568         execute_pass_list (pass->sub);
569       pass = pass->next;
570     }
571   while (pass);
572 }
573 \f
574
575 /* Update recursively all inlined_to pointers of functions
576    inlined into NODE to INLINED_TO.  */
577 static void
578 update_inlined_to_pointers (struct cgraph_node *node,
579                             struct cgraph_node *inlined_to)
580 {
581   struct cgraph_edge *e;
582   for (e = node->callees; e; e = e->next_callee)
583     {
584       if (e->callee->global.inlined_to)
585         {
586           e->callee->global.inlined_to = inlined_to;
587           update_inlined_to_pointers (e->callee, inlined_to);
588         }
589     }
590 }
591
592 \f
593 /* For functions-as-trees languages, this performs all optimization and
594    compilation for FNDECL.  */
595
596 void
597 tree_rest_of_compilation (tree fndecl)
598 {
599   location_t saved_loc;
600   struct cgraph_node *saved_node = NULL, *node;
601
602   timevar_push (TV_EXPAND);
603
604   gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
605
606   /* Initialize the RTL code for the function.  */
607   current_function_decl = fndecl;
608   saved_loc = input_location;
609   input_location = DECL_SOURCE_LOCATION (fndecl);
610   init_function_start (fndecl);
611
612   /* Even though we're inside a function body, we still don't want to
613      call expand_expr to calculate the size of a variable-sized array.
614      We haven't necessarily assigned RTL to all variables yet, so it's
615      not safe to try to expand expressions involving them.  */
616   cfun->x_dont_save_pending_sizes_p = 1;
617
618   node = cgraph_node (fndecl);
619
620   /* We might need the body of this function so that we can expand
621      it inline somewhere else.  This means not lowering some constructs
622      such as exception handling.  */
623   if (cgraph_preserve_function_body_p (fndecl))
624     {
625       if (!flag_unit_at_a_time)
626         {
627           struct cgraph_edge *e;
628
629           saved_node = cgraph_clone_node (node);
630           for (e = saved_node->callees; e; e = e->next_callee)
631             if (!e->inline_failed)
632               cgraph_clone_inlined_nodes (e, true);
633         }
634       cfun->saved_static_chain_decl = cfun->static_chain_decl;
635       cfun->saved_tree = save_body (fndecl, &cfun->saved_args,
636                                     &cfun->saved_static_chain_decl);
637     }
638
639   if (flag_inline_trees)
640     {
641       struct cgraph_edge *e;
642       for (e = node->callees; e; e = e->next_callee)
643         if (!e->inline_failed || warn_inline)
644           break;
645       if (e)
646         {
647           timevar_push (TV_INTEGRATION);
648           optimize_inline_calls (fndecl);
649           timevar_pop (TV_INTEGRATION);
650         }
651     }
652
653   /* We are not going to maintain the cgraph edges up to date.
654      Kill it so it won't confuse us.  */
655   while (node->callees)
656     cgraph_remove_edge (node->callees);
657
658
659   /* Initialize the default bitmap obstack.  */
660   bitmap_obstack_initialize (NULL);
661   bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
662   
663   vars_to_rename = BITMAP_XMALLOC ();
664   
665   /* Perform all tree transforms and optimizations.  */
666   execute_pass_list (all_passes);
667   
668   bitmap_obstack_release (&reg_obstack);
669
670   /* Release the default bitmap obstack.  */
671   bitmap_obstack_release (NULL);
672   
673   /* Restore original body if still needed.  */
674   if (cfun->saved_tree)
675     {
676       DECL_SAVED_TREE (fndecl) = cfun->saved_tree;
677       DECL_ARGUMENTS (fndecl) = cfun->saved_args;
678       cfun->static_chain_decl = cfun->saved_static_chain_decl;
679
680       /* When not in unit-at-a-time mode, we must preserve out of line copy
681          representing node before inlining.  Restore original outgoing edges
682          using clone we created earlier.  */
683       if (!flag_unit_at_a_time)
684         {
685           struct cgraph_edge *e;
686
687           while (node->callees)
688             cgraph_remove_edge (node->callees);
689           node->callees = saved_node->callees;
690           saved_node->callees = NULL;
691           update_inlined_to_pointers (node, node);
692           for (e = node->callees; e; e = e->next_callee)
693             e->caller = node;
694           cgraph_remove_node (saved_node);
695         }
696     }
697   else
698     DECL_SAVED_TREE (fndecl) = NULL;
699   cfun = 0;
700
701   /* If requested, warn about function definitions where the function will
702      return a value (usually of some struct or union type) which itself will
703      take up a lot of stack space.  */
704   if (warn_larger_than && !DECL_EXTERNAL (fndecl) && TREE_TYPE (fndecl))
705     {
706       tree ret_type = TREE_TYPE (TREE_TYPE (fndecl));
707
708       if (ret_type && TYPE_SIZE_UNIT (ret_type)
709           && TREE_CODE (TYPE_SIZE_UNIT (ret_type)) == INTEGER_CST
710           && 0 < compare_tree_int (TYPE_SIZE_UNIT (ret_type),
711                                    larger_than_size))
712         {
713           unsigned int size_as_int
714             = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type));
715
716           if (compare_tree_int (TYPE_SIZE_UNIT (ret_type), size_as_int) == 0)
717             warning ("%Jsize of return value of %qD is %u bytes",
718                      fndecl, fndecl, size_as_int);
719           else
720             warning ("%Jsize of return value of %qD is larger than %wd bytes",
721                      fndecl, fndecl, larger_than_size);
722         }
723     }
724
725   if (!flag_inline_trees)
726     {
727       DECL_SAVED_TREE (fndecl) = NULL;
728       if (DECL_STRUCT_FUNCTION (fndecl) == 0
729           && !cgraph_node (fndecl)->origin)
730         {
731           /* Stop pointing to the local nodes about to be freed.
732              But DECL_INITIAL must remain nonzero so we know this
733              was an actual function definition.
734              For a nested function, this is done in c_pop_function_context.
735              If rest_of_compilation set this to 0, leave it 0.  */
736           if (DECL_INITIAL (fndecl) != 0)
737             DECL_INITIAL (fndecl) = error_mark_node;
738         }
739     }
740
741   input_location = saved_loc;
742
743   ggc_collect ();
744   timevar_pop (TV_EXPAND);
745 }