1 /* Top level of GNU C compiler
2 Copyright (C) 1987, 88, 89, 92-6, 1997 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* This is the top level of cc1/c++.
22 It parses command args, opens files, invokes the various passes
23 in the proper order, and counts the time used by each.
24 Error messages and low-level interface to malloc also handled here. */
35 #include <sys/types.h>
39 #ifdef HAVE_SYS_PARAM_H
40 #include <sys/param.h>
43 #undef FLOAT /* This is for hpux. They should change hpux. */
44 #undef FFS /* Some systems define this in param.h. */
46 #ifdef TIME_WITH_SYS_TIME
47 # include <sys/time.h>
51 # include <sys/time.h>
57 #ifdef HAVE_SYS_RESOURCE_H
58 # include <sys/resource.h>
61 #ifdef HAVE_SYS_TIMES_H
62 # include <sys/times.h>
69 #include "insn-attr.h"
76 #ifdef XCOFF_DEBUGGING_INFO
81 /* The extra parameters substantially improve the I/O performance. */
83 vms_fopen (fname, type)
87 /* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
88 fixed arguments, which matches ANSI's specification but not VAXCRTL's
89 pre-ANSI implementation. This hack circumvents the mismatch problem. */
90 FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
93 return (*vmslib_fopen) (fname, type, "mbc=32",
94 "deq=64", "fop=tef", "shr=nil");
96 return (*vmslib_fopen) (fname, type, "mbc=32");
98 #define fopen vms_fopen
101 #ifndef DEFAULT_GDB_EXTENSIONS
102 #define DEFAULT_GDB_EXTENSIONS 1
105 /* If more than one debugging type is supported, you must define
106 PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
108 This is one long line cause VAXC can't handle a \-newline. */
109 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
110 #ifndef PREFERRED_DEBUGGING_TYPE
111 You Lose! You must define PREFERRED_DEBUGGING_TYPE!
112 #endif /* no PREFERRED_DEBUGGING_TYPE */
113 #else /* Only one debugging format supported. Define PREFERRED_DEBUGGING_TYPE
114 so the following code needn't care. */
115 #ifdef DBX_DEBUGGING_INFO
116 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
118 #ifdef SDB_DEBUGGING_INFO
119 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
121 #ifdef DWARF_DEBUGGING_INFO
122 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
124 #ifdef DWARF2_DEBUGGING_INFO
125 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
127 #ifdef XCOFF_DEBUGGING_INFO
128 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
130 #endif /* More than one debugger format enabled. */
132 /* If still not defined, must have been because no debugging formats
134 #ifndef PREFERRED_DEBUGGING_TYPE
135 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
138 extern int rtx_equal_function_value_matters;
140 #if ! (defined (VMS) || defined (OS2))
141 extern char **environ;
143 extern char *version_string, *language_string;
145 /* Carry information from ASM_DECLARE_OBJECT_NAME
146 to ASM_FINISH_DECLARE_OBJECT. */
148 extern int size_directive_output;
149 extern tree last_assemble_variable_decl;
151 extern void init_lex ();
152 extern void init_decl_processing ();
153 extern void init_obstacks ();
154 extern void init_tree_codes ();
155 extern void init_rtl ();
156 extern void init_regs ();
157 extern void init_optabs ();
158 extern void init_stmt ();
159 extern void init_reg_sets ();
160 extern void dump_flow_info ();
161 extern void dump_sched_info ();
162 extern void dump_local_alloc ();
163 extern void regset_release_memory ();
165 void rest_of_decl_compilation ();
166 void error_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
167 void error_with_decl PVPROTO((tree decl, char *s, ...));
168 void error_for_asm PVPROTO((rtx insn, char *s, ...));
169 void error PVPROTO((char *s, ...));
170 void fatal PVPROTO((char *s, ...));
171 void warning_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
172 void warning_with_decl PVPROTO((tree decl, char *s, ...));
173 void warning_for_asm PVPROTO((rtx insn, char *s, ...));
174 void warning PVPROTO((char *s, ...));
175 void pedwarn PVPROTO((char *s, ...));
176 void pedwarn_with_decl PVPROTO((tree decl, char *s, ...));
177 void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
178 void sorry PVPROTO((char *s, ...));
179 void really_sorry PVPROTO((char *s, ...));
184 void set_target_switch ();
185 static char *decl_name ();
187 void print_version ();
188 int print_single_switch ();
189 void print_switch_values ();
190 /* Length of line when printing switch values. */
194 extern char *sbrk ();
197 /* Name of program invoked, sans directories. */
201 /* Copy of arguments to main. */
205 /* Name of current original source file (what was input to cpp).
206 This comes from each #-command in the actual input. */
208 char *input_filename;
210 /* Name of top-level original source file (what was input to cpp).
211 This comes from the #-command at the beginning of the actual input.
212 If there isn't any there, then this is the cc1 input file name. */
214 char *main_input_filename;
217 /* Stream for reading from the input file. */
221 /* Current line number in real source file. */
225 /* Stack of currently pending input files. */
227 struct file_stack *input_file_stack;
229 /* Incremented on each change to input_file_stack. */
230 int input_file_stack_tick;
232 /* FUNCTION_DECL for function now being parsed or compiled. */
234 extern tree current_function_decl;
236 /* Name to use as base of names for dump output files. */
238 char *dump_base_name;
240 /* Bit flags that specify the machine subtype we are compiling for.
241 Bits are tested using macros TARGET_... defined in the tm.h file
242 and set by `-m...' switches. Must be defined in rtlanal.c. */
244 extern int target_flags;
246 /* Flags saying which kinds of debugging dump have been requested. */
249 int rtl_dump_and_exit = 0;
250 int jump_opt_dump = 0;
251 int addressof_dump = 0;
255 int branch_prob_dump = 0;
257 int combine_dump = 0;
258 int regmove_dump = 0;
260 int local_reg_dump = 0;
261 int global_reg_dump = 0;
263 int jump2_opt_dump = 0;
264 int dbr_sched_dump = 0;
265 int flag_print_asm_name = 0;
266 int stack_reg_dump = 0;
268 /* Name for output file of assembly code, specified with -o. */
272 /* Value of the -G xx switch, and whether it was passed or not. */
276 /* Type(s) of debugging information we are producing (if any).
277 See flags.h for the definitions of the different possible
278 types of debugging information. */
279 enum debug_info_type write_symbols = NO_DEBUG;
281 /* Level of debugging information we are producing. See flags.h
282 for the definitions of the different possible levels. */
283 enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
285 /* Nonzero means use GNU-only extensions in the generated symbolic
286 debugging information. */
287 /* Currently, this only has an effect when write_symbols is set to
288 DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
289 int use_gnu_debug_info_extensions = 0;
291 /* Nonzero means do optimizations. -O.
292 Particular numeric values stand for particular amounts of optimization;
293 thus, -O2 stores 2 here. However, the optimizations beyond the basic
294 ones are not controlled directly by this variable. Instead, they are
295 controlled by individual `flag_...' variables that are defaulted
296 based on this variable. */
300 /* Number of error messages and warning messages so far. */
303 int warningcount = 0;
306 /* Flag to output bytecode instead of native assembler */
307 int output_bytecode = 0;
309 /* Pointer to function to compute the name to use to print a declaration.
310 DECL is the declaration in question.
311 VERBOSITY determines what information will be printed:
312 0: DECL_NAME, demangled as necessary.
313 1: and scope information.
314 2: and any other information that might be interesting, such as function
315 parameter types in C++. */
317 char *(*decl_printable_name) (/* tree decl, int verbosity */);
319 /* Pointer to function to compute rtl for a language-specific tree code. */
321 struct rtx_def *(*lang_expand_expr) ();
323 /* Pointer to function to finish handling an incomplete decl at the
324 end of compilation. */
326 void (*incomplete_decl_finalize_hook) () = 0;
328 /* Highest label number used at the end of reload. */
330 int max_label_num_after_reload;
332 /* Nonzero if generating code to do profiling. */
334 int profile_flag = 0;
336 /* Nonzero if generating code to do profiling on a line-by-line basis. */
338 int profile_block_flag;
340 /* Nonzero if generating code to profile program flow graph arcs. */
342 int profile_arc_flag = 0;
344 /* Nonzero if generating info for gcov to calculate line test coverage. */
346 int flag_test_coverage = 0;
348 /* Nonzero indicates that branch taken probabilities should be calculated. */
350 int flag_branch_probabilities = 0;
352 /* Nonzero for -pedantic switch: warn about anything
353 that standard spec forbids. */
357 /* Temporarily suppress certain warnings.
358 This is set while reading code from a system header file. */
360 int in_system_header = 0;
362 /* Nonzero means do stupid register allocation.
363 Currently, this is 1 if `optimize' is 0. */
365 int obey_regdecls = 0;
367 /* Don't print functions as they are compiled and don't print
368 times taken by the various passes. -quiet. */
374 /* Nonzero means `char' should be signed. */
376 int flag_signed_char;
378 /* Nonzero means give an enum type only as many bytes as it needs. */
380 int flag_short_enums;
382 /* Nonzero for -fcaller-saves: allocate values in regs that need to
383 be saved across function calls, if that produces overall better code.
384 Optional now, so people can test it. */
386 #ifdef DEFAULT_CALLER_SAVES
387 int flag_caller_saves = 1;
389 int flag_caller_saves = 0;
392 /* Nonzero if structures and unions should be returned in memory.
394 This should only be defined if compatibility with another compiler or
395 with an ABI is needed, because it results in slower code. */
397 #ifndef DEFAULT_PCC_STRUCT_RETURN
398 #define DEFAULT_PCC_STRUCT_RETURN 1
401 /* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
403 int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
405 /* Nonzero for -fforce-mem: load memory value into a register
406 before arithmetic on it. This makes better cse but slower compilation. */
408 int flag_force_mem = 0;
410 /* Nonzero for -fforce-addr: load memory address into a register before
411 reference to memory. This makes better cse but slower compilation. */
413 int flag_force_addr = 0;
415 /* Nonzero for -fdefer-pop: don't pop args after each function call;
416 instead save them up to pop many calls' args with one insns. */
418 int flag_defer_pop = 0;
420 /* Nonzero for -ffloat-store: don't allocate floats and doubles
421 in extended-precision registers. */
423 int flag_float_store = 0;
425 /* Nonzero for -fcse-follow-jumps:
426 have cse follow jumps to do a more extensive job. */
428 int flag_cse_follow_jumps;
430 /* Nonzero for -fcse-skip-blocks:
431 have cse follow a branch around a block. */
432 int flag_cse_skip_blocks;
434 /* Nonzero for -fexpensive-optimizations:
435 perform miscellaneous relatively-expensive optimizations. */
436 int flag_expensive_optimizations;
438 /* Nonzero for -fthread-jumps:
439 have jump optimize output of loop. */
441 int flag_thread_jumps;
443 /* Nonzero enables strength-reduction in loop.c. */
445 int flag_strength_reduce = 0;
447 /* Nonzero enables loop unrolling in unroll.c. Only loops for which the
448 number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
449 UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
452 int flag_unroll_loops;
454 /* Nonzero enables loop unrolling in unroll.c. All loops are unrolled.
455 This is generally not a win. */
457 int flag_unroll_all_loops;
459 /* Nonzero forces all invariant computations in loops to be moved
462 int flag_move_all_movables = 0;
464 /* Nonzero forces all general induction variables in loops to be
467 int flag_reduce_all_givs = 0;
469 /* Nonzero for -fwritable-strings:
470 store string constants in data segment and don't uniquize them. */
472 int flag_writable_strings = 0;
474 /* Nonzero means don't put addresses of constant functions in registers.
475 Used for compiling the Unix kernel, where strange substitutions are
476 done on the assembly output. */
478 int flag_no_function_cse = 0;
480 /* Nonzero for -fomit-frame-pointer:
481 don't make a frame pointer in simple functions that don't require one. */
483 int flag_omit_frame_pointer = 0;
485 /* Nonzero means place each function into its own section on those platforms
486 which support arbitrary section names and unlimited numbers of sections. */
488 int flag_function_sections = 0;
490 /* Nonzero to inhibit use of define_optimization peephole opts. */
492 int flag_no_peephole = 0;
494 /* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
495 operations in the interest of optimization. For example it allows
496 GCC to assume arguments to sqrt are nonnegative numbers, allowing
497 faster code for sqrt to be generated. */
499 int flag_fast_math = 0;
501 /* Nonzero means all references through pointers are volatile. */
505 /* Nonzero means treat all global and extern variables as global. */
507 int flag_volatile_global;
509 /* Nonzero means just do syntax checking; don't output anything. */
511 int flag_syntax_only = 0;
513 /* Nonzero means to rerun cse after loop optimization. This increases
514 compilation time about 20% and picks up a few more common expressions. */
516 static int flag_rerun_cse_after_loop;
518 /* Nonzero means to run loop optimizations twice. */
520 int flag_rerun_loop_opt;
522 /* Nonzero for -finline-functions: ok to inline functions that look like
523 good inline candidates. */
525 int flag_inline_functions;
527 /* Nonzero for -fkeep-inline-functions: even if we make a function
528 go inline everywhere, keep its definition around for debugging
531 int flag_keep_inline_functions;
533 /* Nonzero means that functions will not be inlined. */
537 /* Nonzero means that we should emit static const variables
538 regardless of whether or not optimization is turned on. */
540 int flag_keep_static_consts = 1;
542 /* Nonzero means we should be saving declaration info into a .X file. */
544 int flag_gen_aux_info = 0;
546 /* Specified name of aux-info file. */
548 static char *aux_info_file_name;
550 /* Nonzero means make the text shared if supported. */
552 int flag_shared_data;
554 /* Nonzero means schedule into delayed branch slots if supported. */
556 int flag_delayed_branch;
558 /* Nonzero if we are compiling pure (sharable) code.
559 Value is 1 if we are doing reasonable (i.e. simple
560 offset into offset table) pic. Value is 2 if we can
561 only perform register offsets. */
565 /* Nonzero means generate extra code for exception handling and enable
566 exception handling. */
568 int flag_exceptions = 2;
570 /* Nonzero means don't place uninitialized global data in common storage
575 /* Nonzero means pretend it is OK to examine bits of target floats,
576 even if that isn't true. The resulting code will have incorrect constants,
577 but the same series of instructions that the native compiler would make. */
579 int flag_pretend_float;
581 /* Nonzero means change certain warnings into errors.
582 Usually these are warnings about failure to conform to some standard. */
584 int flag_pedantic_errors = 0;
586 /* flag_schedule_insns means schedule insns within basic blocks (before
588 flag_schedule_insns_after_reload means schedule insns after
591 int flag_schedule_insns = 0;
592 int flag_schedule_insns_after_reload = 0;
595 /* The following flags have effect only for scheduling before register
598 flag_schedule_interblock means schedule insns accross basic blocks.
599 flag_schedule_speculative means allow speculative motion of non-load insns.
600 flag_schedule_speculative_load means allow speculative motion of some
602 flag_schedule_speculative_load_dangerous allows speculative motion of more
604 flag_schedule_reverse_before_reload means try to reverse original order
606 flag_schedule_reverse_after_reload means try to reverse original order
609 int flag_schedule_interblock = 1;
610 int flag_schedule_speculative = 1;
611 int flag_schedule_speculative_load = 0;
612 int flag_schedule_speculative_load_dangerous = 0;
613 int flag_schedule_reverse_before_reload = 0;
614 int flag_schedule_reverse_after_reload = 0;
617 /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
618 by a cheaper branch, on a count register. */
619 int flag_branch_on_count_reg;
623 /* -finhibit-size-directive inhibits output of .size for ELF.
624 This is used only for compiling crtstuff.c,
625 and it may be extended to other effects
626 needed for crtstuff.c on other systems. */
627 int flag_inhibit_size_directive = 0;
629 /* -fverbose-asm causes extra commentary information to be produced in
630 the generated assembly code (to make it more readable). This option
631 is generally only of use to those who actually need to read the
632 generated assembly code (perhaps while debugging the compiler itself).
633 -fverbose-asm is the default. -fno-verbose-asm causes the extra information
634 to be omitted and is useful when comparing two assembler files. */
636 int flag_verbose_asm = 1;
638 /* -dA causes debug commentary information to be produced in
639 the generated assembly code (to make it more readable). This option
640 is generally only of use to those who actually need to read the
641 generated assembly code (perhaps while debugging the compiler itself).
642 Currently, this switch is only used by dwarfout.c; however, it is intended
643 to be a catchall for printing debug information in the assembler file. */
645 int flag_debug_asm = 0;
647 /* -fgnu-linker specifies use of the GNU linker for initializations.
648 (Or, more generally, a linker that handles initializations.)
649 -fno-gnu-linker says that collect2 will be used. */
651 int flag_gnu_linker = 0;
653 int flag_gnu_linker = 1;
656 /* Tag all structures with __attribute__(packed) */
657 int flag_pack_struct = 0;
659 /* Emit code to check for stack overflow; also may cause large objects
660 to be allocated dynamically. */
661 int flag_stack_check;
663 /* -fcheck-memory-usage causes extra code to be generated in order to check
664 memory accesses. This is used by a detector of bad memory accesses such
666 int flag_check_memory_usage = 0;
668 /* -fprefix-function-name causes function name to be prefixed. This
669 can be used with -fcheck-memory-usage to isolate code compiled with
670 -fcheck-memory-usage. */
671 int flag_prefix_function_name = 0;
673 int flag_regmove = 0;
675 /* 1 if alias checking is on (by default, when -O). */
676 int flag_alias_check = 0;
678 /* 0 if pointer arguments may alias each other. True in C.
679 1 if pointer arguments may not alias each other but may alias
681 2 if pointer arguments may not alias each other and may not
682 alias global variables. True in Fortran.
683 This defaults to 0 for C. */
684 int flag_argument_noalias = 0;
686 /* Table of language-independent -f options.
687 STRING is the option name. VARIABLE is the address of the variable.
688 ON_VALUE is the value to store in VARIABLE
689 if `-fSTRING' is seen as an option.
690 (If `-fno-STRING' is seen as an option, the opposite value is stored.) */
692 struct { char *string; int *variable; int on_value;} f_options[] =
694 {"float-store", &flag_float_store, 1},
695 {"volatile", &flag_volatile, 1},
696 {"volatile-global", &flag_volatile_global, 1},
697 {"defer-pop", &flag_defer_pop, 1},
698 {"omit-frame-pointer", &flag_omit_frame_pointer, 1},
699 {"cse-follow-jumps", &flag_cse_follow_jumps, 1},
700 {"cse-skip-blocks", &flag_cse_skip_blocks, 1},
701 {"expensive-optimizations", &flag_expensive_optimizations, 1},
702 {"thread-jumps", &flag_thread_jumps, 1},
703 {"strength-reduce", &flag_strength_reduce, 1},
704 {"unroll-loops", &flag_unroll_loops, 1},
705 {"unroll-all-loops", &flag_unroll_all_loops, 1},
706 {"move-all-movables", &flag_move_all_movables, 1},
707 {"reduce-all-givs", &flag_reduce_all_givs, 1},
708 {"writable-strings", &flag_writable_strings, 1},
709 {"peephole", &flag_no_peephole, 0},
710 {"force-mem", &flag_force_mem, 1},
711 {"force-addr", &flag_force_addr, 1},
712 {"function-cse", &flag_no_function_cse, 0},
713 {"inline-functions", &flag_inline_functions, 1},
714 {"keep-inline-functions", &flag_keep_inline_functions, 1},
715 {"inline", &flag_no_inline, 0},
716 {"keep-static-consts", &flag_keep_static_consts, 1},
717 {"syntax-only", &flag_syntax_only, 1},
718 {"shared-data", &flag_shared_data, 1},
719 {"caller-saves", &flag_caller_saves, 1},
720 {"pcc-struct-return", &flag_pcc_struct_return, 1},
721 {"reg-struct-return", &flag_pcc_struct_return, 0},
722 {"delayed-branch", &flag_delayed_branch, 1},
723 {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
724 {"rerun-loop-opt", &flag_rerun_loop_opt, 1},
725 {"pretend-float", &flag_pretend_float, 1},
726 {"schedule-insns", &flag_schedule_insns, 1},
727 {"schedule-insns2", &flag_schedule_insns_after_reload, 1},
729 {"sched-interblock",&flag_schedule_interblock, 1},
730 {"sched-spec",&flag_schedule_speculative, 1},
731 {"sched-spec-load",&flag_schedule_speculative_load, 1},
732 {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1},
733 {"sched-reverse-S",&flag_schedule_reverse_before_reload, 1},
734 {"sched-reverse-R",&flag_schedule_reverse_after_reload, 1},
735 {"branch-count-reg",&flag_branch_on_count_reg, 1},
737 {"pic", &flag_pic, 1},
738 {"PIC", &flag_pic, 2},
739 {"exceptions", &flag_exceptions, 1},
740 {"sjlj-exceptions", &exceptions_via_longjmp, 1},
741 {"asynchronous-exceptions", &asynchronous_exceptions, 1},
742 {"profile-arcs", &profile_arc_flag, 1},
743 {"test-coverage", &flag_test_coverage, 1},
744 {"branch-probabilities", &flag_branch_probabilities, 1},
745 {"fast-math", &flag_fast_math, 1},
746 {"common", &flag_no_common, 0},
747 {"inhibit-size-directive", &flag_inhibit_size_directive, 1},
748 {"function-sections", &flag_function_sections, 1},
749 {"verbose-asm", &flag_verbose_asm, 1},
750 {"gnu-linker", &flag_gnu_linker, 1},
751 {"regmove", &flag_regmove, 1},
752 {"pack-struct", &flag_pack_struct, 1},
753 {"stack-check", &flag_stack_check, 1},
754 {"bytecode", &output_bytecode, 1},
755 {"alias-check", &flag_alias_check, 1},
756 {"argument-alias", &flag_argument_noalias, 0},
757 {"argument-noalias", &flag_argument_noalias, 1},
758 {"argument-noalias-global", &flag_argument_noalias, 2},
759 {"check-memory-usage", &flag_check_memory_usage, 1},
760 {"prefix-function-name", &flag_prefix_function_name, 1}
763 /* Table of language-specific options. */
765 char *lang_options[] =
768 "-fallow-single-precision",
770 "-fsigned-bitfields",
771 "-funsigned-bitfields",
772 "-fno-signed-bitfields",
773 "-fno-unsigned-bitfields",
777 "-fno-unsigned-char",
793 "-fno-cond-mismatch",
794 "-fdollars-in-identifiers",
795 "-fno-dollars-in-identifiers",
804 "-Wbad-function-cast",
805 "-Wno-bad-function-cast",
809 "-Wno-char-subscripts",
820 "-Wimplicit-function-declaration",
821 "-Wno-implicit-function-declaration",
822 "-Werror-implicit-function-declaration",
830 "-Wno-missing-braces",
831 "-Wmissing-declarations",
832 "-Wno-missing-declarations",
833 "-Wmissing-prototypes",
834 "-Wno-missing-prototypes",
836 "-Wno-nested-externs",
840 "-Wno-pointer-arith",
842 "-Wno-redundant-decls",
845 "-Wstrict-prototypes",
846 "-Wno-strict-prototypes",
854 "-Wno-write-strings",
856 /* these are for obj c */
867 "-print-objc-runtime-info",
873 /* Options controlling warnings */
875 /* Don't print warning messages. -w. */
877 int inhibit_warnings = 0;
879 /* Print various extra warnings. -W. */
881 int extra_warnings = 0;
883 /* Treat warnings as errors. -Werror. */
885 int warnings_are_errors = 0;
887 /* Nonzero to warn about unused local variables. */
891 /* Nonzero to warn about variables used before they are initialized. */
893 int warn_uninitialized;
895 /* Nonzero means warn about all declarations which shadow others. */
899 /* Warn if a switch on an enum fails to have a case for every enum value. */
903 /* Nonzero means warn about function definitions that default the return type
904 or that use a null return and have a return-type other than void. */
906 int warn_return_type;
908 /* Nonzero means warn about pointer casts that increase the required
909 alignment of the target type (and might therefore lead to a crash
910 due to a misaligned access). */
914 /* Nonzero means warn about any identifiers that match in the first N
915 characters. The value N is in `id_clash_len'. */
918 unsigned id_clash_len;
920 /* Nonzero means warn about any objects definitions whose size is larger
921 than N bytes. Also want about function definitions whose returned
922 values are larger than N bytes. The value N is in `larger_than_size'. */
924 int warn_larger_than;
925 unsigned larger_than_size;
927 /* Nonzero means warn if inline function is too large. */
931 /* Warn if a function returns an aggregate,
932 since there are often incompatible calling conventions for doing this. */
934 int warn_aggregate_return;
936 /* Likewise for -W. */
938 struct { char *string; int *variable; int on_value;} W_options[] =
940 {"unused", &warn_unused, 1},
941 {"error", &warnings_are_errors, 1},
942 {"shadow", &warn_shadow, 1},
943 {"switch", &warn_switch, 1},
944 {"aggregate-return", &warn_aggregate_return, 1},
945 {"cast-align", &warn_cast_align, 1},
946 {"uninitialized", &warn_uninitialized, 1},
947 {"inline", &warn_inline, 1}
950 /* Output files for assembler code (real compiler output)
951 and debugging dumps. */
956 FILE *jump_opt_dump_file;
957 FILE *addressof_dump_file;
959 FILE *loop_dump_file;
960 FILE *cse2_dump_file;
961 FILE *branch_prob_dump_file;
962 FILE *flow_dump_file;
963 FILE *combine_dump_file;
964 FILE *regmove_dump_file;
965 FILE *sched_dump_file;
966 FILE *local_reg_dump_file;
967 FILE *global_reg_dump_file;
968 FILE *sched2_dump_file;
969 FILE *jump2_opt_dump_file;
970 FILE *dbr_sched_dump_file;
971 FILE *stack_reg_dump_file;
973 /* Time accumulators, to count the total time spent in various passes. */
977 int integration_time;
982 int branch_prob_time;
987 int local_alloc_time;
988 int global_alloc_time;
991 int shorten_branch_time;
997 /* Return time used so far, in microseconds. */
1002 #if !defined (_WIN32) || defined (__CYGWIN32__)
1007 struct rusage rusage;
1012 int proc_system_time;
1013 int child_user_time;
1014 int child_system_time;
1024 #else /* not BeOS */
1025 #if defined (_WIN32) && !defined (__CYGWIN32__)
1029 return (clock() * 1000);
1030 #else /* not _WIN32 */
1033 return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
1036 getrusage (0, &rusage);
1037 return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
1038 + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
1040 times ((void *) &vms_times);
1041 return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
1045 #endif /* __BEOS__ */
1048 #define TIMEVAR(VAR, BODY) \
1049 do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
1052 print_time (str, total)
1057 "time in %s: %d.%06d\n",
1058 str, total / 1000000, total % 1000000);
1061 /* Count an error or warning. Return 1 if the message should be printed. */
1064 count_error (warningp)
1067 if (warningp && inhibit_warnings)
1070 if (warningp && !warnings_are_errors)
1074 static int warning_message = 0;
1076 if (warningp && !warning_message)
1078 fprintf (stderr, "%s: warnings being treated as errors\n", progname);
1079 warning_message = 1;
1087 /* Print a fatal error message. NAME is the text.
1088 Also include a system error message based on `errno'. */
1091 pfatal_with_name (name)
1094 fprintf (stderr, "%s: ", progname);
1096 exit (FATAL_EXIT_CODE);
1100 fatal_io_error (name)
1103 fprintf (stderr, "%s: %s: I/O error\n", progname, name);
1104 exit (FATAL_EXIT_CODE);
1107 /* Called to give a better error message for a bad insn rather than
1108 just calling abort(). */
1111 fatal_insn (message, insn)
1115 if (!output_bytecode)
1121 fflush (asm_out_file);
1123 fflush (aux_info_file);
1125 fflush (rtl_dump_file);
1126 if (jump_opt_dump_file)
1127 fflush (jump_opt_dump_file);
1128 if (addressof_dump_file)
1129 fflush (addressof_dump_file);
1131 fflush (cse_dump_file);
1133 fflush (loop_dump_file);
1135 fflush (cse2_dump_file);
1137 fflush (flow_dump_file);
1138 if (combine_dump_file)
1139 fflush (combine_dump_file);
1140 if (regmove_dump_file)
1141 fflush (regmove_dump_file);
1142 if (sched_dump_file)
1143 fflush (sched_dump_file);
1144 if (local_reg_dump_file)
1145 fflush (local_reg_dump_file);
1146 if (global_reg_dump_file)
1147 fflush (global_reg_dump_file);
1148 if (sched2_dump_file)
1149 fflush (sched2_dump_file);
1150 if (jump2_opt_dump_file)
1151 fflush (jump2_opt_dump_file);
1152 if (dbr_sched_dump_file)
1153 fflush (dbr_sched_dump_file);
1154 if (stack_reg_dump_file)
1155 fflush (stack_reg_dump_file);
1161 /* Called to give a better error message when we don't have an insn to match
1162 what we are looking for or if the insn's constraints aren't satisfied,
1163 rather than just calling abort(). */
1166 fatal_insn_not_found (insn)
1169 if (INSN_CODE (insn) < 0)
1170 fatal_insn ("internal error--unrecognizable insn:", insn);
1172 fatal_insn ("internal error--insn does not satisfy its constraints:", insn);
1175 /* This is the default decl_printable_name function. */
1178 decl_name (decl, verbosity)
1182 return IDENTIFIER_POINTER (DECL_NAME (decl));
1185 static int need_error_newline;
1187 /* Function of last error message;
1188 more generally, function such that if next error message is in it
1189 then we don't have to mention the function name. */
1190 static tree last_error_function = NULL;
1192 /* Used to detect when input_file_stack has changed since last described. */
1193 static int last_error_tick;
1195 /* Called when the start of a function definition is parsed,
1196 this function prints on stderr the name of the function. */
1199 announce_function (decl)
1204 if (rtl_dump_and_exit)
1205 fprintf (stderr, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
1207 fprintf (stderr, " %s", (*decl_printable_name) (decl, 2));
1209 need_error_newline = 1;
1210 last_error_function = current_function_decl;
1214 /* The default function to print out name of current function that caused
1218 default_print_error_function (file)
1221 if (last_error_function != current_function_decl)
1223 char *kind = "function";
1224 if (current_function_decl != 0
1225 && TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
1229 fprintf (stderr, "%s: ", file);
1231 if (current_function_decl == NULL)
1232 fprintf (stderr, "At top level:\n");
1235 char *name = (*decl_printable_name) (current_function_decl, 2);
1236 fprintf (stderr, "In %s `%s':\n", kind, name);
1239 last_error_function = current_function_decl;
1243 /* Called by report_error_function to print out function name.
1244 * Default may be overridden by language front-ends. */
1246 void (*print_error_function) PROTO((char *)) = default_print_error_function;
1248 /* Prints out, if necessary, the name of the current function
1249 that caused an error. Called from all error and warning functions. */
1252 report_error_function (file)
1255 struct file_stack *p;
1257 if (need_error_newline)
1259 fprintf (stderr, "\n");
1260 need_error_newline = 0;
1263 (*print_error_function) (file);
1265 if (input_file_stack && input_file_stack->next != 0
1266 && input_file_stack_tick != last_error_tick
1267 && file == input_filename)
1269 fprintf (stderr, "In file included");
1270 for (p = input_file_stack->next; p; p = p->next)
1272 fprintf (stderr, " from %s:%d", p->name, p->line);
1274 fprintf (stderr, ",\n ");
1276 fprintf (stderr, ":\n");
1277 last_error_tick = input_file_stack_tick;
1281 /* Print a message. */
1284 vmessage (prefix, s, ap)
1290 fprintf (stderr, "%s: ", prefix);
1293 vfprintf (stderr, s, ap);
1296 HOST_WIDE_INT v1 = va_arg(ap, HOST_WIDE_INT);
1297 HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT);
1298 HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT);
1299 HOST_WIDE_INT v4 = va_arg(ap, HOST_WIDE_INT);
1300 fprintf (stderr, s, v1, v2, v3, v4);
1305 /* Print a message relevant to line LINE of file FILE. */
1308 v_message_with_file_and_line (file, line, prefix, s, ap)
1316 fprintf (stderr, "%s:%d: ", file, line);
1318 fprintf (stderr, "%s: ", progname);
1320 vmessage (prefix, s, ap);
1321 fputc ('\n', stderr);
1324 /* Print a message relevant to the given DECL. */
1327 v_message_with_decl (decl, prefix, s, ap)
1335 fprintf (stderr, "%s:%d: ",
1336 DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
1339 fprintf (stderr, "%s: ", prefix);
1341 /* Do magic to get around lack of varargs support for insertion
1342 of arguments into existing list. We know that the decl is first;
1343 we ass_u_me that it will be printed with "%s". */
1345 for (p = s; *p; ++p)
1349 if (*(p + 1) == '%')
1356 if (p > s) /* Print the left-hand substring. */
1358 char fmt[sizeof "%.255s"];
1361 if (width > 255L) width = 255L; /* arbitrary */
1362 sprintf (fmt, "%%.%lds", width);
1363 fprintf (stderr, fmt, s);
1366 if (*p == '%') /* Print the name. */
1368 char *n = (DECL_NAME (decl)
1369 ? (*decl_printable_name) (decl, 2)
1375 if (isalpha (*(p - 1) & 0xFF))
1380 if (*p) /* Print the rest of the message. */
1381 vmessage ((char *)NULL, p, ap);
1383 fputc ('\n', stderr);
1386 /* Figure file and line of the given INSN. */
1389 file_and_line_for_asm (insn, pfile, pline)
1394 rtx body = PATTERN (insn);
1397 /* Find the (or one of the) ASM_OPERANDS in the insn. */
1398 if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
1399 asmop = SET_SRC (body);
1400 else if (GET_CODE (body) == ASM_OPERANDS)
1402 else if (GET_CODE (body) == PARALLEL
1403 && GET_CODE (XVECEXP (body, 0, 0)) == SET)
1404 asmop = SET_SRC (XVECEXP (body, 0, 0));
1405 else if (GET_CODE (body) == PARALLEL
1406 && GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
1407 asmop = XVECEXP (body, 0, 0);
1413 *pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
1414 *pline = ASM_OPERANDS_SOURCE_LINE (asmop);
1418 *pfile = input_filename;
1423 /* Report an error at line LINE of file FILE. */
1426 v_error_with_file_and_line (file, line, s, ap)
1433 report_error_function (file);
1434 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1438 error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1450 file = va_arg (ap, char *);
1451 line = va_arg (ap, int);
1452 s = va_arg (ap, char *);
1455 v_error_with_file_and_line (file, line, s, ap);
1459 /* Report an error at the declaration DECL.
1460 S is a format string which uses %s to substitute the declaration
1461 name; subsequent substitutions are a la printf. */
1464 v_error_with_decl (decl, s, ap)
1470 report_error_function (DECL_SOURCE_FILE (decl));
1471 v_message_with_decl (decl, (char *)NULL, s, ap);
1475 error_with_decl VPROTO((tree decl, char *s, ...))
1486 decl = va_arg (ap, tree);
1487 s = va_arg (ap, char *);
1490 v_error_with_decl (decl, s, ap);
1494 /* Report an error at the line number of the insn INSN.
1495 This is used only when INSN is an `asm' with operands,
1496 and each ASM_OPERANDS records its own source file and line. */
1499 v_error_for_asm (insn, s, ap)
1508 file_and_line_for_asm (insn, &file, &line);
1509 report_error_function (file);
1510 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1514 error_for_asm VPROTO((rtx insn, char *s, ...))
1525 insn = va_arg (ap, rtx);
1526 s = va_arg (ap, char *);
1529 v_error_for_asm (insn, s, ap);
1533 /* Report an error at the current line number. */
1540 v_error_with_file_and_line (input_filename, lineno, s, ap);
1544 error VPROTO((char *s, ...))
1554 s = va_arg (ap, char *);
1561 /* Report a fatal error at the current line number. */
1569 exit (FATAL_EXIT_CODE);
1573 fatal VPROTO((char *s, ...))
1583 s = va_arg (ap, char *);
1590 /* Report a warning at line LINE of file FILE. */
1593 v_warning_with_file_and_line (file, line, s, ap)
1599 if (count_error (1))
1601 report_error_function (file);
1602 v_message_with_file_and_line (file, line, "warning", s, ap);
1607 warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1619 file = va_arg (ap, char *);
1620 line = va_arg (ap, int);
1621 s = va_arg (ap, char *);
1624 v_warning_with_file_and_line (file, line, s, ap);
1628 /* Report a warning at the declaration DECL.
1629 S is a format string which uses %s to substitute the declaration
1630 name; subsequent substitutions are a la printf. */
1633 v_warning_with_decl (decl, s, ap)
1638 if (count_error (1))
1640 report_error_function (DECL_SOURCE_FILE (decl));
1641 v_message_with_decl (decl, "warning", s, ap);
1646 warning_with_decl VPROTO((tree decl, char *s, ...))
1657 decl = va_arg (ap, tree);
1658 s = va_arg (ap, char *);
1661 v_warning_with_decl (decl, s, ap);
1665 /* Report a warning at the line number of the insn INSN.
1666 This is used only when INSN is an `asm' with operands,
1667 and each ASM_OPERANDS records its own source file and line. */
1670 v_warning_for_asm (insn, s, ap)
1675 if (count_error (1))
1680 file_and_line_for_asm (insn, &file, &line);
1681 report_error_function (file);
1682 v_message_with_file_and_line (file, line, "warning", s, ap);
1687 warning_for_asm VPROTO((rtx insn, char *s, ...))
1698 insn = va_arg (ap, rtx);
1699 s = va_arg (ap, char *);
1702 v_warning_for_asm (insn, s, ap);
1706 /* Report a warning at the current line number. */
1713 v_warning_with_file_and_line (input_filename, lineno, s, ap);
1717 warning VPROTO((char *s, ...))
1727 s = va_arg (ap, char *);
1734 /* These functions issue either warnings or errors depending on
1735 -pedantic-errors. */
1742 if (flag_pedantic_errors)
1749 pedwarn VPROTO((char *s, ...))
1759 s = va_arg (ap, char *);
1767 v_pedwarn_with_decl (decl, s, ap)
1772 /* We don't want -pedantic-errors to cause the compilation to fail from
1773 "errors" in system header files. Sometimes fixincludes can't fix what's
1774 broken (eg: unsigned char bitfields - fixing it may change the alignment
1775 which will cause programs to mysteriously fail because the C library
1776 or kernel uses the original layout). There's no point in issuing a
1777 warning either, it's just unnecessary noise. */
1779 if (! DECL_IN_SYSTEM_HEADER (decl))
1781 if (flag_pedantic_errors)
1782 v_error_with_decl (decl, s, ap);
1784 v_warning_with_decl (decl, s, ap);
1789 pedwarn_with_decl VPROTO((tree decl, char *s, ...))
1800 decl = va_arg (ap, tree);
1801 s = va_arg (ap, char *);
1804 v_pedwarn_with_decl (decl, s, ap);
1809 v_pedwarn_with_file_and_line (file, line, s, ap)
1815 if (flag_pedantic_errors)
1816 v_error_with_file_and_line (file, line, s, ap);
1818 v_warning_with_file_and_line (file, line, s, ap);
1822 pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1834 file = va_arg (ap, char *);
1835 line = va_arg (ap, int);
1836 s = va_arg (ap, char *);
1839 v_pedwarn_with_file_and_line (file, line, s, ap);
1843 /* Apologize for not implementing some feature. */
1852 fprintf (stderr, "%s:%d: ", input_filename, lineno);
1854 fprintf (stderr, "%s: ", progname);
1855 vmessage ("sorry, not implemented", s, ap);
1856 fputc ('\n', stderr);
1860 sorry VPROTO((char *s, ...))
1870 s = va_arg (ap, char *);
1877 /* Apologize for not implementing some feature, then quit. */
1880 v_really_sorry (s, ap)
1886 fprintf (stderr, "%s:%d: ", input_filename, lineno);
1888 fprintf (stderr, "%s: ", progname);
1889 vmessage ("sorry, not implemented", s, ap);
1890 fatal (" (fatal)\n");
1894 really_sorry VPROTO((char *s, ...))
1904 s = va_arg (ap, char *);
1907 v_really_sorry (s, ap);
1911 /* More 'friendly' abort that prints the line and file.
1912 config.h can #define abort fancy_abort if you like that sort of thing.
1914 I don't think this is actually a good idea.
1915 Other sorts of crashes will look a certain way.
1916 It is a good thing if crashes from calling abort look the same way.
1922 fatal ("internal gcc abort");
1925 /* This calls abort and is used to avoid problems when abort if a macro.
1926 It is used when we need to pass the address of abort. */
1934 /* When `malloc.c' is compiled with `rcheck' defined,
1935 it calls this function to report clobberage. */
1943 /* Same as `malloc' but report error if no memory available. */
1949 register char *value = (char *) malloc (size);
1950 if (value == 0 && size != 0)
1951 fatal ("virtual memory exhausted");
1955 /* Same as `realloc' but report error if no memory available.
1956 Also handle null PTR even if the vendor realloc gets it wrong. */
1959 xrealloc (ptr, size)
1964 ? (char *) realloc (ptr, size)
1965 : (char *) malloc (size));
1967 fatal ("virtual memory exhausted");
1971 /* Same as `strdup' but report error if no memory available. */
1977 register char *result = (char *) malloc (strlen (s) + 1);
1980 fatal ("virtual memory exhausted");
1985 /* Return the logarithm of X, base 2, considering X unsigned,
1986 if X is a power of 2. Otherwise, returns -1.
1988 This should be used via the `exact_log2' macro. */
1992 register unsigned HOST_WIDE_INT x;
1994 register int log = 0;
1995 /* Test for 0 or a power of 2. */
1996 if (x == 0 || x != (x & -x))
1998 while ((x >>= 1) != 0)
2003 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
2004 If X is 0, return -1.
2006 This should be used via the floor_log2 macro. */
2010 register unsigned HOST_WIDE_INT x;
2012 register int log = -1;
2019 static int float_handler_set;
2021 jmp_buf float_handler;
2023 /* Signals actually come here. */
2026 float_signal (signo)
2027 /* If this is missing, some compilers complain. */
2030 if (float_handled == 0)
2032 #if defined (USG) || defined (hpux)
2033 signal (SIGFPE, float_signal); /* re-enable the signal catcher */
2036 signal (SIGFPE, float_signal);
2037 longjmp (float_handler, 1);
2040 /* Specify where to longjmp to when a floating arithmetic error happens.
2041 If HANDLER is 0, it means don't handle the errors any more. */
2044 set_float_handler (handler)
2047 float_handled = (handler != 0);
2049 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
2051 if (float_handled && ! float_handler_set)
2053 signal (SIGFPE, float_signal);
2054 float_handler_set = 1;
2058 /* Specify, in HANDLER, where to longjmp to when a floating arithmetic
2059 error happens, pushing the previous specification into OLD_HANDLER.
2060 Return an indication of whether there was a previous handler in effect. */
2063 push_float_handler (handler, old_handler)
2064 jmp_buf handler, old_handler;
2066 int was_handled = float_handled;
2070 bcopy ((char *) float_handler, (char *) old_handler,
2071 sizeof (float_handler));
2073 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
2077 /* Restore the previous specification of whether and where to longjmp to
2078 when a floating arithmetic error happens. */
2081 pop_float_handler (handled, handler)
2085 float_handled = handled;
2087 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
2090 /* Handler for SIGPIPE. */
2094 /* If this is missing, some compilers complain. */
2097 fatal ("output pipe has been closed");
2100 /* Strip off a legitimate source ending from the input string NAME of
2101 length LEN. Rather than having to know the names used by all of
2102 our front ends, we strip off an ending of a period followed by one,
2103 two, or three characters. */
2106 strip_off_ending (name, len)
2110 if (len > 2 && name[len - 2] == '.')
2111 name[len - 2] = '\0';
2112 else if (len > 3 && name[len - 3] == '.')
2113 name[len - 3] = '\0';
2114 else if (len > 4 && name[len - 4] == '.')
2115 name[len - 4] = '\0';
2118 /* Output a quoted string. */
2121 output_quoted_string (asm_file, string)
2125 #ifdef OUTPUT_QUOTED_STRING
2126 OUTPUT_QUOTED_STRING (asm_file, string);
2130 putc ('\"', asm_file);
2131 while ((c = *string++) != 0)
2133 if (c == '\"' || c == '\\')
2134 putc ('\\', asm_file);
2137 putc ('\"', asm_file);
2141 /* Output a file name in the form wanted by System V. */
2144 output_file_directive (asm_file, input_name)
2148 int len = strlen (input_name);
2149 char *na = input_name + len;
2151 /* NA gets INPUT_NAME sans directory names. */
2152 while (na > input_name)
2159 #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
2160 ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file, na);
2162 #ifdef ASM_OUTPUT_SOURCE_FILENAME
2163 ASM_OUTPUT_SOURCE_FILENAME (asm_file, na);
2165 fprintf (asm_file, "\t.file\t");
2166 output_quoted_string (asm_file, na);
2167 fputc ('\n', asm_file);
2172 /* Routine to build language identifier for object file. */
2175 output_lang_identify (asm_out_file)
2178 int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
2179 char *s = (char *) alloca (len);
2180 sprintf (s, "__gnu_compiled_%s", lang_identify ());
2181 ASM_OUTPUT_LABEL (asm_out_file, s);
2184 /* Routine to open a dump file. */
2187 open_dump_file (base_name, suffix)
2192 char *dumpname = (char *) alloca (strlen (base_name) + strlen (suffix) + 1);
2194 strcpy (dumpname, base_name);
2195 strcat (dumpname, suffix);
2196 f = fopen (dumpname, "w");
2198 pfatal_with_name (dumpname);
2202 /* Compile an entire file of output from cpp, named NAME.
2203 Write a file of assembly output and various debugging dumps. */
2212 int name_specified = name != 0;
2214 if (dump_base_name == 0)
2215 dump_base_name = name ? name : "gccdump";
2219 integration_time = 0;
2224 branch_prob_time = 0;
2229 local_alloc_time = 0;
2230 global_alloc_time = 0;
2233 shorten_branch_time = 0;
2240 /* Open input file. */
2242 if (name == 0 || !strcmp (name, "-"))
2248 finput = fopen (name, "r");
2250 pfatal_with_name (name);
2252 #ifdef IO_BUFFER_SIZE
2253 setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
2255 #endif /* !USE_CPPLIB */
2257 /* Initialize data in various passes. */
2266 /* Some of these really don't need to be called when generating bytecode,
2267 but the options would have to be parsed first to know that. -bson */
2269 init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
2270 || debug_info_level == DINFO_LEVEL_VERBOSE
2271 || flag_test_coverage);
2273 init_decl_processing ();
2281 if (flag_caller_saves)
2282 init_caller_save ();
2284 /* If auxiliary info generation is desired, open the output file.
2285 This goes in the same directory as the source file--unlike
2286 all the other output files. */
2287 if (flag_gen_aux_info)
2289 aux_info_file = fopen (aux_info_file_name, "w");
2290 if (aux_info_file == 0)
2291 pfatal_with_name (aux_info_file_name);
2294 /* If rtl dump desired, open the output file. */
2296 rtl_dump_file = open_dump_file (dump_base_name, ".rtl");
2298 /* If jump_opt dump desired, open the output file. */
2300 jump_opt_dump_file = open_dump_file (dump_base_name, ".jump");
2302 /* If addressof dump desired, open the output file. */
2304 addressof_dump_file = open_dump_file (dump_base_name, ".addressof");
2306 /* If cse dump desired, open the output file. */
2308 cse_dump_file = open_dump_file (dump_base_name, ".cse");
2310 /* If loop dump desired, open the output file. */
2312 loop_dump_file = open_dump_file (dump_base_name, ".loop");
2314 /* If cse2 dump desired, open the output file. */
2316 cse2_dump_file = open_dump_file (dump_base_name, ".cse2");
2318 /* If branch_prob dump desired, open the output file. */
2319 if (branch_prob_dump)
2320 branch_prob_dump_file = open_dump_file (dump_base_name, ".bp");
2322 /* If flow dump desired, open the output file. */
2324 flow_dump_file = open_dump_file (dump_base_name, ".flow");
2326 /* If combine dump desired, open the output file. */
2328 combine_dump_file = open_dump_file (dump_base_name, ".combine");
2330 /* If regmove dump desired, open the output file. */
2332 regmove_dump_file = open_dump_file (dump_base_name, ".regmove");
2334 /* If scheduling dump desired, open the output file. */
2336 sched_dump_file = open_dump_file (dump_base_name, ".sched");
2338 /* If local_reg dump desired, open the output file. */
2340 local_reg_dump_file = open_dump_file (dump_base_name, ".lreg");
2342 /* If global_reg dump desired, open the output file. */
2343 if (global_reg_dump)
2344 global_reg_dump_file = open_dump_file (dump_base_name, ".greg");
2346 /* If 2nd scheduling dump desired, open the output file. */
2348 sched2_dump_file = open_dump_file (dump_base_name, ".sched2");
2350 /* If jump2_opt dump desired, open the output file. */
2352 jump2_opt_dump_file = open_dump_file (dump_base_name, ".jump2");
2354 /* If dbr_sched dump desired, open the output file. */
2356 dbr_sched_dump_file = open_dump_file (dump_base_name, ".dbr");
2360 /* If stack_reg dump desired, open the output file. */
2362 stack_reg_dump_file = open_dump_file (dump_base_name, ".stack");
2366 /* Open assembler code output file. */
2368 if (! name_specified && asm_file_name == 0)
2369 asm_out_file = stdout;
2372 int len = strlen (dump_base_name);
2373 register char *dumpname = (char *) xmalloc (len + 6);
2374 strcpy (dumpname, dump_base_name);
2375 strip_off_ending (dumpname, len);
2376 strcat (dumpname, ".s");
2377 if (asm_file_name == 0)
2379 asm_file_name = (char *) xmalloc (strlen (dumpname) + 1);
2380 strcpy (asm_file_name, dumpname);
2382 if (!strcmp (asm_file_name, "-"))
2383 asm_out_file = stdout;
2385 asm_out_file = fopen (asm_file_name, "w");
2386 if (asm_out_file == 0)
2387 pfatal_with_name (asm_file_name);
2390 #ifdef IO_BUFFER_SIZE
2391 setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
2392 _IOFBF, IO_BUFFER_SIZE);
2395 input_filename = name;
2397 /* Put an entry on the input file stack for the main input file. */
2399 = (struct file_stack *) xmalloc (sizeof (struct file_stack));
2400 input_file_stack->next = 0;
2401 input_file_stack->name = input_filename;
2403 /* Gross. Gross. lang_init is (I think) the first callback into
2404 the language front end, and is thus the first opportunity to
2405 have the selected language override the default value for any
2408 So the default value for flag_exceptions is 2 (uninitialized).
2409 If we encounter -fno-exceptions or -fexceptions, then flag_exceptions
2410 will be set to zero or one respectively.
2412 flag_exceptions can also be set by lang_init to something other
2413 than the default "uninitialized" value of 2.
2415 After lang_init, if the value is still 2, then we default to
2416 -fno-exceptions (value will be reset to zero).
2418 When our EH mechanism is low enough overhead that we can enable
2419 it by default for languages other than C++, then all this braindamage
2422 /* Perform language-specific initialization.
2423 This may set main_input_filename. */
2426 if (flag_exceptions == 2)
2427 flag_exceptions = 0;
2429 /* If the input doesn't start with a #line, use the input name
2430 as the official input file name. */
2431 if (main_input_filename == 0)
2432 main_input_filename = name;
2434 if (!output_bytecode)
2436 ASM_FILE_START (asm_out_file);
2438 #ifdef ASM_COMMENT_START
2439 if (flag_verbose_asm)
2441 /* Print the list of options in effect. */
2442 print_version (asm_out_file, ASM_COMMENT_START);
2443 print_switch_values (asm_out_file, 0, MAX_LINE,
2444 ASM_COMMENT_START, " ", "\n");
2445 /* Add a blank line here so it appears in assembler output but not
2447 fprintf (asm_out_file, "\n");
2452 /* Output something to inform GDB that this compilation was by GCC. Also
2453 serves to tell GDB file consists of bytecodes. */
2454 if (output_bytecode)
2455 fprintf (asm_out_file, "bc_gcc2_compiled.:\n");
2458 #ifndef ASM_IDENTIFY_GCC
2459 fprintf (asm_out_file, "gcc2_compiled.:\n");
2461 ASM_IDENTIFY_GCC (asm_out_file);
2465 /* Output something to identify which front-end produced this file. */
2466 #ifdef ASM_IDENTIFY_LANGUAGE
2467 ASM_IDENTIFY_LANGUAGE (asm_out_file);
2470 #ifndef ASM_OUTPUT_SECTION_NAME
2471 if (flag_function_sections)
2473 warning ("-ffunction-sections not supported for this target.");
2474 flag_function_sections = 0;
2478 if (flag_function_sections
2479 && (profile_flag || profile_block_flag))
2481 warning ("-ffunction-sections disabled; it makes profiling impossible.");
2482 flag_function_sections = 0;
2485 if (flag_function_sections && write_symbols != NO_DEBUG)
2486 warning ("-ffunction-sections may affect debugging on some targets.");
2488 if (output_bytecode)
2490 if (profile_flag || profile_block_flag)
2491 error ("profiling not supported in bytecode compilation");
2495 /* ??? Note: There used to be a conditional here
2496 to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
2497 This was to guarantee separation between gcc_compiled. and
2498 the first function, for the sake of dbx on Suns.
2499 However, having the extra zero here confused the Emacs
2500 code for unexec, and might confuse other programs too.
2501 Therefore, I took out that change.
2502 In future versions we should find another way to solve
2503 that dbx problem. -- rms, 23 May 93. */
2505 /* Don't let the first function fall at the same address
2506 as gcc_compiled., if profiling. */
2507 if (profile_flag || profile_block_flag)
2508 assemble_zeros (UNITS_PER_WORD);
2511 /* If dbx symbol table desired, initialize writing it
2512 and output the predefined types. */
2513 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2514 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2515 TIMEVAR (symout_time, dbxout_init (asm_out_file, main_input_filename,
2518 #ifdef SDB_DEBUGGING_INFO
2519 if (write_symbols == SDB_DEBUG)
2520 TIMEVAR (symout_time, sdbout_init (asm_out_file, main_input_filename,
2523 #ifdef DWARF_DEBUGGING_INFO
2524 if (write_symbols == DWARF_DEBUG)
2525 TIMEVAR (symout_time, dwarfout_init (asm_out_file, main_input_filename));
2527 #ifdef DWARF2_UNWIND_INFO
2528 if (dwarf2out_do_frame ())
2529 dwarf2out_frame_init ();
2531 #ifdef DWARF2_DEBUGGING_INFO
2532 if (write_symbols == DWARF2_DEBUG)
2533 TIMEVAR (symout_time, dwarf2out_init (asm_out_file, main_input_filename));
2536 /* Initialize yet another pass. */
2538 if (!output_bytecode)
2539 init_final (main_input_filename);
2540 init_branch_prob (dump_base_name);
2542 start_time = get_run_time ();
2544 /* Call the parser, which parses the entire file
2545 (calling rest_of_compilation for each function). */
2547 if (yyparse () != 0)
2549 if (errorcount == 0)
2550 fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)");
2552 /* In case there were missing closebraces,
2553 get us back to the global binding level. */
2554 while (! global_bindings_p ())
2558 output_func_start_profiler ();
2560 /* Compilation is now finished except for writing
2561 what's left of the symbol table output. */
2563 parse_time += get_run_time () - start_time;
2565 parse_time -= integration_time;
2566 parse_time -= varconst_time;
2568 globals = getdecls ();
2570 /* Really define vars that have had only a tentative definition.
2571 Really output inline functions that must actually be callable
2572 and have not been output so far. */
2575 int len = list_length (globals);
2576 tree *vec = (tree *) alloca (sizeof (tree) * len);
2581 /* Process the decls in reverse order--earliest first.
2582 Put them into VEC from back to front, then take out from front. */
2584 for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
2585 vec[len - i - 1] = decl;
2587 for (i = 0; i < len; i++)
2591 /* We're not deferring this any longer. */
2592 DECL_DEFER_OUTPUT (decl) = 0;
2594 if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0
2595 && incomplete_decl_finalize_hook != 0)
2596 (*incomplete_decl_finalize_hook) (decl);
2599 /* Now emit any global variables or functions that we have been putting
2600 off. We need to loop in case one of the things emitted here
2601 references another one which comes earlier in the list. */
2605 for (i = 0; i < len; i++)
2609 if (TREE_ASM_WRITTEN (decl) || DECL_EXTERNAL (decl))
2612 /* Don't write out static consts, unless we still need them.
2614 We also keep static consts if not optimizing (for debugging),
2615 unless the user specified -fno-keep-static-consts.
2616 ??? They might be better written into the debug information.
2617 This is possible when using DWARF.
2619 A language processor that wants static constants to be always
2620 written out (even if it is not used) is responsible for
2621 calling rest_of_decl_compilation itself. E.g. the C front-end
2622 calls rest_of_decl_compilation from finish_decl.
2623 One motivation for this is that is conventional in some
2624 environments to write things like:
2625 static const char rcsid[] = "... version string ...";
2626 intending to force the string to be in the executable.
2628 A language processor that would prefer to have unneeded
2629 static constants "optimized away" would just defer writing
2630 them out until here. E.g. C++ does this, because static
2631 constants are often defined in header files.
2633 ??? A tempting alternative (for both C and C++) would be
2634 to force a constant to be written if and only if it is
2635 defined in a main file, as opposed to an include file. */
2637 if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
2638 && (! TREE_READONLY (decl)
2639 || TREE_PUBLIC (decl)
2640 || (!optimize && flag_keep_static_consts)
2641 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
2644 rest_of_decl_compilation (decl, NULL_PTR, 1, 1);
2647 if (TREE_CODE (decl) == FUNCTION_DECL
2648 && DECL_INITIAL (decl) != 0
2649 && DECL_SAVED_INSNS (decl) != 0
2650 && (flag_keep_inline_functions
2651 || TREE_PUBLIC (decl)
2652 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
2655 temporary_allocation ();
2656 output_inline_function (decl);
2657 permanent_allocation (1);
2662 /* Now that all possible functions have been output, we can dump
2663 the exception table. */
2665 output_exception_table ();
2667 for (i = 0; i < len; i++)
2671 if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
2672 && ! TREE_ASM_WRITTEN (decl))
2673 /* Cancel the RTL for this decl so that, if debugging info
2674 output for global variables is still to come,
2675 this one will be omitted. */
2676 DECL_RTL (decl) = NULL;
2678 /* Warn about any function
2679 declared static but not defined.
2680 We don't warn about variables,
2681 because many programs have static variables
2682 that exist only to get some text into the object file. */
2683 if (TREE_CODE (decl) == FUNCTION_DECL
2685 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
2686 && DECL_INITIAL (decl) == 0
2687 && DECL_EXTERNAL (decl)
2688 && ! DECL_ARTIFICIAL (decl)
2689 && ! TREE_PUBLIC (decl))
2691 pedwarn_with_decl (decl,
2692 "`%s' declared `static' but never defined");
2693 /* This symbol is effectively an "extern" declaration now. */
2694 TREE_PUBLIC (decl) = 1;
2695 assemble_external (decl);
2698 /* Warn about static fns or vars defined but not used,
2699 but not about inline functions or static consts
2700 since defining those in header files is normal practice. */
2702 && ((TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
2703 || (TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
2704 && ! DECL_IN_SYSTEM_HEADER (decl)
2705 && ! DECL_EXTERNAL (decl)
2706 && ! TREE_PUBLIC (decl)
2707 && ! TREE_USED (decl)
2708 && (TREE_CODE (decl) == FUNCTION_DECL || ! DECL_REGISTER (decl))
2709 /* The TREE_USED bit for file-scope decls
2710 is kept in the identifier, to handle multiple
2711 external decls in different scopes. */
2712 && ! TREE_USED (DECL_NAME (decl)))
2713 warning_with_decl (decl, "`%s' defined but not used");
2715 #ifdef SDB_DEBUGGING_INFO
2716 /* The COFF linker can move initialized global vars to the end.
2717 And that can screw up the symbol ordering.
2718 By putting the symbols in that order to begin with,
2719 we avoid a problem. mcsun!unido!fauern!tumuc!pes@uunet.uu.net. */
2720 if (write_symbols == SDB_DEBUG && TREE_CODE (decl) == VAR_DECL
2721 && TREE_PUBLIC (decl) && DECL_INITIAL (decl)
2722 && ! DECL_EXTERNAL (decl)
2723 && DECL_RTL (decl) != 0)
2724 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
2726 /* Output COFF information for non-global
2727 file-scope initialized variables. */
2728 if (write_symbols == SDB_DEBUG
2729 && TREE_CODE (decl) == VAR_DECL
2730 && DECL_INITIAL (decl)
2731 && ! DECL_EXTERNAL (decl)
2732 && DECL_RTL (decl) != 0
2733 && GET_CODE (DECL_RTL (decl)) == MEM)
2734 TIMEVAR (symout_time, sdbout_toplevel_data (decl));
2735 #endif /* SDB_DEBUGGING_INFO */
2736 #ifdef DWARF_DEBUGGING_INFO
2737 /* Output DWARF information for file-scope tentative data object
2738 declarations, file-scope (extern) function declarations (which
2739 had no corresponding body) and file-scope tagged type declarations
2740 and definitions which have not yet been forced out. */
2742 if (write_symbols == DWARF_DEBUG
2743 && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
2744 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 1));
2746 #ifdef DWARF2_DEBUGGING_INFO
2747 /* Output DWARF2 information for file-scope tentative data object
2748 declarations, file-scope (extern) function declarations (which
2749 had no corresponding body) and file-scope tagged type declarations
2750 and definitions which have not yet been forced out. */
2752 if (write_symbols == DWARF2_DEBUG
2753 && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
2754 TIMEVAR (symout_time, dwarf2out_decl (decl));
2759 /* Write out any pending weak symbol declarations. */
2763 /* Do dbx symbols */
2764 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2765 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2766 TIMEVAR (symout_time,
2768 dbxout_finish (asm_out_file, main_input_filename);
2772 #ifdef DWARF_DEBUGGING_INFO
2773 if (write_symbols == DWARF_DEBUG)
2774 TIMEVAR (symout_time,
2780 #ifdef DWARF2_UNWIND_INFO
2781 if (dwarf2out_do_frame ())
2782 dwarf2out_frame_finish ();
2785 #ifdef DWARF2_DEBUGGING_INFO
2786 if (write_symbols == DWARF2_DEBUG)
2787 TIMEVAR (symout_time,
2789 dwarf2out_finish ();
2793 /* Output some stuff at end of file if nec. */
2795 if (!output_bytecode)
2797 end_final (dump_base_name);
2798 end_branch_prob (branch_prob_dump_file);
2801 ASM_FILE_END (asm_out_file);
2805 /* Language-specific end of compilation actions. */
2809 if (output_bytecode)
2810 bc_write_file (asm_out_file);
2812 /* Close the dump files. */
2814 if (flag_gen_aux_info)
2816 fclose (aux_info_file);
2818 unlink (aux_info_file_name);
2822 fclose (rtl_dump_file);
2825 fclose (jump_opt_dump_file);
2828 fclose (addressof_dump_file);
2831 fclose (cse_dump_file);
2834 fclose (loop_dump_file);
2837 fclose (cse2_dump_file);
2839 if (branch_prob_dump)
2840 fclose (branch_prob_dump_file);
2843 fclose (flow_dump_file);
2847 dump_combine_total_stats (combine_dump_file);
2848 fclose (combine_dump_file);
2852 fclose (regmove_dump_file);
2855 fclose (sched_dump_file);
2858 fclose (local_reg_dump_file);
2860 if (global_reg_dump)
2861 fclose (global_reg_dump_file);
2864 fclose (sched2_dump_file);
2867 fclose (jump2_opt_dump_file);
2870 fclose (dbr_sched_dump_file);
2874 fclose (stack_reg_dump_file);
2877 /* Close non-debugging input and output files. Take special care to note
2878 whether fclose returns an error, since the pages might still be on the
2879 buffer chain while the file is open. */
2886 if (ferror (asm_out_file) != 0 || fclose (asm_out_file) != 0)
2887 fatal_io_error (asm_file_name);
2889 /* Print the times. */
2893 fprintf (stderr,"\n");
2894 print_time ("parse", parse_time);
2896 if (!output_bytecode)
2898 print_time ("integration", integration_time);
2899 print_time ("jump", jump_time);
2900 print_time ("cse", cse_time);
2901 print_time ("loop", loop_time);
2902 print_time ("cse2", cse2_time);
2903 print_time ("branch-prob", branch_prob_time);
2904 print_time ("flow", flow_time);
2905 print_time ("combine", combine_time);
2906 print_time ("regmove", regmove_time);
2907 print_time ("sched", sched_time);
2908 print_time ("local-alloc", local_alloc_time);
2909 print_time ("global-alloc", global_alloc_time);
2910 print_time ("sched2", sched2_time);
2911 print_time ("dbranch", dbr_sched_time);
2912 print_time ("shorten-branch", shorten_branch_time);
2913 print_time ("stack-reg", stack_reg_time);
2914 print_time ("final", final_time);
2915 print_time ("varconst", varconst_time);
2916 print_time ("symout", symout_time);
2917 print_time ("dump", dump_time);
2922 /* This is called from various places for FUNCTION_DECL, VAR_DECL,
2923 and TYPE_DECL nodes.
2925 This does nothing for local (non-static) variables.
2926 Otherwise, it sets up the RTL and outputs any assembler code
2927 (label definition, storage allocation and initialization).
2929 DECL is the declaration. If ASMSPEC is nonzero, it specifies
2930 the assembler symbol name to be used. TOP_LEVEL is nonzero
2931 if this declaration is not within a function. */
2934 rest_of_decl_compilation (decl, asmspec, top_level, at_end)
2940 /* Declarations of variables, and of functions defined elsewhere. */
2942 /* The most obvious approach, to put an #ifndef around where
2943 this macro is used, doesn't work since it's inside a macro call. */
2944 #ifndef ASM_FINISH_DECLARE_OBJECT
2945 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
2948 /* Forward declarations for nested functions are not "external",
2949 but we need to treat them as if they were. */
2950 if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
2951 || TREE_CODE (decl) == FUNCTION_DECL)
2952 TIMEVAR (varconst_time,
2954 make_decl_rtl (decl, asmspec, top_level);
2955 /* Initialized extern variable exists to be replaced
2956 with its value, or represents something that will be
2957 output in another file. */
2958 if (! (TREE_CODE (decl) == VAR_DECL
2959 && DECL_EXTERNAL (decl) && TREE_READONLY (decl)
2960 && DECL_INITIAL (decl) != 0
2961 && DECL_INITIAL (decl) != error_mark_node))
2962 /* Don't output anything
2963 when a tentative file-scope definition is seen.
2964 But at end of compilation, do output code for them. */
2965 if (! (! at_end && top_level
2966 && (DECL_INITIAL (decl) == 0
2967 || DECL_INITIAL (decl) == error_mark_node)))
2968 assemble_variable (decl, top_level, at_end, 0);
2969 if (!output_bytecode
2970 && decl == last_assemble_variable_decl)
2972 ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
2976 else if (DECL_REGISTER (decl) && asmspec != 0)
2978 if (decode_reg_name (asmspec) >= 0)
2980 DECL_RTL (decl) = 0;
2981 make_decl_rtl (decl, asmspec, top_level);
2984 error ("invalid register name `%s' for register variable", asmspec);
2986 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2987 else if ((write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2988 && TREE_CODE (decl) == TYPE_DECL)
2989 TIMEVAR (symout_time, dbxout_symbol (decl, 0));
2991 #ifdef SDB_DEBUGGING_INFO
2992 else if (write_symbols == SDB_DEBUG && top_level
2993 && TREE_CODE (decl) == TYPE_DECL)
2994 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
2998 /* Called after finishing a record, union or enumeral type. */
3001 rest_of_type_compilation (type, toplev)
3005 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
3006 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
3007 TIMEVAR (symout_time, dbxout_symbol (TYPE_STUB_DECL (type), !toplev));
3009 #ifdef SDB_DEBUGGING_INFO
3010 if (write_symbols == SDB_DEBUG)
3011 TIMEVAR (symout_time, sdbout_symbol (TYPE_STUB_DECL (type), !toplev));
3015 /* This is called from finish_function (within yyparse)
3016 after each top-level definition is parsed.
3017 It is supposed to compile that function or variable
3018 and output the assembler code for it.
3019 After we return, the tree storage is freed. */
3022 rest_of_compilation (decl)
3026 int start_time = get_run_time ();
3028 /* Nonzero if we have saved the original DECL_INITIAL of the function,
3029 to be restored after we finish compiling the function
3030 (for use when compiling inline calls to this function). */
3031 tree saved_block_tree = 0;
3032 /* Likewise, for DECL_ARGUMENTS. */
3033 tree saved_arguments = 0;
3036 if (output_bytecode)
3039 /* If we are reconsidering an inline function
3040 at the end of compilation, skip the stuff for making it inline. */
3042 if (DECL_SAVED_INSNS (decl) == 0)
3047 /* If requested, consider whether to make this function inline. */
3048 if (DECL_INLINE (decl) || flag_inline_functions)
3049 TIMEVAR (integration_time,
3051 lose = function_cannot_inline_p (decl);
3052 if (lose || ! optimize)
3054 if (warn_inline && DECL_INLINE (decl))
3055 warning_with_decl (decl, lose);
3056 DECL_ABSTRACT_ORIGIN (decl) = 0;
3057 /* Don't really compile an extern inline function.
3058 If we can't make it inline, pretend
3059 it was only declared. */
3060 if (DECL_EXTERNAL (decl))
3062 DECL_INITIAL (decl) = 0;
3063 goto exit_rest_of_compilation;
3067 /* ??? Note that this has the effect of making it look
3068 like "inline" was specified for a function if we choose
3069 to inline it. This isn't quite right, but it's
3070 probably not worth the trouble to fix. */
3071 inlinable = DECL_INLINE (decl) = 1;
3074 insns = get_insns ();
3076 /* Dump the rtl code if we are dumping rtl. */
3081 fprintf (rtl_dump_file, "\n;; Function %s\n\n",
3082 (*decl_printable_name) (decl, 2));
3083 if (DECL_SAVED_INSNS (decl))
3084 fprintf (rtl_dump_file, ";; (integrable)\n\n");
3085 print_rtl (rtl_dump_file, insns);
3086 fflush (rtl_dump_file);
3089 /* If we can, defer compiling inlines until EOF.
3090 save_for_inline_copying can be extremely expensive. */
3091 if (inlinable && ! decl_function_context (decl))
3092 DECL_DEFER_OUTPUT (decl) = 1;
3094 /* If function is inline, and we don't yet know whether to
3095 compile it by itself, defer decision till end of compilation.
3096 finish_compilation will call rest_of_compilation again
3097 for those functions that need to be output. Also defer those
3098 functions that we are supposed to defer. We cannot defer
3099 functions containing nested functions since the nested function
3100 data is in our non-saved obstack. */
3102 /* If this is a nested inline, remove ADDRESSOF now so we can
3103 finish compiling ourselves. Otherwise, wait until EOF.
3104 We have to do this because the purge_addressof transformation
3105 changes the DECL_RTL for many variables, which confuses integrate. */
3108 if (decl_function_context (decl))
3109 purge_addressof (insns);
3111 DECL_DEFER_OUTPUT (decl) = 1;
3114 if (! current_function_contains_functions
3115 && (DECL_DEFER_OUTPUT (decl)
3116 || (DECL_INLINE (decl)
3117 && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
3118 && ! flag_keep_inline_functions)
3119 || DECL_EXTERNAL (decl)))))
3121 DECL_DEFER_OUTPUT (decl) = 1;
3123 /* If -Wreturn-type, we have to do a bit of compilation.
3124 However, if we just fall through we will call
3125 save_for_inline_copying() which results in excessive
3126 memory use. Instead, we just want to call
3127 jump_optimize() to figure out whether or not we can fall
3128 off the end of the function; we do the minimum amount of
3129 work necessary to make that safe. And, we set optimize
3130 to zero to keep jump_optimize from working too hard. */
3131 if (warn_return_type)
3133 int saved_optimize = optimize;
3135 find_exception_handler_labels ();
3136 jump_optimize (get_insns(), 0, 0, 0);
3137 optimize = saved_optimize;
3140 #ifdef DWARF_DEBUGGING_INFO
3141 /* Generate the DWARF info for the "abstract" instance
3142 of a function which we may later generate inlined and/or
3143 out-of-line instances of. */
3144 if (write_symbols == DWARF_DEBUG)
3146 set_decl_abstract_flags (decl, 1);
3147 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3148 set_decl_abstract_flags (decl, 0);
3151 #ifdef DWARF2_DEBUGGING_INFO
3152 /* Generate the DWARF2 info for the "abstract" instance
3153 of a function which we may later generate inlined and/or
3154 out-of-line instances of. */
3155 if (write_symbols == DWARF2_DEBUG)
3157 set_decl_abstract_flags (decl, 1);
3158 TIMEVAR (symout_time, dwarf2out_decl (decl));
3159 set_decl_abstract_flags (decl, 0);
3162 TIMEVAR (integration_time, save_for_inline_nocopy (decl));
3163 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlinable;
3164 goto exit_rest_of_compilation;
3167 /* If we have to compile the function now, save its rtl and subdecls
3168 so that its compilation will not affect what others get. */
3169 if (inlinable || DECL_DEFER_OUTPUT (decl))
3171 #ifdef DWARF_DEBUGGING_INFO
3172 /* Generate the DWARF info for the "abstract" instance of
3173 a function which we will generate an out-of-line instance
3174 of almost immediately (and which we may also later generate
3175 various inlined instances of). */
3176 if (write_symbols == DWARF_DEBUG)
3178 set_decl_abstract_flags (decl, 1);
3179 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3180 set_decl_abstract_flags (decl, 0);
3183 #ifdef DWARF2_DEBUGGING_INFO
3184 /* Generate the DWARF2 info for the "abstract" instance of
3185 a function which we will generate an out-of-line instance
3186 of almost immediately (and which we may also later generate
3187 various inlined instances of). */
3188 if (write_symbols == DWARF2_DEBUG)
3190 set_decl_abstract_flags (decl, 1);
3191 TIMEVAR (symout_time, dwarf2out_decl (decl));
3192 set_decl_abstract_flags (decl, 0);
3195 saved_block_tree = DECL_INITIAL (decl);
3196 saved_arguments = DECL_ARGUMENTS (decl);
3197 TIMEVAR (integration_time, save_for_inline_copying (decl));
3198 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlinable;
3201 /* If specified extern inline but we aren't inlining it, we are
3203 if (DECL_INLINE (decl) && DECL_EXTERNAL (decl))
3204 goto exit_rest_of_compilation;
3207 if (! DECL_DEFER_OUTPUT (decl))
3208 TREE_ASM_WRITTEN (decl) = 1;
3210 /* Now that integrate will no longer see our rtl, we need not distinguish
3211 between the return value of this function and the return value of called
3213 rtx_equal_function_value_matters = 0;
3215 /* Don't return yet if -Wreturn-type; we need to do jump_optimize. */
3216 if ((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
3218 goto exit_rest_of_compilation;
3221 /* Emit code to get eh context, if needed. */
3225 /* If we are doing position-independent code generation, now
3226 is the time to output special prologues and epilogues.
3227 We do not want to do this earlier, because it just clutters
3228 up inline functions with meaningless insns. */
3233 /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
3234 Note that that may have been done above, in save_for_inline_copying.
3235 The call to resume_temporary_allocation near the end of this function
3236 goes back to the usual state of affairs. This must be done after
3237 we've built up any unwinders for exception handling, and done
3238 the FINALIZE_PIC work, if necessary. */
3240 rtl_in_current_obstack ();
3242 insns = get_insns ();
3244 /* Copy any shared structure that should not be shared. */
3246 unshare_all_rtl (insns);
3248 /* Instantiate all virtual registers. */
3250 instantiate_virtual_regs (current_function_decl, get_insns ());
3252 /* See if we have allocated stack slots that are not directly addressable.
3253 If so, scan all the insns and create explicit address computation
3254 for all references to such slots. */
3255 /* fixup_stack_slots (); */
3257 /* Find all the EH handlers. */
3258 find_exception_handler_labels ();
3260 /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
3261 are initialized and to compute whether control can drop off the end
3263 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3264 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
3266 /* Now is when we stop if -fsyntax-only and -Wreturn-type. */
3267 if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
3268 goto exit_rest_of_compilation;
3270 /* Dump rtl code after jump, if we are doing that. */
3275 fprintf (jump_opt_dump_file, "\n;; Function %s\n\n",
3276 (*decl_printable_name) (decl, 2));
3277 print_rtl (jump_opt_dump_file, insns);
3278 fflush (jump_opt_dump_file);
3281 /* Perform common subexpression elimination.
3282 Nonzero value from `cse_main' means that jumps were simplified
3283 and some code may now be unreachable, so do
3284 jump optimization again. */
3289 fprintf (cse_dump_file, "\n;; Function %s\n\n",
3290 (*decl_printable_name) (decl, 2));
3295 TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1));
3297 if (flag_thread_jumps)
3298 /* Hacks by tiemann & kenner. */
3299 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 1));
3301 TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (),
3303 TIMEVAR (cse_time, delete_dead_from_cse (insns, max_reg_num ()));
3305 if (tem || optimize > 1)
3306 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0));
3309 /* Dump rtl code after cse, if we are doing that. */
3314 print_rtl (cse_dump_file, insns);
3315 fflush (cse_dump_file);
3318 purge_addressof (insns);
3319 reg_scan (insns, max_reg_num (), 1);
3324 fprintf (addressof_dump_file, "\n;; Function %s\n\n",
3325 (*decl_printable_name) (decl, 2));
3326 print_rtl (addressof_dump_file, insns);
3327 fflush (addressof_dump_file);
3333 fprintf (loop_dump_file, "\n;; Function %s\n\n",
3334 (*decl_printable_name) (decl, 2));
3337 /* Move constant computations out of loops. */
3343 if (flag_rerun_loop_opt)
3345 /* We only want to perform unrolling once. */
3347 loop_optimize (insns, loop_dump_file, 0);
3349 /* The regscan pass may not be necessary, but let's
3350 be safe until we can prove otherwise. */
3351 reg_scan (insns, max_reg_num (), 1);
3353 loop_optimize (insns, loop_dump_file, flag_unroll_loops);
3357 /* Dump rtl code after loop opt, if we are doing that. */
3362 print_rtl (loop_dump_file, insns);
3363 fflush (loop_dump_file);
3369 fprintf (cse2_dump_file, "\n;; Function %s\n\n",
3370 (*decl_printable_name) (decl, 2));
3373 if (optimize > 0 && flag_rerun_cse_after_loop)
3375 /* Running another jump optimization pass before the second
3376 cse pass sometimes simplifies the RTL enough to allow
3377 the second CSE pass to do a better job. Jump_optimize can change
3378 max_reg_num so we must rerun reg_scan afterwards.
3379 ??? Rework to not call reg_scan so often. */
3380 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3381 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
3383 TIMEVAR (cse2_time, reg_scan (insns, max_reg_num (), 0));
3384 TIMEVAR (cse2_time, tem = cse_main (insns, max_reg_num (),
3385 1, cse2_dump_file));
3387 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0));
3390 if (optimize > 0 && flag_thread_jumps)
3392 /* This pass of jump threading straightens out code
3393 that was kinked by loop optimization. */
3394 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3395 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
3397 /* Dump rtl code after cse, if we are doing that. */
3402 print_rtl (cse2_dump_file, insns);
3403 fflush (cse2_dump_file);
3406 if (branch_prob_dump)
3409 fprintf (branch_prob_dump_file, "\n;; Function %s\n\n",
3410 (*decl_printable_name) (decl, 2));
3413 if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
3414 TIMEVAR (branch_prob_time,
3416 branch_prob (insns, branch_prob_dump_file);
3419 if (branch_prob_dump)
3422 print_rtl (branch_prob_dump_file, insns);
3423 fflush (branch_prob_dump_file);
3425 /* We are no longer anticipating cse in this function, at least. */
3427 cse_not_expected = 1;
3429 /* Now we choose between stupid (pcc-like) register allocation
3430 (if we got the -noreg switch and not -opt)
3431 and smart register allocation. */
3433 if (optimize > 0) /* Stupid allocation probably won't work */
3434 obey_regdecls = 0; /* if optimizations being done. */
3438 /* Print function header into flow dump now
3439 because doing the flow analysis makes some of the dump. */
3444 fprintf (flow_dump_file, "\n;; Function %s\n\n",
3445 (*decl_printable_name) (decl, 2));
3452 regclass (insns, max_reg_num ());
3453 stupid_life_analysis (insns, max_reg_num (),
3459 /* Do control and data flow analysis,
3460 and write some of the results to dump file. */
3462 TIMEVAR (flow_time, flow_analysis (insns, max_reg_num (),
3464 if (warn_uninitialized)
3466 uninitialized_vars_warning (DECL_INITIAL (decl));
3467 setjmp_args_warning ();
3471 /* Dump rtl after flow analysis. */
3476 print_rtl_with_bb (flow_dump_file, insns);
3477 fflush (flow_dump_file);
3480 /* If -opt, try combining insns through substitution. */
3483 TIMEVAR (combine_time, combine_instructions (insns, max_reg_num ()));
3485 /* Dump rtl code after insn combination. */
3490 fprintf (combine_dump_file, "\n;; Function %s\n\n",
3491 (*decl_printable_name) (decl, 2));
3492 dump_combine_stats (combine_dump_file);
3493 print_rtl_with_bb (combine_dump_file, insns);
3494 fflush (combine_dump_file);
3500 fprintf (regmove_dump_file, "\n;; Function %s\n\n",
3501 (*decl_printable_name) (decl, 2));
3504 /* Register allocation pre-pass, to reduce number of moves
3505 necessary for two-address machines. */
3506 if (optimize > 0 && flag_regmove)
3507 TIMEVAR (regmove_time, regmove_optimize (insns, max_reg_num (),
3508 regmove_dump_file));
3513 print_rtl_with_bb (regmove_dump_file, insns);
3514 fflush (regmove_dump_file);
3517 /* Print function header into sched dump now
3518 because doing the sched analysis makes some of the dump. */
3523 fprintf (sched_dump_file, "\n;; Function %s\n\n",
3524 (*decl_printable_name) (decl, 2));
3527 if (optimize > 0 && flag_schedule_insns)
3529 /* Do control and data sched analysis,
3530 and write some of the results to dump file. */
3532 TIMEVAR (sched_time, schedule_insns (sched_dump_file));
3535 /* Dump rtl after instruction scheduling. */
3540 print_rtl_with_bb (sched_dump_file, insns);
3541 fflush (sched_dump_file);
3544 /* Unless we did stupid register allocation,
3545 allocate pseudo-regs that are used only within 1 basic block. */
3548 TIMEVAR (local_alloc_time,
3550 regclass (insns, max_reg_num ());
3554 /* Dump rtl code after allocating regs within basic blocks. */
3559 fprintf (local_reg_dump_file, "\n;; Function %s\n\n",
3560 (*decl_printable_name) (decl, 2));
3561 dump_flow_info (local_reg_dump_file);
3562 dump_local_alloc (local_reg_dump_file);
3563 print_rtl_with_bb (local_reg_dump_file, insns);
3564 fflush (local_reg_dump_file);
3567 if (global_reg_dump)
3569 fprintf (global_reg_dump_file, "\n;; Function %s\n\n",
3570 (*decl_printable_name) (decl, 2)));
3572 /* Save the last label number used so far, so reorg can tell
3573 when it's safe to kill spill regs. */
3574 max_label_num_after_reload = max_label_num ();
3576 /* Unless we did stupid register allocation,
3577 allocate remaining pseudo-regs, then do the reload pass
3578 fixing up any insns that are invalid. */
3580 TIMEVAR (global_alloc_time,
3583 failure = global_alloc (global_reg_dump_file);
3585 failure = reload (insns, 0, global_reg_dump_file);
3588 if (global_reg_dump)
3591 dump_global_regs (global_reg_dump_file);
3592 print_rtl_with_bb (global_reg_dump_file, insns);
3593 fflush (global_reg_dump_file);
3597 goto exit_rest_of_compilation;
3599 reload_completed = 1;
3601 /* Do a very simple CSE pass over just the hard registers. */
3603 reload_cse_regs (insns);
3605 /* On some machines, the prologue and epilogue code, or parts thereof,
3606 can be represented as RTL. Doing so lets us schedule insns between
3607 it and the rest of the code and also allows delayed branch
3608 scheduling to operate in the epilogue. */
3610 thread_prologue_and_epilogue_insns (insns);
3612 if (optimize > 0 && flag_schedule_insns_after_reload)
3617 fprintf (sched2_dump_file, "\n;; Function %s\n\n",
3618 (*decl_printable_name) (decl, 2));
3621 /* Do control and data sched analysis again,
3622 and write some more of the results to dump file. */
3624 TIMEVAR (sched2_time, schedule_insns (sched2_dump_file));
3626 /* Dump rtl after post-reorder instruction scheduling. */
3631 print_rtl_with_bb (sched2_dump_file, insns);
3632 fflush (sched2_dump_file);
3636 #ifdef LEAF_REGISTERS
3638 if (optimize > 0 && only_leaf_regs_used () && leaf_function_p ())
3642 /* One more attempt to remove jumps to .+1
3643 left by dead-store-elimination.
3644 Also do cross-jumping this time
3645 and delete no-op move insns. */
3649 TIMEVAR (jump_time, jump_optimize (insns, 1, 1, 0));
3652 /* Dump rtl code after jump, if we are doing that. */
3657 fprintf (jump2_opt_dump_file, "\n;; Function %s\n\n",
3658 (*decl_printable_name) (decl, 2));
3659 print_rtl_with_bb (jump2_opt_dump_file, insns);
3660 fflush (jump2_opt_dump_file);
3663 /* If a machine dependent reorganization is needed, call it. */
3664 #ifdef MACHINE_DEPENDENT_REORG
3665 MACHINE_DEPENDENT_REORG (insns);
3668 /* If a scheduling pass for delayed branches is to be done,
3669 call the scheduling code. */
3672 if (optimize > 0 && flag_delayed_branch)
3674 TIMEVAR (dbr_sched_time, dbr_schedule (insns, dbr_sched_dump_file));
3679 fprintf (dbr_sched_dump_file, "\n;; Function %s\n\n",
3680 (*decl_printable_name) (decl, 2));
3681 print_rtl_with_bb (dbr_sched_dump_file, insns);
3682 fflush (dbr_sched_dump_file);
3688 /* Shorten branches. */
3689 TIMEVAR (shorten_branch_time,
3691 shorten_branches (get_insns ());
3695 TIMEVAR (stack_reg_time, reg_to_stack (insns, stack_reg_dump_file));
3700 fprintf (stack_reg_dump_file, "\n;; Function %s\n\n",
3701 (*decl_printable_name) (decl, 2));
3702 print_rtl_with_bb (stack_reg_dump_file, insns);
3703 fflush (stack_reg_dump_file);
3708 /* Now turn the rtl into assembler code. */
3710 TIMEVAR (final_time,
3715 /* Get the function's name, as described by its RTL.
3716 This may be different from the DECL_NAME name used
3717 in the source file. */
3719 x = DECL_RTL (decl);
3720 if (GET_CODE (x) != MEM)
3723 if (GET_CODE (x) != SYMBOL_REF)
3725 fnname = XSTR (x, 0);
3727 assemble_start_function (decl, fnname);
3728 final_start_function (insns, asm_out_file, optimize);
3729 final (insns, asm_out_file, optimize, 0);
3730 final_end_function (insns, asm_out_file, optimize);
3731 assemble_end_function (decl, fnname);
3732 fflush (asm_out_file);
3734 /* Release all memory held by regsets now */
3735 regset_release_memory ();
3738 /* Write DBX symbols if requested */
3740 /* Note that for those inline functions where we don't initially
3741 know for certain that we will be generating an out-of-line copy,
3742 the first invocation of this routine (rest_of_compilation) will
3743 skip over this code by doing a `goto exit_rest_of_compilation;'.
3744 Later on, finish_compilation will call rest_of_compilation again
3745 for those inline functions that need to have out-of-line copies
3746 generated. During that call, we *will* be routed past here. */
3748 #ifdef DBX_DEBUGGING_INFO
3749 if (write_symbols == DBX_DEBUG)
3750 TIMEVAR (symout_time, dbxout_function (decl));
3753 #ifdef DWARF_DEBUGGING_INFO
3754 if (write_symbols == DWARF_DEBUG)
3755 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3758 #ifdef DWARF2_DEBUGGING_INFO
3759 if (write_symbols == DWARF2_DEBUG)
3760 TIMEVAR (symout_time, dwarf2out_decl (decl));
3763 exit_rest_of_compilation:
3765 /* In case the function was not output,
3766 don't leave any temporary anonymous types
3767 queued up for sdb output. */
3768 #ifdef SDB_DEBUGGING_INFO
3769 if (write_symbols == SDB_DEBUG)
3770 sdbout_types (NULL_TREE);
3773 /* Put back the tree of subblocks and list of arguments
3774 from before we copied them.
3775 Code generation and the output of debugging info may have modified
3776 the copy, but the original is unchanged. */
3778 if (saved_block_tree != 0)
3780 DECL_INITIAL (decl) = saved_block_tree;
3781 DECL_ARGUMENTS (decl) = saved_arguments;
3782 DECL_ABSTRACT_ORIGIN (decl) = NULL_TREE;
3785 reload_completed = 0;
3787 /* Clear out the insn_length contents now that they are no longer valid. */
3788 init_insn_lengths ();
3790 /* Clear out the real_constant_chain before some of the rtx's
3791 it runs through become garbage. */
3793 clear_const_double_mem ();
3795 /* Cancel the effect of rtl_in_current_obstack. */
3797 resume_temporary_allocation ();
3799 /* Show no temporary slots allocated. */
3803 /* The parsing time is all the time spent in yyparse
3804 *except* what is spent in this function. */
3806 parse_time -= get_run_time () - start_time;
3809 /* Entry point of cc1/c++. Decode command args, then call compile_file.
3810 Exit code is 35 if can't open files, 34 if fatal error,
3811 33 if had nonfatal errors, else success. */
3814 main (argc, argv, envp)
3821 int flag_print_mem = 0;
3822 int version_flag = 0;
3825 /* save in case md file wants to emit args as a comment. */
3829 p = argv[0] + strlen (argv[0]);
3830 while (p != argv[0] && p[-1] != '/'
3831 #ifdef DIR_SEPARATOR
3832 && p[-1] != DIR_SEPARATOR
3838 #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
3839 /* Get rid of any avoidable limit on stack size. */
3843 /* Set the stack limit huge so that alloca does not fail. */
3844 getrlimit (RLIMIT_STACK, &rlim);
3845 rlim.rlim_cur = rlim.rlim_max;
3846 setrlimit (RLIMIT_STACK, &rlim);
3848 #endif /* RLIMIT_STACK */
3850 signal (SIGFPE, float_signal);
3853 signal (SIGPIPE, pipe_closed);
3856 decl_printable_name = decl_name;
3857 lang_expand_expr = (struct rtx_def *(*)()) do_abort;
3859 /* Initialize whether `char' is signed. */
3860 flag_signed_char = DEFAULT_SIGNED_CHAR;
3861 #ifdef DEFAULT_SHORT_ENUMS
3862 /* Initialize how much space enums occupy, by default. */
3863 flag_short_enums = DEFAULT_SHORT_ENUMS;
3866 /* Scan to see what optimization level has been specified. That will
3867 determine the default value of many flags. */
3868 for (i = 1; i < argc; i++)
3870 if (!strcmp (argv[i], "-O"))
3874 else if (argv[i][0] == '-' && argv[i][1] == 'O')
3876 /* Handle -O2, -O3, -O69, ... */
3877 char *p = &argv[i][2];
3881 if (! (c >= '0' && c <= '9'))
3884 optimize = atoi (&argv[i][2]);
3888 obey_regdecls = (optimize == 0);
3893 flag_thread_jumps = 1;
3895 flag_delayed_branch = 1;
3897 #ifdef CAN_DEBUG_WITHOUT_FP
3898 flag_omit_frame_pointer = 1;
3900 flag_alias_check = 1;
3905 flag_cse_follow_jumps = 1;
3906 flag_cse_skip_blocks = 1;
3907 flag_expensive_optimizations = 1;
3908 flag_strength_reduce = 1;
3909 flag_rerun_cse_after_loop = 1;
3910 flag_rerun_loop_opt = 1;
3911 flag_caller_saves = 1;
3913 #ifdef INSN_SCHEDULING
3914 flag_schedule_insns = 1;
3915 flag_schedule_insns_after_reload = 1;
3922 flag_inline_functions = 1;
3925 /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
3928 set_target_switch ("");
3930 #ifdef OPTIMIZATION_OPTIONS
3931 /* Allow default optimizations to be specified on a per-machine basis. */
3932 OPTIMIZATION_OPTIONS (optimize);
3935 /* Initialize register usage now so switches may override. */
3938 for (i = 1; i < argc; i++)
3941 /* If this is a language-specific option,
3942 decode it in a language-specific way. */
3943 for (j = 0; lang_options[j] != 0; j++)
3944 if (!strncmp (argv[i], lang_options[j],
3945 strlen (lang_options[j])))
3947 if (lang_options[j] != 0)
3948 /* If the option is valid for *some* language,
3949 treat it as valid even if this language doesn't understand it. */
3950 lang_decode_option (argv[i]);
3951 else if (argv[i][0] == '-' && argv[i][1] != 0)
3953 register char *str = argv[i] + 1;
3958 set_target_switch (&str[1]);
3959 else if (!strcmp (str, "dumpbase"))
3961 dump_base_name = argv[++i];
3963 else if (str[0] == 'd')
3965 register char *p = &str[1];
3970 branch_prob_dump = 1;
3974 global_reg_dump = 1;
3982 cse_dump = 1, cse2_dump = 1;
3988 branch_prob_dump = 1;
4003 global_reg_dump = 1;
4024 flag_print_asm_name = 1;
4048 rtl_dump_and_exit = 1;
4055 else if (str[0] == 'f')
4057 register char *p = &str[1];
4060 /* Some kind of -f option.
4061 P's value is the option sans `-f'.
4062 Search for it in the table of options. */
4065 !found && j < sizeof (f_options) / sizeof (f_options[0]);
4068 if (!strcmp (p, f_options[j].string))
4070 *f_options[j].variable = f_options[j].on_value;
4071 /* A goto here would be cleaner,
4072 but breaks the vax pcc. */
4075 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
4076 && ! strcmp (p+3, f_options[j].string))
4078 *f_options[j].variable = ! f_options[j].on_value;
4086 #ifdef INSN_SCHEDULING
4087 else if (!strncmp (p, "sched-verbose-",14))
4088 fix_sched_param("verbose",&p[14]);
4089 else if (!strncmp (p, "sched-max-",10))
4090 fix_sched_param("max",&p[10]);
4091 else if (!strncmp (p, "sched-inter-max-b-",18))
4092 fix_sched_param("interblock-max-blocks",&p[18]);
4093 else if (!strncmp (p, "sched-inter-max-i-",18))
4094 fix_sched_param("interblock-max-insns",&p[18]);
4097 else if (!strncmp (p, "fixed-", 6))
4098 fix_register (&p[6], 1, 1);
4099 else if (!strncmp (p, "call-used-", 10))
4100 fix_register (&p[10], 0, 1);
4101 else if (!strncmp (p, "call-saved-", 11))
4102 fix_register (&p[11], 0, 0);
4104 error ("Invalid option `%s'", argv[i]);
4106 else if (str[0] == 'O')
4108 register char *p = str+1;
4109 while (*p && *p >= '0' && *p <= '9')
4114 error ("Invalid option `%s'", argv[i]);
4116 else if (!strcmp (str, "pedantic"))
4118 else if (!strcmp (str, "pedantic-errors"))
4119 flag_pedantic_errors = pedantic = 1;
4120 else if (!strcmp (str, "quiet"))
4122 else if (!strcmp (str, "version"))
4124 else if (!strcmp (str, "w"))
4125 inhibit_warnings = 1;
4126 else if (!strcmp (str, "W"))
4129 /* We save the value of warn_uninitialized, since if they put
4130 -Wuninitialized on the command line, we need to generate a
4131 warning about not using it without also specifying -O. */
4132 if (warn_uninitialized != 1)
4133 warn_uninitialized = 2;
4135 else if (str[0] == 'W')
4137 register char *p = &str[1];
4140 /* Some kind of -W option.
4141 P's value is the option sans `-W'.
4142 Search for it in the table of options. */
4145 !found && j < sizeof (W_options) / sizeof (W_options[0]);
4148 if (!strcmp (p, W_options[j].string))
4150 *W_options[j].variable = W_options[j].on_value;
4151 /* A goto here would be cleaner,
4152 but breaks the vax pcc. */
4155 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
4156 && ! strcmp (p+3, W_options[j].string))
4158 *W_options[j].variable = ! W_options[j].on_value;
4165 else if (!strncmp (p, "id-clash-", 9))
4171 if (*endp >= '0' && *endp <= '9')
4175 error ("Invalid option `%s'", argv[i]);
4180 id_clash_len = atoi (str + 10);
4183 else if (!strncmp (p, "larger-than-", 12))
4185 char *endp = p + 12;
4189 if (*endp >= '0' && *endp <= '9')
4193 error ("Invalid option `%s'", argv[i]);
4194 goto larger_than_lose;
4197 warn_larger_than = 1;
4198 larger_than_size = atoi (str + 13);
4202 error ("Invalid option `%s'", argv[i]);
4204 else if (!strcmp (str, "p"))
4208 else if (!strcmp (str, "a"))
4210 #if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4211 warning ("`-a' option (basic block profile) not supported");
4213 profile_block_flag = (profile_block_flag < 2) ? 1 : 3;
4216 else if (!strcmp (str, "ax"))
4218 #if !defined (FUNCTION_BLOCK_PROFILER_EXIT) || !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4219 warning ("`-ax' option (jump profiling) not supported");
4221 profile_block_flag = (!profile_block_flag
4222 || profile_block_flag == 2) ? 2 : 3;
4225 else if (str[0] == 'g')
4229 /* A lot of code assumes write_symbols == NO_DEBUG if the
4230 debugging level is 0 (thus -gstabs1 -gstabs0 would lose track
4231 of what debugging type has been selected). This records the
4232 selected type. It is an error to specify more than one
4234 static enum debug_info_type selected_debug_type = NO_DEBUG;
4235 /* Non-zero if debugging format has been explicitly set.
4236 -g and -ggdb don't explicitly set the debugging format so
4237 -gdwarf -g3 is equivalent to -gdwarf3. */
4238 static int type_explicitly_set_p = 0;
4239 /* Table of supported debugging formats. */
4242 /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
4243 constant expression, we use NO_DEBUG in its place. */
4244 enum debug_info_type debug_type;
4245 int use_extensions_p;
4246 } *da, debug_args[] = {
4247 { "g", NO_DEBUG, DEFAULT_GDB_EXTENSIONS },
4248 { "ggdb", NO_DEBUG, 1 },
4249 #ifdef DBX_DEBUGGING_INFO
4250 { "gstabs", DBX_DEBUG, 0 },
4251 { "gstabs+", DBX_DEBUG, 1 },
4253 #ifdef DWARF_DEBUGGING_INFO
4254 { "gdwarf", DWARF_DEBUG, 0 },
4255 { "gdwarf+", DWARF_DEBUG, 1 },
4257 #ifdef DWARF2_DEBUGGING_INFO
4258 { "gdwarf-2", DWARF2_DEBUG, 0 },
4260 #ifdef XCOFF_DEBUGGING_INFO
4261 { "gxcoff", XCOFF_DEBUG, 0 },
4262 { "gxcoff+", XCOFF_DEBUG, 1 },
4264 #ifdef SDB_DEBUGGING_INFO
4265 { "gcoff", SDB_DEBUG, 0 },
4269 /* Indexed by enum debug_info_type. */
4270 static char *debug_type_names[] = {
4271 "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
4274 /* Look up STR in the table. */
4275 for (da = debug_args; da->arg; da++)
4277 if (! strncmp (str, da->arg, strlen (da->arg)))
4279 enum debug_info_type type = da->debug_type;
4282 p = str + strlen (da->arg);
4283 if (*p && (*p < '0' || *p > '9'))
4287 while (*q && (*q >= '0' && *q <= '9'))
4292 if (len > 1 && !strncmp (str, "gdwarf", len))
4294 error ("use -gdwarf -g%d for DWARF v1, level %d",
4297 error ("use -gdwarf-2 for DWARF v2");
4301 level = 2; /* default debugging info level */
4302 if (*q || level > 3)
4304 warning ("invalid debug level specification in option: `-%s'",
4306 /* ??? This error message is incorrect in the case of
4308 warning ("no debugging information will be generated");
4312 if (type == NO_DEBUG)
4314 type = PREFERRED_DEBUGGING_TYPE;
4315 if (len > 1 && strncmp (str, "ggdb", len) == 0)
4317 #ifdef DWARF2_DEBUGGING_INFO
4318 type = DWARF2_DEBUG;
4320 #ifdef DBX_DEBUGGING_INFO
4327 if (type == NO_DEBUG)
4328 warning ("`-%s' not supported by this configuration of GCC",
4331 /* Does it conflict with an already selected type? */
4332 if (type_explicitly_set_p
4333 /* -g/-ggdb don't conflict with anything */
4334 && da->debug_type != NO_DEBUG
4335 && type != selected_debug_type)
4336 warning ("`-%s' ignored, conflicts with `-g%s'",
4337 str, debug_type_names[(int) selected_debug_type]);
4340 /* If the format has already been set, -g/-ggdb
4341 only change the debug level. */
4342 if (type_explicitly_set_p
4343 && da->debug_type == NO_DEBUG)
4344 ; /* don't change debugging type */
4347 selected_debug_type = type;
4348 type_explicitly_set_p = da->debug_type != NO_DEBUG;
4350 write_symbols = (level == 0
4352 : selected_debug_type);
4353 use_gnu_debug_info_extensions = da->use_extensions_p;
4354 debug_info_level = (enum debug_info_level) level;
4360 warning ("`-%s' not supported by this configuration of GCC",
4363 else if (!strcmp (str, "o"))
4365 asm_file_name = argv[++i];
4367 else if (str[0] == 'G')
4369 g_switch_set = TRUE;
4370 g_switch_value = atoi ((str[1] != '\0') ? str+1 : argv[++i]);
4372 else if (!strncmp (str, "aux-info", 8))
4374 flag_gen_aux_info = 1;
4375 aux_info_file_name = (str[8] != '\0' ? str+8 : argv[++i]);
4378 error ("Invalid option `%s'", argv[i]);
4380 else if (argv[i][0] == '+')
4381 error ("Invalid option `%s'", argv[i]);
4386 /* Checker uses the frame pointer. */
4387 if (flag_check_memory_usage)
4388 flag_omit_frame_pointer = 0;
4390 /* Initialize for bytecode output. A good idea to do this as soon as
4391 possible after the "-f" options have been parsed. */
4392 if (output_bytecode)
4394 #ifndef TARGET_SUPPORTS_BYTECODE
4395 /* Just die with a fatal error if not supported */
4396 fatal ("-fbytecode not supported for this target");
4404 /* Inlining does not work if not optimizing,
4405 so force it not to be done. */
4409 /* The c_decode_option and lang_decode_option functions set
4410 this to `2' if -Wall is used, so we can avoid giving out
4411 lots of errors for people who don't realize what -Wall does. */
4412 if (warn_uninitialized == 1)
4413 warning ("-Wuninitialized is not supported without -O");
4416 #ifdef OVERRIDE_OPTIONS
4417 /* Some machines may reject certain combinations of options. */
4421 if (exceptions_via_longjmp == 2)
4423 #ifdef DWARF2_UNWIND_INFO
4424 exceptions_via_longjmp = ! DWARF2_UNWIND_INFO;
4426 exceptions_via_longjmp = 1;
4430 if (profile_block_flag == 3)
4432 warning ("`-ax' and `-a' are conflicting options. `-a' ignored.");
4433 profile_block_flag = 2;
4436 /* Unrolling all loops implies that standard loop unrolling must also
4438 if (flag_unroll_all_loops)
4439 flag_unroll_loops = 1;
4440 /* Loop unrolling requires that strength_reduction be on also. Silently
4441 turn on strength reduction here if it isn't already on. Also, the loop
4442 unrolling code assumes that cse will be run after loop, so that must
4443 be turned on also. */
4444 if (flag_unroll_loops)
4446 flag_strength_reduce = 1;
4447 flag_rerun_cse_after_loop = 1;
4450 /* Warn about options that are not supported on this machine. */
4451 #ifndef INSN_SCHEDULING
4452 if (flag_schedule_insns || flag_schedule_insns_after_reload)
4453 warning ("instruction scheduling not supported on this target machine");
4456 if (flag_delayed_branch)
4457 warning ("this target machine does not have delayed branches");
4460 /* If we are in verbose mode, write out the version and maybe all the
4461 option flags in use. */
4464 print_version (stderr, "");
4466 print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
4469 compile_file (filename);
4471 #if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN32__))
4474 char *lim = (char *) sbrk (0);
4476 fprintf (stderr, "Data size %d.\n",
4477 lim - (char *) &environ);
4482 system ("ps -l 1>&2");
4485 #endif /* not USG */
4488 #endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN32) */
4491 exit (FATAL_EXIT_CODE);
4493 exit (FATAL_EXIT_CODE);
4494 exit (SUCCESS_EXIT_CODE);
4498 /* Decode -m switches. */
4500 /* Here is a table, controlled by the tm.h file, listing each -m switch
4501 and which bits in `target_switches' it should set or clear.
4502 If VALUE is positive, it is bits to set.
4503 If VALUE is negative, -VALUE is bits to clear.
4504 (The sign bit is not used so there is no confusion.) */
4506 struct {char *name; int value;} target_switches []
4509 /* This table is similar, but allows the switch to have a value. */
4511 #ifdef TARGET_OPTIONS
4512 struct {char *prefix; char ** variable;} target_options []
4516 /* Decode the switch -mNAME. */
4519 set_target_switch (name)
4525 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
4526 if (!strcmp (target_switches[j].name, name))
4528 if (target_switches[j].value < 0)
4529 target_flags &= ~-target_switches[j].value;
4531 target_flags |= target_switches[j].value;
4535 #ifdef TARGET_OPTIONS
4537 for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
4539 int len = strlen (target_options[j].prefix);
4540 if (!strncmp (target_options[j].prefix, name, len))
4542 *target_options[j].variable = name + len;
4549 error ("Invalid option `%s'", name);
4552 /* Print version information to FILE.
4553 Each line begins with INDENT (for the case where FILE is the
4554 assembler output file). */
4557 print_version (file, indent)
4561 fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
4562 language_string, version_string);
4563 fprintf (file, " (%s)", TARGET_NAME);
4566 #define __VERSION__ "[unknown]"
4568 fprintf (file, " compiled by GNU C version %s.\n", __VERSION__);
4570 fprintf (file, " compiled by CC.\n");
4574 /* Print an option value and return the adjusted position in the line.
4575 ??? We don't handle error returns from fprintf (disk full); presumably
4576 other code will catch a disk full though. */
4579 print_single_switch (file, pos, max, indent, sep, term, type, name)
4582 char *indent, *sep, *term, *type, *name;
4584 /* The ultrix fprintf returns 0 on success, so compute the result we want
4585 here since we need it for the following test. */
4586 int len = strlen (sep) + strlen (type) + strlen (name);
4591 fprintf (file, "%s", term);
4596 fprintf (file, "%s", indent);
4597 pos = strlen (indent);
4599 fprintf (file, "%s%s%s", sep, type, name);
4604 /* Print active target switches to FILE.
4605 POS is the current cursor position and MAX is the size of a "line".
4606 Each line begins with INDENT and ends with TERM.
4607 Each switch is separated from the next by SEP. */
4610 print_switch_values (file, pos, max, indent, sep, term)
4613 char *indent, *sep, *term;
4618 /* Print the options as passed. */
4620 pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
4621 "options passed: ", "");
4623 for (p = &save_argv[1]; *p != NULL; p++)
4627 if (strcmp (*p, "-o") == 0)
4633 if (strcmp (*p, "-quiet") == 0)
4635 if (strcmp (*p, "-version") == 0)
4640 pos = print_single_switch (file, pos, max, indent, sep, term, *p, "");
4643 fprintf (file, "%s", term);
4645 /* Print the -f and -m options that have been enabled.
4646 We don't handle language specific options but printing argv
4649 pos = print_single_switch (file, 0, max, indent, *indent ? " " : "", term,
4650 "options enabled: ", "");
4652 for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++)
4653 if (*f_options[j].variable == f_options[j].on_value)
4654 pos = print_single_switch (file, pos, max, indent, sep, term,
4655 "-f", f_options[j].string);
4657 /* Print target specific options. */
4659 flags = target_flags;
4660 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
4661 if (target_switches[j].name[0] != '\0'
4662 && target_switches[j].value > 0
4663 && ((target_switches[j].value & target_flags)
4664 == target_switches[j].value))
4666 pos = print_single_switch (file, pos, max, indent, sep, term,
4667 "-m", target_switches[j].name);
4668 flags &= ~ target_switches[j].value;
4671 #ifdef TARGET_OPTIONS
4672 for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
4673 if (*target_options[j].variable != NULL)
4676 sprintf (prefix, "-m%s", target_options[j].prefix);
4677 pos = print_single_switch (file, pos, max, indent, sep, term,
4678 prefix, *target_options[j].variable);
4682 fprintf (file, "%s", term);
4685 /* Record the beginning of a new source file, named FILENAME. */
4688 debug_start_source_file (filename)
4689 register char *filename;
4691 #ifdef DBX_DEBUGGING_INFO
4692 if (write_symbols == DBX_DEBUG)
4693 dbxout_start_new_source_file (filename);
4695 #ifdef DWARF_DEBUGGING_INFO
4696 if (debug_info_level == DINFO_LEVEL_VERBOSE
4697 && write_symbols == DWARF_DEBUG)
4698 dwarfout_start_new_source_file (filename);
4699 #endif /* DWARF_DEBUGGING_INFO */
4700 #ifdef DWARF2_DEBUGGING_INFO
4701 if (debug_info_level == DINFO_LEVEL_VERBOSE
4702 && write_symbols == DWARF2_DEBUG)
4703 dwarf2out_start_source_file (filename);
4704 #endif /* DWARF2_DEBUGGING_INFO */
4705 #ifdef SDB_DEBUGGING_INFO
4706 if (write_symbols == SDB_DEBUG)
4707 sdbout_start_new_source_file (filename);
4711 /* Record the resumption of a source file. LINENO is the line number in
4712 the source file we are returning to. */
4715 debug_end_source_file (lineno)
4716 register unsigned lineno;
4718 #ifdef DBX_DEBUGGING_INFO
4719 if (write_symbols == DBX_DEBUG)
4720 dbxout_resume_previous_source_file ();
4722 #ifdef DWARF_DEBUGGING_INFO
4723 if (debug_info_level == DINFO_LEVEL_VERBOSE
4724 && write_symbols == DWARF_DEBUG)
4725 dwarfout_resume_previous_source_file (lineno);
4726 #endif /* DWARF_DEBUGGING_INFO */
4727 #ifdef DWARF2_DEBUGGING_INFO
4728 if (debug_info_level == DINFO_LEVEL_VERBOSE
4729 && write_symbols == DWARF2_DEBUG)
4730 dwarf2out_end_source_file ();
4731 #endif /* DWARF2_DEBUGGING_INFO */
4732 #ifdef SDB_DEBUGGING_INFO
4733 if (write_symbols == SDB_DEBUG)
4734 sdbout_resume_previous_source_file ();
4738 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
4739 the tail part of the directive line, i.e. the part which is past the
4740 initial whitespace, #, whitespace, directive-name, whitespace part. */
4743 debug_define (lineno, buffer)
4744 register unsigned lineno;
4745 register char *buffer;
4747 #ifdef DWARF_DEBUGGING_INFO
4748 if (debug_info_level == DINFO_LEVEL_VERBOSE
4749 && write_symbols == DWARF_DEBUG)
4750 dwarfout_define (lineno, buffer);
4751 #endif /* DWARF_DEBUGGING_INFO */
4752 #ifdef DWARF2_DEBUGGING_INFO
4753 if (debug_info_level == DINFO_LEVEL_VERBOSE
4754 && write_symbols == DWARF2_DEBUG)
4755 dwarf2out_define (lineno, buffer);
4756 #endif /* DWARF2_DEBUGGING_INFO */
4759 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
4760 the tail part of the directive line, i.e. the part which is past the
4761 initial whitespace, #, whitespace, directive-name, whitespace part. */
4764 debug_undef (lineno, buffer)
4765 register unsigned lineno;
4766 register char *buffer;
4768 #ifdef DWARF_DEBUGGING_INFO
4769 if (debug_info_level == DINFO_LEVEL_VERBOSE
4770 && write_symbols == DWARF_DEBUG)
4771 dwarfout_undef (lineno, buffer);
4772 #endif /* DWARF_DEBUGGING_INFO */
4773 #ifdef DWARF2_DEBUGGING_INFO
4774 if (debug_info_level == DINFO_LEVEL_VERBOSE
4775 && write_symbols == DWARF2_DEBUG)
4776 dwarf2out_undef (lineno, buffer);
4777 #endif /* DWARF2_DEBUGGING_INFO */