1 /* Top level of GNU C compiler
2 Copyright (C) 1987, 88, 89, 92-7, 1998 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. */
27 #undef FLOAT /* This is for hpux. They should change hpux. */
28 #undef FFS /* Some systems define this in param.h. */
34 #ifdef HAVE_SYS_RESOURCE_H
35 # include <sys/resource.h>
38 #ifdef HAVE_SYS_TIMES_H
39 # include <sys/times.h>
46 #include "insn-attr.h"
47 #include "insn-codes.h"
48 #include "insn-config.h"
56 #ifdef DWARF_DEBUGGING_INFO
60 #if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
61 #include "dwarf2out.h"
64 #if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
68 #ifdef SDB_DEBUGGING_INFO
72 #ifdef XCOFF_DEBUGGING_INFO
77 /* The extra parameters substantially improve the I/O performance. */
79 vms_fopen (fname, type)
83 /* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
84 fixed arguments, which matches ANSI's specification but not VAXCRTL's
85 pre-ANSI implementation. This hack circumvents the mismatch problem. */
86 FILE *(*vmslib_fopen)() = (FILE *(*)()) fopen;
89 return (*vmslib_fopen) (fname, type, "mbc=32",
90 "deq=64", "fop=tef", "shr=nil");
92 return (*vmslib_fopen) (fname, type, "mbc=32");
94 #define fopen vms_fopen
97 #ifndef DEFAULT_GDB_EXTENSIONS
98 #define DEFAULT_GDB_EXTENSIONS 1
101 /* If more than one debugging type is supported, you must define
102 PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
104 This is one long line cause VAXC can't handle a \-newline. */
105 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
106 #ifndef PREFERRED_DEBUGGING_TYPE
107 You Lose! You must define PREFERRED_DEBUGGING_TYPE!
108 #endif /* no PREFERRED_DEBUGGING_TYPE */
109 #else /* Only one debugging format supported. Define PREFERRED_DEBUGGING_TYPE
110 so the following code needn't care. */
111 #ifdef DBX_DEBUGGING_INFO
112 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
114 #ifdef SDB_DEBUGGING_INFO
115 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
117 #ifdef DWARF_DEBUGGING_INFO
118 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
120 #ifdef DWARF2_DEBUGGING_INFO
121 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
123 #ifdef XCOFF_DEBUGGING_INFO
124 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
126 #endif /* More than one debugger format enabled. */
128 /* If still not defined, must have been because no debugging formats
130 #ifndef PREFERRED_DEBUGGING_TYPE
131 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
134 extern int rtx_equal_function_value_matters;
136 #if ! (defined (VMS) || defined (OS2))
137 extern char **environ;
139 extern char *version_string, *language_string;
141 /* Carry information from ASM_DECLARE_OBJECT_NAME
142 to ASM_FINISH_DECLARE_OBJECT. */
144 extern int size_directive_output;
145 extern tree last_assemble_variable_decl;
147 extern char *init_parse PVPROTO((char *));
148 extern void finish_parse ();
149 extern void init_decl_processing ();
150 extern void init_obstacks ();
151 extern void init_tree_codes ();
152 extern void init_rtl ();
153 extern void init_regs ();
154 extern void init_optabs ();
155 extern void init_stmt ();
156 extern void init_reg_sets ();
157 extern void dump_flow_info ();
158 extern void dump_sched_info ();
159 extern void dump_local_alloc ();
160 extern void regset_release_memory ();
162 extern void print_rtl ();
163 extern void print_rtl_with_bb ();
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 PVPROTO((char *s, ...));
169 void fatal PVPROTO((char *s, ...));
170 void warning_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
171 void warning_with_decl PVPROTO((tree decl, char *s, ...));
172 void warning PVPROTO((char *s, ...));
173 void pedwarn PVPROTO((char *s, ...));
174 void pedwarn_with_decl PVPROTO((tree decl, char *s, ...));
175 void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
176 void sorry PVPROTO((char *s, ...));
177 static void set_target_switch PROTO((char *));
178 static char *decl_name PROTO((tree, int));
179 static void vmessage PROTO((char *, char *, va_list));
180 static void v_message_with_file_and_line PROTO((char *, int, char *,
182 static void v_message_with_decl PROTO((tree, char *, char *, va_list));
183 static void file_and_line_for_asm PROTO((rtx, char **, int *));
184 static void v_error_with_file_and_line PROTO((char *, int, char *, va_list));
185 static void v_error_with_decl PROTO((tree, char *, va_list));
186 static void v_error_for_asm PROTO((rtx, char *, va_list));
187 static void verror PROTO((char *, va_list));
188 static void vfatal PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
189 static void v_warning_with_file_and_line PROTO ((char *, int, char *, va_list));
190 static void v_warning_with_decl PROTO((tree, char *, va_list));
191 static void v_warning_for_asm PROTO((rtx, char *, va_list));
192 static void vwarning PROTO((char *, va_list));
193 static void vpedwarn PROTO((char *, va_list));
194 static void v_pedwarn_with_decl PROTO((tree, char *, va_list));
195 static void v_pedwarn_with_file_and_line PROTO((char *, int, char *, va_list));
196 static void vsorry PROTO((char *, va_list));
197 static void v_really_sorry PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
198 static void float_signal PROTO((int)) ATTRIBUTE_NORETURN;
199 static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN;
200 #ifdef ASM_IDENTIFY_LANGUAGE
201 static void output_lang_identify PROTO((FILE *));
203 static void open_dump_file PROTO((char *, char *));
204 static void close_dump_file PROTO((void (*) (FILE *, rtx), rtx));
205 static void dump_rtl PROTO((char *, tree, void (*) (FILE *, rtx), rtx));
206 static void clean_dump_file PROTO((char *));
207 static void compile_file PROTO((char *));
208 static void display_help PROTO ((void));
210 static void print_version PROTO((FILE *, char *));
211 static int print_single_switch PROTO((FILE *, int, int, char *, char *, char *,
213 static void print_switch_values PROTO((FILE *, int, int, char *, char *,
216 void print_rtl_graph_with_bb PROTO ((const char *, const char *, rtx));
217 void clean_graph_dump_file PROTO ((const char *, const char *));
218 void finish_graph_dump_file PROTO ((const char *, const char *));
219 /* Length of line when printing switch values. */
222 /* Name of program invoked, sans directories. */
226 /* Copy of arguments to main. */
230 /* Name of current original source file (what was input to cpp).
231 This comes from each #-command in the actual input. */
233 char *input_filename;
235 /* Name of top-level original source file (what was input to cpp).
236 This comes from the #-command at the beginning of the actual input.
237 If there isn't any there, then this is the cc1 input file name. */
239 char *main_input_filename;
241 /* Current line number in real source file. */
245 /* Nonzero if it is unsafe to create any new pseudo registers. */
248 /* Stack of currently pending input files. */
250 struct file_stack *input_file_stack;
252 /* Incremented on each change to input_file_stack. */
253 int input_file_stack_tick;
255 /* FUNCTION_DECL for function now being parsed or compiled. */
257 extern tree current_function_decl;
259 /* Name to use as base of names for dump output files. */
261 char *dump_base_name;
263 /* Bit flags that specify the machine subtype we are compiling for.
264 Bits are tested using macros TARGET_... defined in the tm.h file
265 and set by `-m...' switches. Must be defined in rtlanal.c. */
267 extern int target_flags;
269 /* Flags saying which kinds of debugging dump have been requested. */
272 int rtl_dump_and_exit = 0;
273 int jump_opt_dump = 0;
274 int addressof_dump = 0;
279 int branch_prob_dump = 0;
281 int combine_dump = 0;
282 int regmove_dump = 0;
284 int local_reg_dump = 0;
285 int global_reg_dump = 0;
287 int jump2_opt_dump = 0;
289 int dbr_sched_dump = 0;
291 int flag_print_asm_name = 0;
293 int stack_reg_dump = 0;
295 #ifdef MACHINE_DEPENDENT_REORG
296 int mach_dep_reorg_dump = 0;
298 enum graph_dump_types graph_dump_format;
300 /* Name for output file of assembly code, specified with -o. */
304 /* Value of the -G xx switch, and whether it was passed or not. */
308 /* Type(s) of debugging information we are producing (if any).
309 See flags.h for the definitions of the different possible
310 types of debugging information. */
311 enum debug_info_type write_symbols = NO_DEBUG;
313 /* Level of debugging information we are producing. See flags.h
314 for the definitions of the different possible levels. */
315 enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
317 /* Nonzero means use GNU-only extensions in the generated symbolic
318 debugging information. */
319 /* Currently, this only has an effect when write_symbols is set to
320 DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
321 int use_gnu_debug_info_extensions = 0;
323 /* Nonzero means do optimizations. -O.
324 Particular numeric values stand for particular amounts of optimization;
325 thus, -O2 stores 2 here. However, the optimizations beyond the basic
326 ones are not controlled directly by this variable. Instead, they are
327 controlled by individual `flag_...' variables that are defaulted
328 based on this variable. */
332 /* Nonzero means optimize for size. -Os.
333 The only valid values are zero and non-zero. When optimize_size is
334 non-zero, optimize defaults to 2, but certain individual code
335 bloating optimizations are disabled. */
337 int optimize_size = 0;
339 /* Number of error messages and warning messages so far. */
342 int warningcount = 0;
345 /* Pointer to function to compute the name to use to print a declaration.
346 DECL is the declaration in question.
347 VERBOSITY determines what information will be printed:
348 0: DECL_NAME, demangled as necessary.
349 1: and scope information.
350 2: and any other information that might be interesting, such as function
351 parameter types in C++. */
353 char *(*decl_printable_name) PROTO ((tree, int));
355 /* Pointer to function to compute rtl for a language-specific tree code. */
357 typedef rtx (*lang_expand_expr_t)
358 PROTO ((union tree_node *, rtx, enum machine_mode,
359 enum expand_modifier modifier));
361 lang_expand_expr_t lang_expand_expr = 0;
363 /* Pointer to function to finish handling an incomplete decl at the
364 end of compilation. */
366 void (*incomplete_decl_finalize_hook) PROTO((tree)) = 0;
368 /* Nonzero if generating code to do profiling. */
370 int profile_flag = 0;
372 /* Nonzero if generating code to do profiling on a line-by-line basis. */
374 int profile_block_flag;
376 /* Nonzero if generating code to profile program flow graph arcs. */
378 int profile_arc_flag = 0;
380 /* Nonzero if generating info for gcov to calculate line test coverage. */
382 int flag_test_coverage = 0;
384 /* Nonzero indicates that branch taken probabilities should be calculated. */
386 int flag_branch_probabilities = 0;
388 /* Nonzero for -pedantic switch: warn about anything
389 that standard spec forbids. */
393 /* Temporarily suppress certain warnings.
394 This is set while reading code from a system header file. */
396 int in_system_header = 0;
398 /* Nonzero means do stupid register allocation.
399 Currently, this is 1 if `optimize' is 0. */
401 int obey_regdecls = 0;
403 /* Don't print functions as they are compiled and don't print
404 times taken by the various passes. -quiet. */
410 /* Nonzero means `char' should be signed. */
412 int flag_signed_char;
414 /* Nonzero means give an enum type only as many bytes as it needs. */
416 int flag_short_enums;
418 /* Nonzero for -fcaller-saves: allocate values in regs that need to
419 be saved across function calls, if that produces overall better code.
420 Optional now, so people can test it. */
422 #ifdef DEFAULT_CALLER_SAVES
423 int flag_caller_saves = 1;
425 int flag_caller_saves = 0;
428 /* Nonzero if structures and unions should be returned in memory.
430 This should only be defined if compatibility with another compiler or
431 with an ABI is needed, because it results in slower code. */
433 #ifndef DEFAULT_PCC_STRUCT_RETURN
434 #define DEFAULT_PCC_STRUCT_RETURN 1
437 /* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
439 int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
441 /* Nonzero for -fforce-mem: load memory value into a register
442 before arithmetic on it. This makes better cse but slower compilation. */
444 int flag_force_mem = 0;
446 /* Nonzero for -fforce-addr: load memory address into a register before
447 reference to memory. This makes better cse but slower compilation. */
449 int flag_force_addr = 0;
451 /* Nonzero for -fdefer-pop: don't pop args after each function call;
452 instead save them up to pop many calls' args with one insns. */
454 int flag_defer_pop = 0;
456 /* Nonzero for -ffloat-store: don't allocate floats and doubles
457 in extended-precision registers. */
459 int flag_float_store = 0;
461 /* Nonzero for -fcse-follow-jumps:
462 have cse follow jumps to do a more extensive job. */
464 int flag_cse_follow_jumps;
466 /* Nonzero for -fcse-skip-blocks:
467 have cse follow a branch around a block. */
468 int flag_cse_skip_blocks;
470 /* Nonzero for -fexpensive-optimizations:
471 perform miscellaneous relatively-expensive optimizations. */
472 int flag_expensive_optimizations;
474 /* Nonzero for -fthread-jumps:
475 have jump optimize output of loop. */
477 int flag_thread_jumps;
479 /* Nonzero enables strength-reduction in loop.c. */
481 int flag_strength_reduce = 0;
483 /* Nonzero enables loop unrolling in unroll.c. Only loops for which the
484 number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
485 UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
488 int flag_unroll_loops;
490 /* Nonzero enables loop unrolling in unroll.c. All loops are unrolled.
491 This is generally not a win. */
493 int flag_unroll_all_loops;
495 /* Nonzero forces all invariant computations in loops to be moved
498 int flag_move_all_movables = 0;
500 /* Nonzero forces all general induction variables in loops to be
503 int flag_reduce_all_givs = 0;
505 /* Nonzero to perform full register move optimization passes. This is the
508 int flag_regmove = 0;
510 /* Nonzero for -fwritable-strings:
511 store string constants in data segment and don't uniquize them. */
513 int flag_writable_strings = 0;
515 /* Nonzero means don't put addresses of constant functions in registers.
516 Used for compiling the Unix kernel, where strange substitutions are
517 done on the assembly output. */
519 int flag_no_function_cse = 0;
521 /* Nonzero for -fomit-frame-pointer:
522 don't make a frame pointer in simple functions that don't require one. */
524 int flag_omit_frame_pointer = 0;
526 /* Nonzero means place each function into its own section on those platforms
527 which support arbitrary section names and unlimited numbers of sections. */
529 int flag_function_sections = 0;
531 /* ... and similar for data. */
533 int flag_data_sections = 0;
535 /* Nonzero to inhibit use of define_optimization peephole opts. */
537 int flag_no_peephole = 0;
539 /* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
540 operations in the interest of optimization. For example it allows
541 GCC to assume arguments to sqrt are nonnegative numbers, allowing
542 faster code for sqrt to be generated. */
544 int flag_fast_math = 0;
546 /* Nonzero means all references through pointers are volatile. */
550 /* Nonzero means treat all global and extern variables as global. */
552 int flag_volatile_global;
554 /* Nonzero means just do syntax checking; don't output anything. */
556 int flag_syntax_only = 0;
558 /* Nonzero means perform global cse. */
560 static int flag_gcse;
562 /* Nonzero means to rerun cse after loop optimization. This increases
563 compilation time about 20% and picks up a few more common expressions. */
565 static int flag_rerun_cse_after_loop;
567 /* Nonzero means to run loop optimizations twice. */
569 int flag_rerun_loop_opt;
571 /* Nonzero for -finline-functions: ok to inline functions that look like
572 good inline candidates. */
574 int flag_inline_functions;
576 /* Nonzero for -fkeep-inline-functions: even if we make a function
577 go inline everywhere, keep its definition around for debugging
580 int flag_keep_inline_functions;
582 /* Nonzero means that functions will not be inlined. */
586 /* Nonzero means that we should emit static const variables
587 regardless of whether or not optimization is turned on. */
589 int flag_keep_static_consts = 1;
591 /* Nonzero means we should be saving declaration info into a .X file. */
593 int flag_gen_aux_info = 0;
595 /* Specified name of aux-info file. */
597 static char *aux_info_file_name;
599 /* Nonzero means make the text shared if supported. */
601 int flag_shared_data;
603 /* Nonzero means schedule into delayed branch slots if supported. */
605 int flag_delayed_branch;
607 /* Nonzero if we are compiling pure (sharable) code.
608 Value is 1 if we are doing reasonable (i.e. simple
609 offset into offset table) pic. Value is 2 if we can
610 only perform register offsets. */
614 /* Nonzero means generate extra code for exception handling and enable
615 exception handling. */
619 /* Nonzero means use the new model for exception handling. Replaces
620 -DNEW_EH_MODEL as a compile option. */
622 int flag_new_exceptions = 0;
624 /* Nonzero means don't place uninitialized global data in common storage
629 /* Nonzero means pretend it is OK to examine bits of target floats,
630 even if that isn't true. The resulting code will have incorrect constants,
631 but the same series of instructions that the native compiler would make. */
633 int flag_pretend_float;
635 /* Nonzero means change certain warnings into errors.
636 Usually these are warnings about failure to conform to some standard. */
638 int flag_pedantic_errors = 0;
640 /* flag_schedule_insns means schedule insns within basic blocks (before
642 flag_schedule_insns_after_reload means schedule insns after
645 int flag_schedule_insns = 0;
646 int flag_schedule_insns_after_reload = 0;
649 /* The following flags have effect only for scheduling before register
652 flag_schedule_interblock means schedule insns accross basic blocks.
653 flag_schedule_speculative means allow speculative motion of non-load insns.
654 flag_schedule_speculative_load means allow speculative motion of some
656 flag_schedule_speculative_load_dangerous allows speculative motion of more
659 int flag_schedule_interblock = 1;
660 int flag_schedule_speculative = 1;
661 int flag_schedule_speculative_load = 0;
662 int flag_schedule_speculative_load_dangerous = 0;
665 /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
666 by a cheaper branch, on a count register. */
667 int flag_branch_on_count_reg;
669 /* -finhibit-size-directive inhibits output of .size for ELF.
670 This is used only for compiling crtstuff.c,
671 and it may be extended to other effects
672 needed for crtstuff.c on other systems. */
673 int flag_inhibit_size_directive = 0;
675 /* -fverbose-asm causes extra commentary information to be produced in
676 the generated assembly code (to make it more readable). This option
677 is generally only of use to those who actually need to read the
678 generated assembly code (perhaps while debugging the compiler itself).
679 -fno-verbose-asm, the default, causes the extra information
680 to be omitted and is useful when comparing two assembler files. */
682 int flag_verbose_asm = 0;
684 /* -dA causes debug commentary information to be produced in
685 the generated assembly code (to make it more readable). This option
686 is generally only of use to those who actually need to read the
687 generated assembly code (perhaps while debugging the compiler itself).
688 Currently, this switch is only used by dwarfout.c; however, it is intended
689 to be a catchall for printing debug information in the assembler file. */
691 int flag_debug_asm = 0;
693 /* -fgnu-linker specifies use of the GNU linker for initializations.
694 (Or, more generally, a linker that handles initializations.)
695 -fno-gnu-linker says that collect2 will be used. */
697 int flag_gnu_linker = 0;
699 int flag_gnu_linker = 1;
702 /* Tag all structures with __attribute__(packed) */
703 int flag_pack_struct = 0;
705 /* Emit code to check for stack overflow; also may cause large objects
706 to be allocated dynamically. */
707 int flag_stack_check;
709 /* -fcheck-memory-usage causes extra code to be generated in order to check
710 memory accesses. This is used by a detector of bad memory accesses such
712 int flag_check_memory_usage = 0;
714 /* -fprefix-function-name causes function name to be prefixed. This
715 can be used with -fcheck-memory-usage to isolate code compiled with
716 -fcheck-memory-usage. */
717 int flag_prefix_function_name = 0;
719 /* 0 if pointer arguments may alias each other. True in C.
720 1 if pointer arguments may not alias each other but may alias
722 2 if pointer arguments may not alias each other and may not
723 alias global variables. True in Fortran.
724 This defaults to 0 for C. */
725 int flag_argument_noalias = 0;
727 /* Nonzero if we should do (language-dependent) alias analysis.
728 Typically, this analysis will assume that expressions of certain
729 types do not alias expressions of certain other types. Only used
730 if alias analysis (in general) is enabled. */
731 int flag_strict_aliasing = 0;
733 /* Instrument functions with calls at entry and exit, for profiling. */
734 int flag_instrument_function_entry_exit = 0;
737 /* Table of supported debugging formats. */
741 /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
742 constant expression, we use NO_DEBUG in its place. */
743 enum debug_info_type debug_type;
744 int use_extensions_p;
749 { "g", NO_DEBUG, DEFAULT_GDB_EXTENSIONS,
750 "Generate default debug format output" },
751 { "ggdb", NO_DEBUG, 1, "Generate default extended debug format output" },
752 #ifdef DBX_DEBUGGING_INFO
753 { "gstabs", DBX_DEBUG, 0, "Generate STABS format debug output" },
754 { "gstabs+", DBX_DEBUG, 1, "Generate extended STABS format debug output" },
756 #ifdef DWARF_DEBUGGING_INFO
757 { "gdwarf", DWARF_DEBUG, 0, "Generate DWARF-1 format debug output"},
758 { "gdwarf+", DWARF_DEBUG, 1,
759 "Generated extended DWARF-1 format debug output" },
761 #ifdef DWARF2_DEBUGGING_INFO
762 { "gdwarf-2", DWARF2_DEBUG, 0, "Enable DWARF-2 debug output" },
764 #ifdef XCOFF_DEBUGGING_INFO
765 { "gxcoff", XCOFF_DEBUG, 0, "Generate XCOFF format debug output" },
766 { "gxcoff+", XCOFF_DEBUG, 1, "Generate extended XCOFF format debug output" },
768 #ifdef SDB_DEBUGGING_INFO
769 { "gcoff", SDB_DEBUG, 0, "Generate COFF format debug output" },
781 lang_independent_options;
783 /* Add or remove a leading underscore from user symbols. */
784 int flag_leading_underscore = -1;
786 /* The user symbol prefix after having resolved same. */
787 char *user_label_prefix;
789 /* A default for same. */
790 #ifndef USER_LABEL_PREFIX
791 #define USER_LABEL_PREFIX ""
794 /* Table of language-independent -f options.
795 STRING is the option name. VARIABLE is the address of the variable.
796 ON_VALUE is the value to store in VARIABLE
797 if `-fSTRING' is seen as an option.
798 (If `-fno-STRING' is seen as an option, the opposite value is stored.) */
800 lang_independent_options f_options[] =
802 {"float-store", &flag_float_store, 1,
803 "Do not store floats in registers" },
804 {"volatile", &flag_volatile, 1,
805 "Consider all mem refs through pointers as volatile"},
806 {"volatile-global", &flag_volatile_global, 1,
807 "Consider all mem refs to global data to be volatile" },
808 {"defer-pop", &flag_defer_pop, 1,
809 "Defer popping functions args from stack until later" },
810 {"omit-frame-pointer", &flag_omit_frame_pointer, 1,
811 "When possible do not generate stack frames"},
812 {"cse-follow-jumps", &flag_cse_follow_jumps, 1,
813 "When running CSE, follow jumps to their targets" },
814 {"cse-skip-blocks", &flag_cse_skip_blocks, 1,
815 "When running CSE, follow conditional jumps" },
816 {"expensive-optimizations", &flag_expensive_optimizations, 1,
817 "Perform a number of minor, expensive optimisations" },
818 {"thread-jumps", &flag_thread_jumps, 1,
819 "Perform jump threading optimisations"},
820 {"strength-reduce", &flag_strength_reduce, 1,
821 "Perform strength reduction optimisations" },
822 {"unroll-loops", &flag_unroll_loops, 1,
823 "Perform loop unrolling when interation count is known" },
824 {"unroll-all-loops", &flag_unroll_all_loops, 1,
825 "Perform loop unrolling for all loops" },
826 {"move-all-movables", &flag_move_all_movables, 1,
827 "Force all loop invariant computations out of loops" },
828 {"reduce-all-givs", &flag_reduce_all_givs, 1,
829 "Strength reduce all loop general induction variables" },
830 {"writable-strings", &flag_writable_strings, 1,
831 "Store strings in writable data section" },
832 {"peephole", &flag_no_peephole, 0,
833 "Enable machine specific peephole optimisations" },
834 {"force-mem", &flag_force_mem, 1,
835 "Copy memory operands into registers before using" },
836 {"force-addr", &flag_force_addr, 1,
837 "Copy memory address constants into regs before using" },
838 {"function-cse", &flag_no_function_cse, 0,
839 "Allow function addresses to be held in registers" },
840 {"inline-functions", &flag_inline_functions, 1,
841 "Integrate simple functions into their callers" },
842 {"keep-inline-functions", &flag_keep_inline_functions, 1,
843 "Generate code for funcs even if they are fully inlined" },
844 {"inline", &flag_no_inline, 0,
845 "Pay attention to the 'inline' keyword"},
846 {"keep-static-consts", &flag_keep_static_consts, 1,
847 "Emit static const variables even if they are not used" },
848 {"syntax-only", &flag_syntax_only, 1,
849 "Check for syntax errors, then stop" },
850 {"shared-data", &flag_shared_data, 1,
851 "Mark data as shared rather than private" },
852 {"caller-saves", &flag_caller_saves, 1,
853 "Enable saving registers around function calls" },
854 {"pcc-struct-return", &flag_pcc_struct_return, 1,
855 "Return 'short' aggregates in memory, not registers" },
856 {"reg-struct-return", &flag_pcc_struct_return, 0,
857 "Return 'short' aggregates in registers" },
858 {"delayed-branch", &flag_delayed_branch, 1,
859 "Attempt to fill delay slots of branch instructions" },
860 {"gcse", &flag_gcse, 1,
861 "Perform the global common subexpression elimination" },
862 {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
863 "Run CSE pass after loop optimisations"},
864 {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
865 "Run the loop optimiser twice"},
866 {"pretend-float", &flag_pretend_float, 1,
867 "Pretend that host and target use the same FP format"},
868 {"schedule-insns", &flag_schedule_insns, 1,
869 "Reschedule instructions to avoid pipeline stalls"},
870 {"schedule-insns2", &flag_schedule_insns_after_reload, 1,
871 "Run two passes of the instruction scheduler"},
873 {"sched-interblock",&flag_schedule_interblock, 1,
874 "Enable scheduling across basic blocks" },
875 {"sched-spec",&flag_schedule_speculative, 1,
876 "Allow speculative motion of non-loads" },
877 {"sched-spec-load",&flag_schedule_speculative_load, 1,
878 "Allow speculative motion of some loads" },
879 {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
880 "Allow speculative motion of more loads" },
882 {"branch-count-reg",&flag_branch_on_count_reg, 1,
883 "Replace add,compare,branch with branch on count reg"},
884 {"pic", &flag_pic, 1,
885 "Generate position independent code, if possible"},
886 {"PIC", &flag_pic, 2, ""},
887 {"exceptions", &flag_exceptions, 1,
888 "Enable exception handling" },
889 {"new-exceptions", &flag_new_exceptions, 1,
890 "Use the new model for exception handling" },
891 {"sjlj-exceptions", &exceptions_via_longjmp, 1,
892 "Use setjmp/longjmp to handle exceptions" },
893 {"asynchronous-exceptions", &asynchronous_exceptions, 1,
894 "Support asynchronous exceptions" },
895 {"profile-arcs", &profile_arc_flag, 1,
896 "Insert arc based program profiling code" },
897 {"test-coverage", &flag_test_coverage, 1,
898 "Create data files needed by gcov" },
899 {"branch-probabilities", &flag_branch_probabilities, 1,
900 "Use profiling information for branch porbabilities" },
901 {"fast-math", &flag_fast_math, 1,
902 "Improve FP speed by violating ANSI & IEEE rules" },
903 {"common", &flag_no_common, 0,
904 "Do not put unitialised globals in the common section" },
905 {"inhibit-size-directive", &flag_inhibit_size_directive, 1,
906 "Do not generate .size directives" },
907 {"function-sections", &flag_function_sections, 1,
908 "place each function into its own section" },
909 {"data-sections", &flag_data_sections, 1,
910 "place data items into their own section" },
911 {"verbose-asm", &flag_verbose_asm, 1,
912 "Add extra commentry to assembler output"},
913 {"gnu-linker", &flag_gnu_linker, 1,
914 "Output GNU ld formatted global initialisers"},
915 {"regmove", &flag_regmove, 1,
916 "Enables a register move optimisation"},
917 {"optimize-register-move", &flag_regmove, 1,
918 "Do the full regmove optimization pass"},
919 {"pack-struct", &flag_pack_struct, 1,
920 "Pack structure members together without holes" },
921 {"stack-check", &flag_stack_check, 1,
922 "Insert stack checking code into the program" },
923 {"argument-alias", &flag_argument_noalias, 0,
924 "Specify that arguments may alias each other & globals"},
925 {"argument-noalias", &flag_argument_noalias, 1,
926 "Assume arguments may alias globals but not each other"},
927 {"argument-noalias-global", &flag_argument_noalias, 2,
928 "Assume arguments do not alias each other or globals" },
929 {"strict-aliasing", &flag_strict_aliasing, 1,
930 "Assume strict aliasing rules apply" },
931 {"check-memory-usage", &flag_check_memory_usage, 1,
932 "Generate code to check every memory access" },
933 {"prefix-function-name", &flag_prefix_function_name, 1,
934 "Add a prefix to all function names" },
935 {"dump-unnumbered", &flag_dump_unnumbered, 1,
936 "Suppress output of instruction numbers and line number notes in debugging dumps"},
937 {"instrument-functions", &flag_instrument_function_entry_exit, 1,
938 "Instrument function entry/exit with profiling calls"},
939 {"leading-underscore", &flag_leading_underscore, 1,
940 "External symbols have a leading underscore" }
943 #define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0]))
945 /* Table of language-specific options. */
947 static struct lang_opt
952 documented_lang_options[] =
954 /* In order not to overload the --help output, the convention
955 used here is to only describe those options which are not
956 enabled by default. */
958 { "-ansi", "Compile just for ANSI C" },
959 { "-fallow-single-precision",
960 "Do not promote floats to double if using -traditional" },
962 { "-fsigned-bitfields", "" },
963 { "-funsigned-bitfields","Make bitfields by unsigned by default" },
964 { "-fno-signed-bitfields", "" },
965 { "-fno-unsigned-bitfields","" },
966 { "-fsigned-char", "Make 'char' be signed by default"},
967 { "-funsigned-char", "Make 'char' be unsigned by default"},
968 { "-fno-signed-char", "" },
969 { "-fno-unsigned-char", "" },
971 { "-ftraditional", "" },
972 { "-traditional", "Attempt to support traditional K&R style C"},
973 { "-fnotraditional", "" },
974 { "-fno-traditional", "" },
975 { "-flang-isoc9x", "Enable C9X features"},
978 { "-fno-asm", "Do not recognise the 'asm' keyword" },
980 { "-fno-builtin", "Do not recognise any built in functions" },
981 { "-fhosted", "Assume normal C execution environment" },
982 { "-fno-hosted", "" },
984 "Assume that standard libraries & main might not exist" },
985 { "-fno-freestanding", "" },
986 { "-fcond-mismatch", "Allow different types as args of ? operator"},
987 { "-fno-cond-mismatch", "" },
988 { "-fdollars-in-identifiers", "Allow the use of $ inside indentifiers" },
989 { "-fno-dollars-in-identifiers", "" },
991 { "-fno-ident", "Ignore #ident directives" },
992 { "-fshort-double", "Use the same size for double as for float" },
993 { "-fno-short-double", "" },
994 { "-fshort-enums", "Use the smallest fitting integer to hold enums"},
995 { "-fno-short-enums", "" },
997 { "-Wall", "Enable most warning messages" },
998 { "-Wbad-function-cast",
999 "Warn about casting functions to incompatible types" },
1000 { "-Wno-bad-function-cast", "" },
1001 { "-Wmissing-noreturn",
1002 "Warn about functions which might be candidates for attribute noreturn" },
1003 { "-Wno-missing-noreturn", "" },
1004 { "-Wcast-qual", "Warn about casts which discard qualifiers"},
1005 { "-Wno-cast-qual", "" },
1006 { "-Wchar-subscripts", "Warn about subscripts whose type is 'char'"},
1007 { "-Wno-char-subscripts", "" },
1008 { "-Wcomment", "Warn if nested comments are detected" },
1009 { "-Wno-comment", "" },
1010 { "-Wcomments", "Warn if nested comments are detected" },
1011 { "-Wno-comments", "" },
1012 { "-Wconversion", "Warn about possibly confusing type conversions" },
1013 { "-Wno-conversion", "" },
1014 { "-Wformat", "Warn about printf format anomalies" },
1015 { "-Wno-format", "" },
1016 { "-Wimplicit-function-declaration",
1017 "Warn about implicit function declarations" },
1018 { "-Wno-implicit-function-declaration", "" },
1019 { "-Werror-implicit-function-declaration", "" },
1020 { "-Wimplicit-int", "Warn when a declaration does not specify a type" },
1021 { "-Wno-implicit-int", "" },
1022 { "-Wimplicit", "" },
1023 { "-Wno-implicit", "" },
1024 { "-Wimport", "Warn about the use of the #import directive" },
1025 { "-Wno-import", "" },
1026 { "-Wlong-long","" },
1027 { "-Wno-long-long", "Do not warn about using 'long long' when -pedantic" },
1028 { "-Wmain", "Warn about suspicious declarations of main" },
1029 { "-Wno-main", "" },
1030 { "-Wmissing-braces",
1031 "Warn about possibly missing braces around initialisers" },
1032 { "-Wno-missing-braces", "" },
1033 { "-Wmissing-declarations",
1034 "Warn about global funcs without previous declarations"},
1035 { "-Wno-missing-declarations", "" },
1036 { "-Wmissing-prototypes", "Warn about global funcs without prototypes" },
1037 { "-Wno-missing-prototypes", "" },
1038 { "-Wmultichar", "Warn about use of multicharacter literals"},
1039 { "-Wno-multichar", "" },
1040 { "-Wnested-externs", "Warn about externs not at file scope level" },
1041 { "-Wno-nested-externs", "" },
1042 { "-Wparentheses", "Warn about possible missing parentheses" },
1043 { "-Wno-parentheses", "" },
1044 { "-Wpointer-arith", "Warn about function pointer arithmetic" },
1045 { "-Wno-pointer-arith", "" },
1046 { "-Wredundant-decls",
1047 "Warn about multiple declarations of the same object" },
1048 { "-Wno-redundant-decls", "" },
1049 { "-Wsign-compare", "Warn about signed/unsigned comparisons" },
1050 { "-Wno-sign-compare", "" },
1051 { "-Wunknown-pragmas", "Warn about unrecognised pragmas" },
1052 { "-Wno-unknown-pragmas", "" },
1053 { "-Wstrict-prototypes", "Warn about non-prototyped function decls" },
1054 { "-Wno-strict-prototypes", "" },
1055 { "-Wtraditional", "Warn about constructs whose meaning change in ANSI C"},
1056 { "-Wno-traditional", "" },
1057 { "-Wtrigraphs", "Warn when trigraphs are encountered" },
1058 { "-Wno-trigraphs", "" },
1060 { "-Wno-undef", "" },
1061 { "-Wwrite-strings", "Mark strings as 'const char *'"},
1062 { "-Wno-write-strings", "" },
1064 /* These are for languages with USE_CPPLIB. */
1065 /* These options are already documented in cpplib.c */
1072 { "-idirafter", "" },
1077 { "-iwithprefix", "" },
1078 { "-iwithprefixbefore", "" },
1080 { "-lang-c89", "" },
1081 { "-lang-c++", "" },
1083 { "-nostdinc", "" },
1084 { "-nostdinc++", "" },
1085 { "-trigraphs", "" },
1088 #define DEFINE_LANG_NAME(NAME) { NULL, NAME },
1090 /* These are for obj c. */
1091 DEFINE_LANG_NAME ("Objective C")
1093 { "-lang-objc", "" },
1094 { "-gen-decls", "Dump decls to a .decl file" },
1095 { "-fgnu-runtime", "Generate code for GNU runtime envrionment" },
1096 { "-fno-gnu-runtime", "" },
1097 { "-fnext-runtime", "Generate code for NeXT runtime environment" },
1098 { "-fno-next-runtime", "" },
1099 { "-Wselector", "Warn if a selector has multiple methods" },
1100 { "-Wno-selector", "" },
1101 { "-Wprotocol", "" },
1102 { "-Wno-protocol", "Do not warn if inherited methods are unimplemented"},
1103 { "-print-objc-runtime-info",
1104 "Generate C header of platform specific features" },
1106 #include "options.h"
1110 /* Here is a table, controlled by the tm.h file, listing each -m switch
1111 and which bits in `target_switches' it should set or clear.
1112 If VALUE is positive, it is bits to set.
1113 If VALUE is negative, -VALUE is bits to clear.
1114 (The sign bit is not used so there is no confusion.) */
1122 target_switches [] = TARGET_SWITCHES;
1124 /* This table is similar, but allows the switch to have a value. */
1126 #ifdef TARGET_OPTIONS
1133 target_options [] = TARGET_OPTIONS;
1136 /* Options controlling warnings */
1138 /* Don't print warning messages. -w. */
1140 int inhibit_warnings = 0;
1142 /* Print various extra warnings. -W. */
1144 int extra_warnings = 0;
1146 /* Treat warnings as errors. -Werror. */
1148 int warnings_are_errors = 0;
1150 /* Nonzero to warn about unused local variables. */
1154 /* Nonzero to warn about variables used before they are initialized. */
1156 int warn_uninitialized;
1158 /* Nonzero means warn about all declarations which shadow others. */
1162 /* Warn if a switch on an enum fails to have a case for every enum value. */
1166 /* Nonzero means warn about function definitions that default the return type
1167 or that use a null return and have a return-type other than void. */
1169 int warn_return_type;
1171 /* Nonzero means warn about pointer casts that increase the required
1172 alignment of the target type (and might therefore lead to a crash
1173 due to a misaligned access). */
1175 int warn_cast_align;
1177 /* Nonzero means warn about any identifiers that match in the first N
1178 characters. The value N is in `id_clash_len'. */
1181 unsigned id_clash_len;
1183 /* Nonzero means warn about any objects definitions whose size is larger
1184 than N bytes. Also want about function definitions whose returned
1185 values are larger than N bytes. The value N is in `larger_than_size'. */
1187 int warn_larger_than;
1188 unsigned larger_than_size;
1190 /* Nonzero means warn if inline function is too large. */
1194 /* Warn if a function returns an aggregate,
1195 since there are often incompatible calling conventions for doing this. */
1197 int warn_aggregate_return;
1199 /* Likewise for -W. */
1201 lang_independent_options W_options[] =
1203 {"unused", &warn_unused, 1, "Warn when a variable is unused" },
1204 {"error", &warnings_are_errors, 1, ""},
1205 {"shadow", &warn_shadow, 1, "Warn when one local variable shadows another" },
1206 {"switch", &warn_switch, 1,
1207 "Warn about enumerated switches missing a specific case" },
1208 {"aggregate-return", &warn_aggregate_return, 1,
1209 "Warn about returning structures, unions or arrays" },
1210 {"cast-align", &warn_cast_align, 1,
1211 "Warn about pointer casts which increase alignment" },
1212 {"uninitialized", &warn_uninitialized, 1,
1213 "Warn about unitialized automatic variables"},
1214 {"inline", &warn_inline, 1,
1215 "Warn when an inlined function cannot be inlined"}
1218 /* Output files for assembler code (real compiler output)
1219 and debugging dumps. */
1222 FILE *aux_info_file;
1223 FILE *rtl_dump_file = NULL;
1225 /* Time accumulators, to count the total time spent in various passes. */
1229 int integration_time;
1235 int branch_prob_time;
1240 int local_alloc_time;
1241 int global_alloc_time;
1246 int shorten_branch_time;
1252 /* Return time used so far, in microseconds. */
1262 #else /* not BeOS */
1263 #if defined (_WIN32) && !defined (__CYGWIN__)
1267 return (clock() * 1000);
1268 #else /* not _WIN32 */
1274 tick = 1000000 / sysconf(_SC_CLK_TCK);
1276 return (tms.tms_utime + tms.tms_stime) * tick;
1282 # if HAVE_SYSCONF && defined _SC_CLK_TCK
1283 # define TICKS_PER_SECOND sysconf (_SC_CLK_TCK) /* POSIX 1003.1-1996 */
1286 # define TICKS_PER_SECOND CLK_TCK /* POSIX 1003.1-1988; obsolescent */
1288 # define TICKS_PER_SECOND HZ /* traditional UNIX */
1292 return (tms.tms_utime + tms.tms_stime) * (1000000 / TICKS_PER_SECOND);
1297 struct rusage rusage;
1298 getrusage (0, &rusage);
1299 return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
1300 + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
1307 int proc_system_time;
1308 int child_user_time;
1309 int child_system_time;
1311 times ((void *) &vms_times);
1312 return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
1316 #endif /* _SC_CLK_TCK */
1318 #endif /* __BEOS__ */
1321 #define TIMEVAR(VAR, BODY) \
1322 do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
1325 print_time (str, total)
1330 "time in %s: %d.%06d\n",
1331 str, total / 1000000, total % 1000000);
1334 /* Count an error or warning. Return 1 if the message should be printed. */
1337 count_error (warningp)
1340 if (warningp && inhibit_warnings)
1343 if (warningp && !warnings_are_errors)
1347 static int warning_message = 0;
1349 if (warningp && !warning_message)
1351 fprintf (stderr, "%s: warnings being treated as errors\n", progname);
1352 warning_message = 1;
1360 /* Print a fatal error message. NAME is the text.
1361 Also include a system error message based on `errno'. */
1364 pfatal_with_name (name)
1367 fprintf (stderr, "%s: ", progname);
1369 exit (FATAL_EXIT_CODE);
1373 fatal_io_error (name)
1376 fprintf (stderr, "%s: %s: I/O error\n", progname, name);
1377 exit (FATAL_EXIT_CODE);
1380 /* Called to give a better error message for a bad insn rather than
1381 just calling abort(). */
1384 fatal_insn (message, insn)
1391 fflush (asm_out_file);
1393 fflush (aux_info_file);
1394 if (rtl_dump_file != NULL)
1395 fflush (rtl_dump_file);
1401 /* Called to give a better error message when we don't have an insn to match
1402 what we are looking for or if the insn's constraints aren't satisfied,
1403 rather than just calling abort(). */
1406 fatal_insn_not_found (insn)
1409 if (INSN_CODE (insn) < 0)
1410 fatal_insn ("internal error--unrecognizable insn:", insn);
1412 fatal_insn ("internal error--insn does not satisfy its constraints:", insn);
1415 /* This is the default decl_printable_name function. */
1418 decl_name (decl, verbosity)
1420 int verbosity ATTRIBUTE_UNUSED;
1422 return IDENTIFIER_POINTER (DECL_NAME (decl));
1425 static int need_error_newline;
1427 /* Function of last error message;
1428 more generally, function such that if next error message is in it
1429 then we don't have to mention the function name. */
1430 static tree last_error_function = NULL;
1432 /* Used to detect when input_file_stack has changed since last described. */
1433 static int last_error_tick;
1435 /* Called when the start of a function definition is parsed,
1436 this function prints on stderr the name of the function. */
1439 announce_function (decl)
1444 if (rtl_dump_and_exit)
1445 fprintf (stderr, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
1447 fprintf (stderr, " %s", (*decl_printable_name) (decl, 2));
1449 need_error_newline = 1;
1450 last_error_function = current_function_decl;
1454 /* The default function to print out name of current function that caused
1458 default_print_error_function (file)
1461 if (last_error_function != current_function_decl)
1463 char *kind = "function";
1464 if (current_function_decl != 0
1465 && TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
1469 fprintf (stderr, "%s: ", file);
1471 if (current_function_decl == NULL)
1472 fprintf (stderr, "At top level:\n");
1475 char *name = (*decl_printable_name) (current_function_decl, 2);
1476 fprintf (stderr, "In %s `%s':\n", kind, name);
1479 last_error_function = current_function_decl;
1483 /* Called by report_error_function to print out function name.
1484 * Default may be overridden by language front-ends. */
1486 void (*print_error_function) PROTO((char *)) = default_print_error_function;
1488 /* Prints out, if necessary, the name of the current function
1489 that caused an error. Called from all error and warning functions. */
1492 report_error_function (file)
1495 struct file_stack *p;
1497 if (need_error_newline)
1499 fprintf (stderr, "\n");
1500 need_error_newline = 0;
1503 (*print_error_function) (file);
1505 if (input_file_stack && input_file_stack->next != 0
1506 && input_file_stack_tick != last_error_tick
1507 && file == input_filename)
1509 fprintf (stderr, "In file included");
1510 for (p = input_file_stack->next; p; p = p->next)
1512 fprintf (stderr, " from %s:%d", p->name, p->line);
1514 fprintf (stderr, ",\n ");
1516 fprintf (stderr, ":\n");
1517 last_error_tick = input_file_stack_tick;
1521 /* Print a message. */
1524 vmessage (prefix, s, ap)
1530 fprintf (stderr, "%s: ", prefix);
1532 vfprintf (stderr, s, ap);
1535 /* Print a message relevant to line LINE of file FILE. */
1538 v_message_with_file_and_line (file, line, prefix, s, ap)
1546 fprintf (stderr, "%s:%d: ", file, line);
1548 fprintf (stderr, "%s: ", progname);
1550 vmessage (prefix, s, ap);
1551 fputc ('\n', stderr);
1554 /* Print a message relevant to the given DECL. */
1557 v_message_with_decl (decl, prefix, s, ap)
1565 fprintf (stderr, "%s:%d: ",
1566 DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
1569 fprintf (stderr, "%s: ", prefix);
1571 /* Do magic to get around lack of varargs support for insertion
1572 of arguments into existing list. We know that the decl is first;
1573 we ass_u_me that it will be printed with "%s". */
1575 for (p = s; *p; ++p)
1579 if (*(p + 1) == '%')
1586 if (p > s) /* Print the left-hand substring. */
1588 char fmt[sizeof "%.255s"];
1591 if (width > 255L) width = 255L; /* arbitrary */
1592 sprintf (fmt, "%%.%lds", width);
1593 fprintf (stderr, fmt, s);
1596 if (*p == '%') /* Print the name. */
1598 char *n = (DECL_NAME (decl)
1599 ? (*decl_printable_name) (decl, 2)
1605 if (ISALPHA (*(p - 1) & 0xFF))
1610 if (*p) /* Print the rest of the message. */
1611 vmessage ((char *)NULL, p, ap);
1613 fputc ('\n', stderr);
1616 /* Figure file and line of the given INSN. */
1619 file_and_line_for_asm (insn, pfile, pline)
1624 rtx body = PATTERN (insn);
1627 /* Find the (or one of the) ASM_OPERANDS in the insn. */
1628 if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
1629 asmop = SET_SRC (body);
1630 else if (GET_CODE (body) == ASM_OPERANDS)
1632 else if (GET_CODE (body) == PARALLEL
1633 && GET_CODE (XVECEXP (body, 0, 0)) == SET)
1634 asmop = SET_SRC (XVECEXP (body, 0, 0));
1635 else if (GET_CODE (body) == PARALLEL
1636 && GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
1637 asmop = XVECEXP (body, 0, 0);
1643 *pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
1644 *pline = ASM_OPERANDS_SOURCE_LINE (asmop);
1648 *pfile = input_filename;
1653 /* Report an error at line LINE of file FILE. */
1656 v_error_with_file_and_line (file, line, s, ap)
1663 report_error_function (file);
1664 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1668 error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1670 #ifndef ANSI_PROTOTYPES
1679 #ifndef ANSI_PROTOTYPES
1680 file = va_arg (ap, char *);
1681 line = va_arg (ap, int);
1682 s = va_arg (ap, char *);
1685 v_error_with_file_and_line (file, line, s, ap);
1689 /* Report an error at the declaration DECL.
1690 S is a format string which uses %s to substitute the declaration
1691 name; subsequent substitutions are a la printf. */
1694 v_error_with_decl (decl, s, ap)
1700 report_error_function (DECL_SOURCE_FILE (decl));
1701 v_message_with_decl (decl, (char *)NULL, s, ap);
1705 error_with_decl VPROTO((tree decl, char *s, ...))
1707 #ifndef ANSI_PROTOTYPES
1715 #ifndef ANSI_PROTOTYPES
1716 decl = va_arg (ap, tree);
1717 s = va_arg (ap, char *);
1720 v_error_with_decl (decl, s, ap);
1724 /* Report an error at the line number of the insn INSN.
1725 This is used only when INSN is an `asm' with operands,
1726 and each ASM_OPERANDS records its own source file and line. */
1729 v_error_for_asm (insn, s, ap)
1738 file_and_line_for_asm (insn, &file, &line);
1739 report_error_function (file);
1740 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1744 error_for_asm VPROTO((rtx insn, char *s, ...))
1746 #ifndef ANSI_PROTOTYPES
1754 #ifndef ANSI_PROTOTYPES
1755 insn = va_arg (ap, rtx);
1756 s = va_arg (ap, char *);
1759 v_error_for_asm (insn, s, ap);
1763 /* Report an error at the current line number. */
1770 v_error_with_file_and_line (input_filename, lineno, s, ap);
1774 error VPROTO((char *s, ...))
1776 #ifndef ANSI_PROTOTYPES
1783 #ifndef ANSI_PROTOTYPES
1784 s = va_arg (ap, char *);
1791 /* Report a fatal error at the current line number. */
1799 exit (FATAL_EXIT_CODE);
1803 fatal VPROTO((char *s, ...))
1805 #ifndef ANSI_PROTOTYPES
1812 #ifndef ANSI_PROTOTYPES
1813 s = va_arg (ap, char *);
1820 /* Report a warning at line LINE of file FILE. */
1823 v_warning_with_file_and_line (file, line, s, ap)
1829 if (count_error (1))
1831 report_error_function (file);
1832 v_message_with_file_and_line (file, line, "warning", s, ap);
1837 warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1839 #ifndef ANSI_PROTOTYPES
1848 #ifndef ANSI_PROTOTYPES
1849 file = va_arg (ap, char *);
1850 line = va_arg (ap, int);
1851 s = va_arg (ap, char *);
1854 v_warning_with_file_and_line (file, line, s, ap);
1858 /* Report a warning at the declaration DECL.
1859 S is a format string which uses %s to substitute the declaration
1860 name; subsequent substitutions are a la printf. */
1863 v_warning_with_decl (decl, s, ap)
1868 if (count_error (1))
1870 report_error_function (DECL_SOURCE_FILE (decl));
1871 v_message_with_decl (decl, "warning", s, ap);
1876 warning_with_decl VPROTO((tree decl, char *s, ...))
1878 #ifndef ANSI_PROTOTYPES
1886 #ifndef ANSI_PROTOTYPES
1887 decl = va_arg (ap, tree);
1888 s = va_arg (ap, char *);
1891 v_warning_with_decl (decl, s, ap);
1895 /* Report a warning at the line number of the insn INSN.
1896 This is used only when INSN is an `asm' with operands,
1897 and each ASM_OPERANDS records its own source file and line. */
1900 v_warning_for_asm (insn, s, ap)
1905 if (count_error (1))
1910 file_and_line_for_asm (insn, &file, &line);
1911 report_error_function (file);
1912 v_message_with_file_and_line (file, line, "warning", s, ap);
1917 warning_for_asm VPROTO((rtx insn, char *s, ...))
1919 #ifndef ANSI_PROTOTYPES
1927 #ifndef ANSI_PROTOTYPES
1928 insn = va_arg (ap, rtx);
1929 s = va_arg (ap, char *);
1932 v_warning_for_asm (insn, s, ap);
1936 /* Report a warning at the current line number. */
1943 v_warning_with_file_and_line (input_filename, lineno, s, ap);
1947 warning VPROTO((char *s, ...))
1949 #ifndef ANSI_PROTOTYPES
1956 #ifndef ANSI_PROTOTYPES
1957 s = va_arg (ap, char *);
1964 /* These functions issue either warnings or errors depending on
1965 -pedantic-errors. */
1972 if (flag_pedantic_errors)
1979 pedwarn VPROTO((char *s, ...))
1981 #ifndef ANSI_PROTOTYPES
1988 #ifndef ANSI_PROTOTYPES
1989 s = va_arg (ap, char *);
1997 v_pedwarn_with_decl (decl, s, ap)
2002 /* We don't want -pedantic-errors to cause the compilation to fail from
2003 "errors" in system header files. Sometimes fixincludes can't fix what's
2004 broken (eg: unsigned char bitfields - fixing it may change the alignment
2005 which will cause programs to mysteriously fail because the C library
2006 or kernel uses the original layout). There's no point in issuing a
2007 warning either, it's just unnecessary noise. */
2009 if (! DECL_IN_SYSTEM_HEADER (decl))
2011 if (flag_pedantic_errors)
2012 v_error_with_decl (decl, s, ap);
2014 v_warning_with_decl (decl, s, ap);
2019 pedwarn_with_decl VPROTO((tree decl, char *s, ...))
2021 #ifndef ANSI_PROTOTYPES
2029 #ifndef ANSI_PROTOTYPES
2030 decl = va_arg (ap, tree);
2031 s = va_arg (ap, char *);
2034 v_pedwarn_with_decl (decl, s, ap);
2039 v_pedwarn_with_file_and_line (file, line, s, ap)
2045 if (flag_pedantic_errors)
2046 v_error_with_file_and_line (file, line, s, ap);
2048 v_warning_with_file_and_line (file, line, s, ap);
2052 pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
2054 #ifndef ANSI_PROTOTYPES
2063 #ifndef ANSI_PROTOTYPES
2064 file = va_arg (ap, char *);
2065 line = va_arg (ap, int);
2066 s = va_arg (ap, char *);
2069 v_pedwarn_with_file_and_line (file, line, s, ap);
2073 /* Apologize for not implementing some feature. */
2082 fprintf (stderr, "%s:%d: ", input_filename, lineno);
2084 fprintf (stderr, "%s: ", progname);
2085 vmessage ("sorry, not implemented", s, ap);
2086 fputc ('\n', stderr);
2090 sorry VPROTO((char *s, ...))
2092 #ifndef ANSI_PROTOTYPES
2099 #ifndef ANSI_PROTOTYPES
2100 s = va_arg (ap, char *);
2107 /* Apologize for not implementing some feature, then quit. */
2110 v_really_sorry (s, ap)
2116 fprintf (stderr, "%s:%d: ", input_filename, lineno);
2118 fprintf (stderr, "%s: ", progname);
2119 vmessage ("sorry, not implemented", s, ap);
2120 fatal (" (fatal)\n");
2124 really_sorry VPROTO((char *s, ...))
2126 #ifndef ANSI_PROTOTYPES
2133 #ifndef ANSI_PROTOTYPES
2134 s = va_arg (ap, char *);
2137 v_really_sorry (s, ap);
2141 /* More 'friendly' abort that prints the line and file.
2142 config.h can #define abort fancy_abort if you like that sort of thing.
2144 I don't think this is actually a good idea.
2145 Other sorts of crashes will look a certain way.
2146 It is a good thing if crashes from calling abort look the same way.
2152 fatal ("internal gcc abort");
2155 /* This calls abort and is used to avoid problems when abort if a macro.
2156 It is used when we need to pass the address of abort. */
2164 /* When `malloc.c' is compiled with `rcheck' defined,
2165 it calls this function to report clobberage. */
2169 char * s ATTRIBUTE_UNUSED;
2174 /* Same as `malloc' but report error if no memory available. */
2180 register char *value;
2185 value = (char *) malloc (size);
2187 fatal ("virtual memory exhausted");
2191 /* Same as `calloc' but report error if no memory available. */
2194 xcalloc (size1, size2)
2195 unsigned size1, size2;
2197 register char *value;
2199 if (size1 == 0 || size2 == 0)
2202 value = (char *) calloc (size1, size2);
2204 fatal ("virtual memory exhausted");
2209 /* Same as `realloc' but report error if no memory available.
2210 Also handle null PTR even if the vendor realloc gets it wrong. */
2213 xrealloc (ptr, size)
2223 ? (char *) realloc (ptr, size)
2224 : (char *) malloc (size));
2227 fatal ("virtual memory exhausted");
2232 /* Same as `strdup' but report error if no memory available. */
2238 register char *result = (char *) malloc (strlen (s) + 1);
2241 fatal ("virtual memory exhausted");
2246 /* Return the logarithm of X, base 2, considering X unsigned,
2247 if X is a power of 2. Otherwise, returns -1.
2249 This should be used via the `exact_log2' macro. */
2253 register unsigned HOST_WIDE_INT x;
2255 register int log = 0;
2256 /* Test for 0 or a power of 2. */
2257 if (x == 0 || x != (x & -x))
2259 while ((x >>= 1) != 0)
2264 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
2265 If X is 0, return -1.
2267 This should be used via the floor_log2 macro. */
2271 register unsigned HOST_WIDE_INT x;
2273 register int log = -1;
2280 static int float_handler_set;
2282 jmp_buf float_handler;
2284 /* Signals actually come here. */
2287 float_signal (signo)
2288 /* If this is missing, some compilers complain. */
2289 int signo ATTRIBUTE_UNUSED;
2291 if (float_handled == 0)
2293 #if defined (USG) || defined (hpux)
2294 signal (SIGFPE, float_signal); /* re-enable the signal catcher */
2297 signal (SIGFPE, float_signal);
2298 longjmp (float_handler, 1);
2301 /* Specify where to longjmp to when a floating arithmetic error happens.
2302 If HANDLER is 0, it means don't handle the errors any more. */
2305 set_float_handler (handler)
2308 float_handled = (handler != 0);
2310 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
2312 if (float_handled && ! float_handler_set)
2314 signal (SIGFPE, float_signal);
2315 float_handler_set = 1;
2319 /* Specify, in HANDLER, where to longjmp to when a floating arithmetic
2320 error happens, pushing the previous specification into OLD_HANDLER.
2321 Return an indication of whether there was a previous handler in effect. */
2324 push_float_handler (handler, old_handler)
2325 jmp_buf handler, old_handler;
2327 int was_handled = float_handled;
2331 memcpy ((char *) old_handler, (char *) float_handler,
2332 sizeof (float_handler));
2334 memcpy ((char *) float_handler, (char *) handler, sizeof (float_handler));
2338 /* Restore the previous specification of whether and where to longjmp to
2339 when a floating arithmetic error happens. */
2342 pop_float_handler (handled, handler)
2346 float_handled = handled;
2348 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
2351 /* Handler for SIGPIPE. */
2355 /* If this is missing, some compilers complain. */
2356 int signo ATTRIBUTE_UNUSED;
2358 fatal ("output pipe has been closed");
2361 /* Strip off a legitimate source ending from the input string NAME of
2362 length LEN. Rather than having to know the names used by all of
2363 our front ends, we strip off an ending of a period followed by
2364 up to five characters. (Java uses ".class".) */
2367 strip_off_ending (name, len)
2372 for (i = 2; i < 6 && len > i; i++)
2374 if (name[len - i] == '.')
2376 name[len - i] = '\0';
2382 /* Output a quoted string. */
2385 output_quoted_string (asm_file, string)
2389 #ifdef OUTPUT_QUOTED_STRING
2390 OUTPUT_QUOTED_STRING (asm_file, string);
2394 putc ('\"', asm_file);
2395 while ((c = *string++) != 0)
2397 if (c == '\"' || c == '\\')
2398 putc ('\\', asm_file);
2401 putc ('\"', asm_file);
2405 /* Output a file name in the form wanted by System V. */
2408 output_file_directive (asm_file, input_name)
2412 int len = strlen (input_name);
2413 char *na = input_name + len;
2415 /* NA gets INPUT_NAME sans directory names. */
2416 while (na > input_name)
2420 #ifdef DIR_SEPARATOR
2421 if (na[-1] == DIR_SEPARATOR)
2427 #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
2428 ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file, na);
2430 #ifdef ASM_OUTPUT_SOURCE_FILENAME
2431 ASM_OUTPUT_SOURCE_FILENAME (asm_file, na);
2433 fprintf (asm_file, "\t.file\t");
2434 output_quoted_string (asm_file, na);
2435 fputc ('\n', asm_file);
2440 #ifdef ASM_IDENTIFY_LANGUAGE
2441 /* Routine to build language identifier for object file. */
2443 output_lang_identify (asm_out_file)
2446 int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
2447 char *s = (char *) alloca (len);
2448 sprintf (s, "__gnu_compiled_%s", lang_identify ());
2449 ASM_OUTPUT_LABEL (asm_out_file, s);
2453 /* Routine to open a dump file. */
2455 open_dump_file (suffix, function_name)
2457 char *function_name;
2464 dumpname = (char *) xmalloc (strlen (dump_base_name) + strlen (suffix) + 1);
2466 if (rtl_dump_file != NULL)
2467 fclose (rtl_dump_file);
2469 strcpy (dumpname, dump_base_name);
2470 strcat (dumpname, suffix);
2472 rtl_dump_file = fopen (dumpname, "a");
2474 if (rtl_dump_file == NULL)
2475 pfatal_with_name (dumpname);
2480 fprintf (rtl_dump_file, "\n;; Function %s\n\n", function_name);
2486 /* Routine to close a dump file. */
2488 close_dump_file (func, insns)
2489 void (*func) PROTO ((FILE *, rtx));
2496 func (rtl_dump_file, insns);
2498 fflush (rtl_dump_file);
2499 fclose (rtl_dump_file);
2501 rtl_dump_file = NULL;
2507 /* Routine to dump rtl into a file. */
2509 dump_rtl (suffix, decl, func, insns)
2512 void (*func) PROTO ((FILE *, rtx));
2515 open_dump_file (suffix, decl_printable_name (decl, 2));
2516 close_dump_file (func, insns);
2519 /* Routine to empty a dump file. */
2521 clean_dump_file (suffix)
2526 dumpname = (char *) xmalloc (strlen (dump_base_name) + strlen (suffix) + 1);
2528 strcpy (dumpname, dump_base_name);
2529 strcat (dumpname, suffix);
2531 rtl_dump_file = fopen (dumpname, "w");
2533 if (rtl_dump_file == NULL)
2534 pfatal_with_name (dumpname);
2538 fclose (rtl_dump_file);
2539 rtl_dump_file = NULL;
2545 /* Compile an entire file of output from cpp, named NAME.
2546 Write a file of assembly output and various debugging dumps. */
2555 int name_specified = name != 0;
2557 if (dump_base_name == 0)
2558 dump_base_name = name ? name : "gccdump";
2562 integration_time = 0;
2568 branch_prob_time = 0;
2573 local_alloc_time = 0;
2574 global_alloc_time = 0;
2579 shorten_branch_time = 0;
2585 /* Initialize data in various passes. */
2589 name = init_parse (name);
2591 init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
2592 || debug_info_level == DINFO_LEVEL_VERBOSE
2593 || flag_test_coverage);
2595 init_decl_processing ();
2604 if (flag_caller_saves)
2605 init_caller_save ();
2607 /* If auxiliary info generation is desired, open the output file.
2608 This goes in the same directory as the source file--unlike
2609 all the other output files. */
2610 if (flag_gen_aux_info)
2612 aux_info_file = fopen (aux_info_file_name, "w");
2613 if (aux_info_file == 0)
2614 pfatal_with_name (aux_info_file_name);
2617 /* Clear the dump files. */
2619 clean_dump_file (".rtl");
2622 clean_dump_file (".jump");
2623 if (graph_dump_format != no_graph)
2624 clean_graph_dump_file (dump_base_name, ".jump");
2628 clean_dump_file (".addressof");
2629 if (graph_dump_format != no_graph)
2630 clean_graph_dump_file (dump_base_name, ".addressof");
2634 clean_dump_file (".cse");
2635 if (graph_dump_format != no_graph)
2636 clean_graph_dump_file (dump_base_name, ".cse");
2640 clean_dump_file (".loop");
2641 if (graph_dump_format != no_graph)
2642 clean_graph_dump_file (dump_base_name, ".loop");
2646 clean_dump_file (".cse2");
2647 if (graph_dump_format != no_graph)
2648 clean_graph_dump_file (dump_base_name, ".cse2");
2650 if (branch_prob_dump)
2652 clean_dump_file (".bp");
2653 if (graph_dump_format != no_graph)
2654 clean_graph_dump_file (dump_base_name, ".bp");
2658 clean_dump_file (".flow");
2659 if (graph_dump_format != no_graph)
2660 clean_graph_dump_file (dump_base_name, ".flow");
2664 clean_dump_file (".combine");
2665 if (graph_dump_format != no_graph)
2666 clean_graph_dump_file (dump_base_name, ".combine");
2670 clean_dump_file (".regmove");
2671 if (graph_dump_format != no_graph)
2672 clean_graph_dump_file (dump_base_name, ".regmove");
2676 clean_dump_file (".sched");
2677 if (graph_dump_format != no_graph)
2678 clean_graph_dump_file (dump_base_name, ".sched");
2682 clean_dump_file (".lreg");
2683 if (graph_dump_format != no_graph)
2684 clean_graph_dump_file (dump_base_name, ".lreg");
2686 if (global_reg_dump)
2688 clean_dump_file (".greg");
2689 if (graph_dump_format != no_graph)
2690 clean_graph_dump_file (dump_base_name, ".greg");
2694 clean_dump_file (".sched2");
2695 if (graph_dump_format != no_graph)
2696 clean_graph_dump_file (dump_base_name, ".sched2");
2700 clean_dump_file (".jump2");
2701 if (graph_dump_format != no_graph)
2702 clean_graph_dump_file (dump_base_name, ".jump2");
2707 clean_dump_file (".dbr");
2708 if (graph_dump_format != no_graph)
2709 clean_graph_dump_file (dump_base_name, ".dbr");
2714 clean_dump_file (".gcse");
2715 if (graph_dump_format != no_graph)
2716 clean_graph_dump_file (dump_base_name, ".gcse");
2721 clean_dump_file (".stack");
2722 if (graph_dump_format != no_graph)
2723 clean_graph_dump_file (dump_base_name, ".stack");
2726 #ifdef MACHINE_DEPENDENT_REORG
2727 if (mach_dep_reorg_dump)
2729 clean_dump_file (".mach");
2730 if (graph_dump_format != no_graph)
2731 clean_graph_dump_file (dump_base_name, ".mach");
2735 /* Open assembler code output file. */
2737 if (flag_syntax_only)
2738 asm_out_file = NULL;
2741 if (! name_specified && asm_file_name == 0)
2742 asm_out_file = stdout;
2745 int len = strlen (dump_base_name);
2746 register char *dumpname = (char *) xmalloc (len + 6);
2747 strcpy (dumpname, dump_base_name);
2748 strip_off_ending (dumpname, len);
2749 strcat (dumpname, ".s");
2750 if (asm_file_name == 0)
2752 asm_file_name = (char *) xmalloc (strlen (dumpname) + 1);
2753 strcpy (asm_file_name, dumpname);
2755 if (!strcmp (asm_file_name, "-"))
2756 asm_out_file = stdout;
2758 asm_out_file = fopen (asm_file_name, "w");
2759 if (asm_out_file == 0)
2760 pfatal_with_name (asm_file_name);
2763 #ifdef IO_BUFFER_SIZE
2764 setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
2765 _IOFBF, IO_BUFFER_SIZE);
2769 input_filename = name;
2771 /* Put an entry on the input file stack for the main input file. */
2773 = (struct file_stack *) xmalloc (sizeof (struct file_stack));
2774 input_file_stack->next = 0;
2775 input_file_stack->name = input_filename;
2777 /* Perform language-specific initialization.
2778 This may set main_input_filename. */
2781 /* If the input doesn't start with a #line, use the input name
2782 as the official input file name. */
2783 if (main_input_filename == 0)
2784 main_input_filename = name;
2786 if (flag_syntax_only)
2788 write_symbols = NO_DEBUG;
2790 profile_block_flag = 0;
2794 ASM_FILE_START (asm_out_file);
2796 #ifdef ASM_COMMENT_START
2797 if (flag_verbose_asm)
2799 /* Print the list of options in effect. */
2800 print_version (asm_out_file, ASM_COMMENT_START);
2801 print_switch_values (asm_out_file, 0, MAX_LINE,
2802 ASM_COMMENT_START, " ", "\n");
2803 /* Add a blank line here so it appears in assembler output but not
2805 fprintf (asm_out_file, "\n");
2809 /* Output something to inform GDB that this compilation was by GCC. */
2810 #ifndef ASM_IDENTIFY_GCC
2811 fprintf (asm_out_file, "gcc2_compiled.:\n");
2813 ASM_IDENTIFY_GCC (asm_out_file);
2816 /* Output something to identify which front-end produced this file. */
2817 #ifdef ASM_IDENTIFY_LANGUAGE
2818 ASM_IDENTIFY_LANGUAGE (asm_out_file);
2820 } /* ! flag_syntax_only */
2822 #ifndef ASM_OUTPUT_SECTION_NAME
2823 if (flag_function_sections)
2825 warning ("-ffunction-sections not supported for this target.");
2826 flag_function_sections = 0;
2828 if (flag_data_sections)
2830 warning ("-fdata-sections not supported for this target.");
2831 flag_data_sections = 0;
2835 if (flag_function_sections
2836 && (profile_flag || profile_block_flag))
2838 warning ("-ffunction-sections disabled; it makes profiling impossible.");
2839 flag_function_sections = 0;
2842 if (flag_function_sections && write_symbols != NO_DEBUG)
2843 warning ("-ffunction-sections may affect debugging on some targets.");
2845 /* ??? Note: There used to be a conditional here
2846 to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
2847 This was to guarantee separation between gcc_compiled. and
2848 the first function, for the sake of dbx on Suns.
2849 However, having the extra zero here confused the Emacs
2850 code for unexec, and might confuse other programs too.
2851 Therefore, I took out that change.
2852 In future versions we should find another way to solve
2853 that dbx problem. -- rms, 23 May 93. */
2855 /* Don't let the first function fall at the same address
2856 as gcc_compiled., if profiling. */
2857 if (profile_flag || profile_block_flag)
2859 /* It's best if we can write a nop here since some
2860 assemblers don't tolerate zeros in the text section. */
2861 if (insn_template[CODE_FOR_nop] != 0)
2862 output_asm_insn (insn_template[CODE_FOR_nop], NULL_PTR);
2864 assemble_zeros (UNITS_PER_WORD);
2867 /* If dbx symbol table desired, initialize writing it
2868 and output the predefined types. */
2869 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2870 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2871 TIMEVAR (symout_time, dbxout_init (asm_out_file, main_input_filename,
2874 #ifdef SDB_DEBUGGING_INFO
2875 if (write_symbols == SDB_DEBUG)
2876 TIMEVAR (symout_time, sdbout_init (asm_out_file, main_input_filename,
2879 #ifdef DWARF_DEBUGGING_INFO
2880 if (write_symbols == DWARF_DEBUG)
2881 TIMEVAR (symout_time, dwarfout_init (asm_out_file, main_input_filename));
2883 #ifdef DWARF2_UNWIND_INFO
2884 if (dwarf2out_do_frame ())
2885 dwarf2out_frame_init ();
2887 #ifdef DWARF2_DEBUGGING_INFO
2888 if (write_symbols == DWARF2_DEBUG)
2889 TIMEVAR (symout_time, dwarf2out_init (asm_out_file, main_input_filename));
2892 /* Initialize yet another pass. */
2894 init_final (main_input_filename);
2895 init_branch_prob (dump_base_name);
2897 start_time = get_run_time ();
2899 /* Call the parser, which parses the entire file
2900 (calling rest_of_compilation for each function). */
2902 if (yyparse () != 0)
2904 if (errorcount == 0)
2905 fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)");
2907 /* In case there were missing closebraces,
2908 get us back to the global binding level. */
2909 while (! global_bindings_p ())
2913 output_func_start_profiler ();
2915 /* Compilation is now finished except for writing
2916 what's left of the symbol table output. */
2918 parse_time += get_run_time () - start_time;
2920 parse_time -= integration_time;
2921 parse_time -= varconst_time;
2923 if (flag_syntax_only)
2926 globals = getdecls ();
2928 /* Really define vars that have had only a tentative definition.
2929 Really output inline functions that must actually be callable
2930 and have not been output so far. */
2933 int len = list_length (globals);
2934 tree *vec = (tree *) alloca (sizeof (tree) * len);
2939 /* Process the decls in reverse order--earliest first.
2940 Put them into VEC from back to front, then take out from front. */
2942 for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
2943 vec[len - i - 1] = decl;
2945 for (i = 0; i < len; i++)
2949 /* We're not deferring this any longer. */
2950 DECL_DEFER_OUTPUT (decl) = 0;
2952 if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0
2953 && incomplete_decl_finalize_hook != 0)
2954 (*incomplete_decl_finalize_hook) (decl);
2957 /* Now emit any global variables or functions that we have been putting
2958 off. We need to loop in case one of the things emitted here
2959 references another one which comes earlier in the list. */
2963 for (i = 0; i < len; i++)
2967 if (TREE_ASM_WRITTEN (decl) || DECL_EXTERNAL (decl))
2970 /* Don't write out static consts, unless we still need them.
2972 We also keep static consts if not optimizing (for debugging),
2973 unless the user specified -fno-keep-static-consts.
2974 ??? They might be better written into the debug information.
2975 This is possible when using DWARF.
2977 A language processor that wants static constants to be always
2978 written out (even if it is not used) is responsible for
2979 calling rest_of_decl_compilation itself. E.g. the C front-end
2980 calls rest_of_decl_compilation from finish_decl.
2981 One motivation for this is that is conventional in some
2982 environments to write things like:
2983 static const char rcsid[] = "... version string ...";
2984 intending to force the string to be in the executable.
2986 A language processor that would prefer to have unneeded
2987 static constants "optimized away" would just defer writing
2988 them out until here. E.g. C++ does this, because static
2989 constants are often defined in header files.
2991 ??? A tempting alternative (for both C and C++) would be
2992 to force a constant to be written if and only if it is
2993 defined in a main file, as opposed to an include file. */
2995 if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
2996 && (! TREE_READONLY (decl)
2997 || TREE_PUBLIC (decl)
2998 || (!optimize && flag_keep_static_consts)
2999 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
3002 rest_of_decl_compilation (decl, NULL_PTR, 1, 1);
3005 if (TREE_CODE (decl) == FUNCTION_DECL
3006 && DECL_INITIAL (decl) != 0
3007 && DECL_SAVED_INSNS (decl) != 0
3008 && (flag_keep_inline_functions
3009 || TREE_PUBLIC (decl)
3010 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
3013 temporary_allocation ();
3014 output_inline_function (decl);
3015 permanent_allocation (1);
3020 /* Now that all possible functions have been output, we can dump
3021 the exception table. */
3023 output_exception_table ();
3025 for (i = 0; i < len; i++)
3029 if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
3030 && ! TREE_ASM_WRITTEN (decl))
3031 /* Cancel the RTL for this decl so that, if debugging info
3032 output for global variables is still to come,
3033 this one will be omitted. */
3034 DECL_RTL (decl) = NULL;
3036 /* Warn about any function
3037 declared static but not defined.
3038 We don't warn about variables,
3039 because many programs have static variables
3040 that exist only to get some text into the object file. */
3041 if (TREE_CODE (decl) == FUNCTION_DECL
3043 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
3044 && DECL_INITIAL (decl) == 0
3045 && DECL_EXTERNAL (decl)
3046 && ! DECL_ARTIFICIAL (decl)
3047 && ! TREE_PUBLIC (decl))
3049 if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
3050 pedwarn_with_decl (decl,
3051 "`%s' used but never defined");
3053 warning_with_decl (decl,
3054 "`%s' declared `static' but never defined");
3055 /* This symbol is effectively an "extern" declaration now. */
3056 TREE_PUBLIC (decl) = 1;
3057 assemble_external (decl);
3060 /* Warn about static fns or vars defined but not used,
3061 but not about inline functions or static consts
3062 since defining those in header files is normal practice. */
3064 && ((TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
3065 || (TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
3066 && ! DECL_IN_SYSTEM_HEADER (decl)
3067 && ! DECL_EXTERNAL (decl)
3068 && ! TREE_PUBLIC (decl)
3069 && ! TREE_USED (decl)
3070 && (TREE_CODE (decl) == FUNCTION_DECL || ! DECL_REGISTER (decl))
3071 /* The TREE_USED bit for file-scope decls
3072 is kept in the identifier, to handle multiple
3073 external decls in different scopes. */
3074 && ! TREE_USED (DECL_NAME (decl)))
3075 warning_with_decl (decl, "`%s' defined but not used");
3077 #ifdef SDB_DEBUGGING_INFO
3078 /* The COFF linker can move initialized global vars to the end.
3079 And that can screw up the symbol ordering.
3080 By putting the symbols in that order to begin with,
3081 we avoid a problem. mcsun!unido!fauern!tumuc!pes@uunet.uu.net. */
3082 if (write_symbols == SDB_DEBUG && TREE_CODE (decl) == VAR_DECL
3083 && TREE_PUBLIC (decl) && DECL_INITIAL (decl)
3084 && ! DECL_EXTERNAL (decl)
3085 && DECL_RTL (decl) != 0)
3086 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
3088 /* Output COFF information for non-global
3089 file-scope initialized variables. */
3090 if (write_symbols == SDB_DEBUG
3091 && TREE_CODE (decl) == VAR_DECL
3092 && DECL_INITIAL (decl)
3093 && ! DECL_EXTERNAL (decl)
3094 && DECL_RTL (decl) != 0
3095 && GET_CODE (DECL_RTL (decl)) == MEM)
3096 TIMEVAR (symout_time, sdbout_toplevel_data (decl));
3097 #endif /* SDB_DEBUGGING_INFO */
3098 #ifdef DWARF_DEBUGGING_INFO
3099 /* Output DWARF information for file-scope tentative data object
3100 declarations, file-scope (extern) function declarations (which
3101 had no corresponding body) and file-scope tagged type declarations
3102 and definitions which have not yet been forced out. */
3104 if (write_symbols == DWARF_DEBUG
3105 && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
3106 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 1));
3108 #ifdef DWARF2_DEBUGGING_INFO
3109 /* Output DWARF2 information for file-scope tentative data object
3110 declarations, file-scope (extern) function declarations (which
3111 had no corresponding body) and file-scope tagged type declarations
3112 and definitions which have not yet been forced out. */
3114 if (write_symbols == DWARF2_DEBUG
3115 && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
3116 TIMEVAR (symout_time, dwarf2out_decl (decl));
3121 /* Write out any pending weak symbol declarations. */
3125 /* Do dbx symbols */
3126 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
3127 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
3128 TIMEVAR (symout_time,
3130 dbxout_finish (asm_out_file, main_input_filename);
3134 #ifdef DWARF_DEBUGGING_INFO
3135 if (write_symbols == DWARF_DEBUG)
3136 TIMEVAR (symout_time,
3142 #ifdef DWARF2_UNWIND_INFO
3143 if (dwarf2out_do_frame ())
3144 dwarf2out_frame_finish ();
3147 #ifdef DWARF2_DEBUGGING_INFO
3148 if (write_symbols == DWARF2_DEBUG)
3149 TIMEVAR (symout_time,
3151 dwarf2out_finish ();
3155 /* Output some stuff at end of file if nec. */
3157 end_final (dump_base_name);
3159 if (branch_prob_dump)
3160 open_dump_file (".bp", NULL);
3162 TIMEVAR (dump_time, end_branch_prob (rtl_dump_file));
3164 if (branch_prob_dump)
3165 close_dump_file (NULL, NULL_RTX);
3168 ASM_FILE_END (asm_out_file);
3172 /* Language-specific end of compilation actions. */
3176 /* Close the dump files. */
3178 if (flag_gen_aux_info)
3180 fclose (aux_info_file);
3182 unlink (aux_info_file_name);
3187 open_dump_file (".combine", NULL);
3188 TIMEVAR (dump_time, dump_combine_total_stats (rtl_dump_file));
3189 close_dump_file (NULL, NULL_RTX);
3192 /* Close non-debugging input and output files. Take special care to note
3193 whether fclose returns an error, since the pages might still be on the
3194 buffer chain while the file is open. */
3198 if (! flag_syntax_only
3199 && (ferror (asm_out_file) != 0 || fclose (asm_out_file) != 0))
3200 fatal_io_error (asm_file_name);
3202 /* Do whatever is necessary to finish printing the graphs. */
3203 if (graph_dump_format != no_graph)
3206 finish_graph_dump_file (dump_base_name, ".jump");
3208 finish_graph_dump_file (dump_base_name, ".addressof");
3210 finish_graph_dump_file (dump_base_name, ".cse");
3212 finish_graph_dump_file (dump_base_name, ".loop");
3214 finish_graph_dump_file (dump_base_name, ".cse2");
3215 if (branch_prob_dump)
3216 finish_graph_dump_file (dump_base_name, ".bp");
3218 finish_graph_dump_file (dump_base_name, ".flow");
3220 finish_graph_dump_file (dump_base_name, ".combine");
3222 finish_graph_dump_file (dump_base_name, ".regmove");
3224 finish_graph_dump_file (dump_base_name, ".sched");
3226 finish_graph_dump_file (dump_base_name, ".lreg");
3227 if (global_reg_dump)
3228 finish_graph_dump_file (dump_base_name, ".greg");
3230 finish_graph_dump_file (dump_base_name, ".sched2");
3232 finish_graph_dump_file (dump_base_name, ".jump2");
3235 finish_graph_dump_file (dump_base_name, ".dbr");
3238 finish_graph_dump_file (dump_base_name, ".gcse");
3241 finish_graph_dump_file (dump_base_name, ".stack");
3243 #ifdef MACHINE_DEPENDENT_REORG
3244 if (mach_dep_reorg_dump)
3245 finish_graph_dump_file (dump_base_name, ".mach");
3249 /* Free up memory for the benefit of leak detectors. */
3252 /* Print the times. */
3256 fprintf (stderr,"\n");
3257 print_time ("parse", parse_time);
3259 print_time ("integration", integration_time);
3260 print_time ("jump", jump_time);
3261 print_time ("cse", cse_time);
3262 print_time ("gcse", gcse_time);
3263 print_time ("loop", loop_time);
3264 print_time ("cse2", cse2_time);
3265 print_time ("branch-prob", branch_prob_time);
3266 print_time ("flow", flow_time);
3267 print_time ("combine", combine_time);
3268 print_time ("regmove", regmove_time);
3269 print_time ("sched", sched_time);
3270 print_time ("local-alloc", local_alloc_time);
3271 print_time ("global-alloc", global_alloc_time);
3272 print_time ("sched2", sched2_time);
3274 print_time ("dbranch", dbr_sched_time);
3276 print_time ("shorten-branch", shorten_branch_time);
3277 print_time ("stack-reg", stack_reg_time);
3278 print_time ("final", final_time);
3279 print_time ("varconst", varconst_time);
3280 print_time ("symout", symout_time);
3281 print_time ("dump", dump_time);
3285 /* This is called from various places for FUNCTION_DECL, VAR_DECL,
3286 and TYPE_DECL nodes.
3288 This does nothing for local (non-static) variables.
3289 Otherwise, it sets up the RTL and outputs any assembler code
3290 (label definition, storage allocation and initialization).
3292 DECL is the declaration. If ASMSPEC is nonzero, it specifies
3293 the assembler symbol name to be used. TOP_LEVEL is nonzero
3294 if this declaration is not within a function. */
3297 rest_of_decl_compilation (decl, asmspec, top_level, at_end)
3303 /* Declarations of variables, and of functions defined elsewhere. */
3305 /* The most obvious approach, to put an #ifndef around where
3306 this macro is used, doesn't work since it's inside a macro call. */
3307 #ifndef ASM_FINISH_DECLARE_OBJECT
3308 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
3311 /* Forward declarations for nested functions are not "external",
3312 but we need to treat them as if they were. */
3313 if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
3314 || TREE_CODE (decl) == FUNCTION_DECL)
3315 TIMEVAR (varconst_time,
3317 make_decl_rtl (decl, asmspec, top_level);
3318 /* Initialized extern variable exists to be replaced
3319 with its value, or represents something that will be
3320 output in another file. */
3321 if (! (TREE_CODE (decl) == VAR_DECL
3322 && DECL_EXTERNAL (decl) && TREE_READONLY (decl)
3323 && DECL_INITIAL (decl) != 0
3324 && DECL_INITIAL (decl) != error_mark_node))
3325 /* Don't output anything
3326 when a tentative file-scope definition is seen.
3327 But at end of compilation, do output code for them. */
3328 if (! (! at_end && top_level
3329 && (DECL_INITIAL (decl) == 0
3330 || DECL_INITIAL (decl) == error_mark_node)))
3331 assemble_variable (decl, top_level, at_end, 0);
3332 if (decl == last_assemble_variable_decl)
3334 ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
3338 else if (DECL_REGISTER (decl) && asmspec != 0)
3340 if (decode_reg_name (asmspec) >= 0)
3342 DECL_RTL (decl) = 0;
3343 make_decl_rtl (decl, asmspec, top_level);
3346 error ("invalid register name `%s' for register variable", asmspec);
3348 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
3349 else if ((write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
3350 && TREE_CODE (decl) == TYPE_DECL)
3351 TIMEVAR (symout_time, dbxout_symbol (decl, 0));
3353 #ifdef SDB_DEBUGGING_INFO
3354 else if (write_symbols == SDB_DEBUG && top_level
3355 && TREE_CODE (decl) == TYPE_DECL)
3356 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
3360 /* Called after finishing a record, union or enumeral type. */
3363 rest_of_type_compilation (type, toplev)
3364 #if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) || defined (SDB_DEBUGGING_INFO)
3368 tree type ATTRIBUTE_UNUSED;
3369 int toplev ATTRIBUTE_UNUSED;
3372 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
3373 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
3374 TIMEVAR (symout_time, dbxout_symbol (TYPE_STUB_DECL (type), !toplev));
3376 #ifdef SDB_DEBUGGING_INFO
3377 if (write_symbols == SDB_DEBUG)
3378 TIMEVAR (symout_time, sdbout_symbol (TYPE_STUB_DECL (type), !toplev));
3382 /* This is called from finish_function (within yyparse)
3383 after each top-level definition is parsed.
3384 It is supposed to compile that function or variable
3385 and output the assembler code for it.
3386 After we return, the tree storage is freed. */
3389 rest_of_compilation (decl)
3393 int start_time = get_run_time ();
3395 /* Nonzero if we have saved the original DECL_INITIAL of the function,
3396 to be restored after we finish compiling the function
3397 (for use when compiling inline calls to this function). */
3398 tree saved_block_tree = 0;
3399 /* Likewise, for DECL_ARGUMENTS. */
3400 tree saved_arguments = 0;
3403 /* If we are reconsidering an inline function
3404 at the end of compilation, skip the stuff for making it inline. */
3406 if (DECL_SAVED_INSNS (decl) == 0)
3411 /* If requested, consider whether to make this function inline. */
3412 if (DECL_INLINE (decl) || flag_inline_functions)
3413 TIMEVAR (integration_time,
3415 lose = function_cannot_inline_p (decl);
3416 if (lose || ! optimize)
3418 if (warn_inline && DECL_INLINE (decl))
3419 warning_with_decl (decl, lose);
3420 DECL_ABSTRACT_ORIGIN (decl) = 0;
3421 /* Don't really compile an extern inline function.
3422 If we can't make it inline, pretend
3423 it was only declared. */
3424 if (DECL_EXTERNAL (decl))
3426 DECL_INITIAL (decl) = 0;
3427 goto exit_rest_of_compilation;
3431 /* ??? Note that this has the effect of making it look
3432 like "inline" was specified for a function if we choose
3433 to inline it. This isn't quite right, but it's
3434 probably not worth the trouble to fix. */
3435 inlinable = DECL_INLINE (decl) = 1;
3438 insns = get_insns ();
3440 /* Dump the rtl code if we are dumping rtl. */
3444 open_dump_file (".rtl", decl_printable_name (decl, 2));
3446 if (DECL_SAVED_INSNS (decl))
3447 fprintf (rtl_dump_file, ";; (integrable)\n\n");
3449 close_dump_file (print_rtl, insns);
3452 /* If we can, defer compiling inlines until EOF.
3453 save_for_inline_copying can be extremely expensive. */
3454 if (inlinable && ! decl_function_context (decl))
3455 DECL_DEFER_OUTPUT (decl) = 1;
3457 /* If function is inline, and we don't yet know whether to
3458 compile it by itself, defer decision till end of compilation.
3459 finish_compilation will call rest_of_compilation again
3460 for those functions that need to be output. Also defer those
3461 functions that we are supposed to defer. We cannot defer
3462 functions containing nested functions since the nested function
3463 data is in our non-saved obstack. We cannot defer nested
3464 functions for the same reason. */
3466 /* If this is a nested inline, remove ADDRESSOF now so we can
3467 finish compiling ourselves. Otherwise, wait until EOF.
3468 We have to do this because the purge_addressof transformation
3469 changes the DECL_RTL for many variables, which confuses integrate. */
3472 if (decl_function_context (decl))
3473 purge_addressof (insns);
3475 DECL_DEFER_OUTPUT (decl) = 1;
3478 if (! current_function_contains_functions
3479 && (DECL_DEFER_OUTPUT (decl)
3480 || (DECL_INLINE (decl)
3481 && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
3482 && ! flag_keep_inline_functions)
3483 || DECL_EXTERNAL (decl)))))
3485 DECL_DEFER_OUTPUT (decl) = 1;
3487 /* If -Wreturn-type, we have to do a bit of compilation.
3488 However, if we just fall through we will call
3489 save_for_inline_copying() which results in excessive
3490 memory use. Instead, we just want to call
3491 jump_optimize() to figure out whether or not we can fall
3492 off the end of the function; we do the minimum amount of
3493 work necessary to make that safe. And, we set optimize
3494 to zero to keep jump_optimize from working too hard. */
3495 if (warn_return_type)
3497 int saved_optimize = optimize;
3499 find_exception_handler_labels ();
3500 jump_optimize (get_insns(), !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES,
3501 !JUMP_AFTER_REGSCAN);
3502 optimize = saved_optimize;
3505 #ifdef DWARF_DEBUGGING_INFO
3506 /* Generate the DWARF info for the "abstract" instance
3507 of a function which we may later generate inlined and/or
3508 out-of-line instances of. */
3509 if (write_symbols == DWARF_DEBUG)
3511 set_decl_abstract_flags (decl, 1);
3512 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3513 set_decl_abstract_flags (decl, 0);
3516 #ifdef DWARF2_DEBUGGING_INFO
3517 /* Generate the DWARF2 info for the "abstract" instance
3518 of a function which we may later generate inlined and/or
3519 out-of-line instances of. */
3520 if (write_symbols == DWARF2_DEBUG)
3522 set_decl_abstract_flags (decl, 1);
3523 TIMEVAR (symout_time, dwarf2out_decl (decl));
3524 set_decl_abstract_flags (decl, 0);
3527 TIMEVAR (integration_time, save_for_inline_nocopy (decl));
3528 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlinable;
3529 goto exit_rest_of_compilation;
3532 /* If we have to compile the function now, save its rtl and subdecls
3533 so that its compilation will not affect what others get. */
3534 if (inlinable || DECL_DEFER_OUTPUT (decl))
3536 #ifdef DWARF_DEBUGGING_INFO
3537 /* Generate the DWARF info for the "abstract" instance of
3538 a function which we will generate an out-of-line instance
3539 of almost immediately (and which we may also later generate
3540 various inlined instances of). */
3541 if (write_symbols == DWARF_DEBUG)
3543 set_decl_abstract_flags (decl, 1);
3544 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3545 set_decl_abstract_flags (decl, 0);
3548 #ifdef DWARF2_DEBUGGING_INFO
3549 /* Generate the DWARF2 info for the "abstract" instance of
3550 a function which we will generate an out-of-line instance
3551 of almost immediately (and which we may also later generate
3552 various inlined instances of). */
3553 if (write_symbols == DWARF2_DEBUG)
3555 set_decl_abstract_flags (decl, 1);
3556 TIMEVAR (symout_time, dwarf2out_decl (decl));
3557 set_decl_abstract_flags (decl, 0);
3560 saved_block_tree = DECL_INITIAL (decl);
3561 saved_arguments = DECL_ARGUMENTS (decl);
3562 TIMEVAR (integration_time, save_for_inline_copying (decl));
3563 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlinable;
3566 /* If specified extern inline but we aren't inlining it, we are
3567 done. This goes for anything that gets here with DECL_EXTERNAL
3568 set, not just things with DECL_INLINE. */
3569 if (DECL_EXTERNAL (decl))
3570 goto exit_rest_of_compilation;
3573 if (! DECL_DEFER_OUTPUT (decl))
3574 TREE_ASM_WRITTEN (decl) = 1;
3576 /* Now that integrate will no longer see our rtl, we need not distinguish
3577 between the return value of this function and the return value of called
3579 rtx_equal_function_value_matters = 0;
3581 /* Don't return yet if -Wreturn-type; we need to do jump_optimize. */
3582 if ((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
3584 goto exit_rest_of_compilation;
3587 /* Emit code to get eh context, if needed. */
3591 /* If we are doing position-independent code generation, now
3592 is the time to output special prologues and epilogues.
3593 We do not want to do this earlier, because it just clutters
3594 up inline functions with meaningless insns. */
3599 /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
3600 Note that that may have been done above, in save_for_inline_copying.
3601 The call to resume_temporary_allocation near the end of this function
3602 goes back to the usual state of affairs. This must be done after
3603 we've built up any unwinders for exception handling, and done
3604 the FINALIZE_PIC work, if necessary. */
3606 rtl_in_current_obstack ();
3608 insns = get_insns ();
3610 /* Copy any shared structure that should not be shared. */
3612 unshare_all_rtl (insns);
3614 #ifdef SETJMP_VIA_SAVE_AREA
3615 /* This must be performed before virutal register instantiation. */
3616 if (current_function_calls_alloca)
3617 optimize_save_area_alloca (insns);
3620 /* Instantiate all virtual registers. */
3622 instantiate_virtual_regs (current_function_decl, get_insns ());
3624 /* See if we have allocated stack slots that are not directly addressable.
3625 If so, scan all the insns and create explicit address computation
3626 for all references to such slots. */
3627 /* fixup_stack_slots (); */
3629 /* Find all the EH handlers. */
3630 find_exception_handler_labels ();
3632 /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
3633 are initialized and to compute whether control can drop off the end
3635 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3636 TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP, !JUMP_NOOP_MOVES,
3637 JUMP_AFTER_REGSCAN));
3639 /* Now is when we stop if -fsyntax-only and -Wreturn-type. */
3640 if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
3641 goto exit_rest_of_compilation;
3643 /* Dump rtl code after jump, if we are doing that. */
3646 dump_rtl (".jump", decl, print_rtl, insns);
3648 /* Perform common subexpression elimination.
3649 Nonzero value from `cse_main' means that jumps were simplified
3650 and some code may now be unreachable, so do
3651 jump optimization again. */
3656 open_dump_file (".cse", decl_printable_name (decl, 2));
3658 TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1));
3660 if (flag_thread_jumps)
3661 /* Hacks by tiemann & kenner. */
3662 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 1));
3664 TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (),
3666 TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ()));
3668 if (tem || optimize > 1)
3669 TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP,
3671 !JUMP_AFTER_REGSCAN));
3673 /* Dump rtl code after cse, if we are doing that. */
3677 close_dump_file (print_rtl, insns);
3678 if (graph_dump_format != no_graph)
3679 print_rtl_graph_with_bb (dump_base_name, ".cse", insns);
3683 purge_addressof (insns);
3684 reg_scan (insns, max_reg_num (), 1);
3688 dump_rtl (".addressof", decl, print_rtl, insns);
3689 if (graph_dump_format != no_graph)
3690 print_rtl_graph_with_bb (dump_base_name, ".addressof", insns);
3693 /* Perform global cse. */
3695 if (optimize > 0 && flag_gcse)
3698 open_dump_file (".gcse", IDENTIFIER_POINTER (DECL_NAME (decl)));
3700 TIMEVAR (gcse_time, gcse_main (insns, rtl_dump_file));
3704 close_dump_file (print_rtl, insns);
3705 if (graph_dump_format != no_graph)
3706 print_rtl_graph_with_bb (dump_base_name, ".gcse", insns);
3709 /* Move constant computations out of loops. */
3714 open_dump_file (".loop", decl_printable_name (decl, 2));
3719 if (flag_rerun_loop_opt)
3721 /* We only want to perform unrolling once. */
3723 loop_optimize (insns, rtl_dump_file, 0, 0);
3726 /* The first call to loop_optimize makes some instructions
3727 trivially dead. We delete those instructions now in the
3728 hope that doing so will make the heuristics in loop work
3729 better and possibly speed up compilation. */
3730 delete_trivially_dead_insns (insns, max_reg_num ());
3732 /* The regscan pass is currently necessary as the alias
3733 analysis code depends on this information. */
3734 reg_scan (insns, max_reg_num (), 1);
3736 loop_optimize (insns, rtl_dump_file, flag_unroll_loops, 1);
3739 /* Dump rtl code after loop opt, if we are doing that. */
3743 close_dump_file (print_rtl, insns);
3744 if (graph_dump_format != no_graph)
3745 print_rtl_graph_with_bb (dump_base_name, ".loop", insns);
3752 open_dump_file (".cse2", decl_printable_name (decl, 2));
3754 if (flag_rerun_cse_after_loop)
3756 /* Running another jump optimization pass before the second
3757 cse pass sometimes simplifies the RTL enough to allow
3758 the second CSE pass to do a better job. Jump_optimize can change
3759 max_reg_num so we must rerun reg_scan afterwards.
3760 ??? Rework to not call reg_scan so often. */
3761 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3762 TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP,
3764 JUMP_AFTER_REGSCAN));
3766 TIMEVAR (cse2_time, reg_scan (insns, max_reg_num (), 0));
3767 TIMEVAR (cse2_time, tem = cse_main (insns, max_reg_num (),
3770 TIMEVAR (jump_time, jump_optimize (insns, !JUMP_CROSS_JUMP,
3772 !JUMP_AFTER_REGSCAN));
3775 if (flag_thread_jumps)
3777 /* This pass of jump threading straightens out code
3778 that was kinked by loop optimization. */
3779 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
3780 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
3783 /* Dump rtl code after cse, if we are doing that. */
3787 close_dump_file (print_rtl, insns);
3788 if (graph_dump_format != no_graph)
3789 print_rtl_graph_with_bb (dump_base_name, ".cse2", insns);
3793 if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
3795 if (branch_prob_dump)
3796 open_dump_file (".bp", decl_printable_name (decl, 2));
3801 branch_prob (insns, rtl_dump_file);
3804 if (branch_prob_dump)
3806 close_dump_file (print_rtl, insns);
3807 if (graph_dump_format != no_graph)
3808 print_rtl_graph_with_bb (dump_base_name, ".bp", insns);
3812 /* We are no longer anticipating cse in this function, at least. */
3814 cse_not_expected = 1;
3816 /* Now we choose between stupid (pcc-like) register allocation
3817 (if we got the -noreg switch and not -opt)
3818 and smart register allocation. */
3820 if (optimize > 0) /* Stupid allocation probably won't work */
3821 obey_regdecls = 0; /* if optimizations being done. */
3825 /* Print function header into flow dump now
3826 because doing the flow analysis makes some of the dump. */
3829 open_dump_file (".flow", decl_printable_name (decl, 2));
3835 regclass (insns, max_reg_num ());
3836 stupid_life_analysis (insns, max_reg_num (),
3842 /* Do control and data flow analysis,
3843 and write some of the results to dump file. */
3848 find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
3849 life_analysis (insns, max_reg_num (), rtl_dump_file);
3852 if (warn_uninitialized)
3854 uninitialized_vars_warning (DECL_INITIAL (decl));
3855 setjmp_args_warning ();
3859 /* Dump rtl after flow analysis. */
3863 close_dump_file (print_rtl_with_bb, insns);
3864 if (graph_dump_format != no_graph)
3865 print_rtl_graph_with_bb (dump_base_name, ".flow", insns);
3868 /* The first life analysis pass has finished. From now on we can not
3869 generate any new pseudos. */
3872 /* If -opt, try combining insns through substitution. */
3876 TIMEVAR (combine_time, combine_instructions (insns, max_reg_num ()));
3878 /* Dump rtl code after insn combination. */
3882 dump_rtl (".combine", decl, print_rtl_with_bb, insns);
3883 if (graph_dump_format != no_graph)
3884 print_rtl_graph_with_bb (dump_base_name, ".combine", insns);
3888 /* Register allocation pre-pass, to reduce number of moves
3889 necessary for two-address machines. */
3890 if (optimize > 0 && (flag_regmove || flag_expensive_optimizations))
3893 open_dump_file (".regmove", decl_printable_name (decl, 2));
3895 TIMEVAR (regmove_time, regmove_optimize (insns, max_reg_num (),
3900 close_dump_file (print_rtl_with_bb, insns);
3901 if (graph_dump_format != no_graph)
3902 print_rtl_graph_with_bb (dump_base_name, ".regmove", insns);
3906 /* Print function header into sched dump now
3907 because doing the sched analysis makes some of the dump. */
3909 if (optimize > 0 && flag_schedule_insns)
3912 open_dump_file (".sched", decl_printable_name (decl, 2));
3914 /* Do control and data sched analysis,
3915 and write some of the results to dump file. */
3917 TIMEVAR (sched_time, schedule_insns (rtl_dump_file));
3919 /* Dump rtl after instruction scheduling. */
3923 close_dump_file (print_rtl_with_bb, insns);
3924 if (graph_dump_format != no_graph)
3925 print_rtl_graph_with_bb (dump_base_name, ".sched", insns);
3929 /* Unless we did stupid register allocation,
3930 allocate pseudo-regs that are used only within 1 basic block. */
3933 TIMEVAR (local_alloc_time,
3935 recompute_reg_usage (insns);
3936 regclass (insns, max_reg_num ());
3940 /* Dump rtl code after allocating regs within basic blocks. */
3944 open_dump_file (".lreg", decl_printable_name (decl, 2));
3946 TIMEVAR (dump_time, dump_flow_info (rtl_dump_file));
3947 TIMEVAR (dump_time, dump_local_alloc (rtl_dump_file));
3949 close_dump_file (print_rtl_with_bb, insns);
3950 if (graph_dump_format != no_graph)
3951 print_rtl_graph_with_bb (dump_base_name, ".lreg", insns);
3954 if (global_reg_dump)
3955 open_dump_file (".greg", decl_printable_name (decl, 2));
3957 /* Unless we did stupid register allocation,
3958 allocate remaining pseudo-regs, then do the reload pass
3959 fixing up any insns that are invalid. */
3961 TIMEVAR (global_alloc_time,
3964 failure = global_alloc (rtl_dump_file);
3966 failure = reload (insns, 0, rtl_dump_file);
3971 goto exit_rest_of_compilation;
3973 /* Do a very simple CSE pass over just the hard registers. */
3975 reload_cse_regs (insns);
3977 /* Re-create the death notes which were deleted during reload. */
3982 find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
3983 life_analysis (insns, max_reg_num (), rtl_dump_file);
3986 flow2_completed = 1;
3988 /* On some machines, the prologue and epilogue code, or parts thereof,
3989 can be represented as RTL. Doing so lets us schedule insns between
3990 it and the rest of the code and also allows delayed branch
3991 scheduling to operate in the epilogue. */
3993 thread_prologue_and_epilogue_insns (insns);
3995 if (global_reg_dump)
3997 TIMEVAR (dump_time, dump_global_regs (rtl_dump_file));
3998 close_dump_file (print_rtl_with_bb, insns);
3999 if (graph_dump_format != no_graph)
4000 print_rtl_graph_with_bb (dump_base_name, ".greg", insns);
4002 if (optimize > 0 && flag_schedule_insns_after_reload)
4005 open_dump_file (".sched2", decl_printable_name (decl, 2));
4007 /* Do control and data sched analysis again,
4008 and write some more of the results to dump file. */
4010 TIMEVAR (sched2_time, schedule_insns (rtl_dump_file));
4012 /* Dump rtl after post-reorder instruction scheduling. */
4016 close_dump_file (print_rtl_with_bb, insns);
4017 if (graph_dump_format != no_graph)
4018 print_rtl_graph_with_bb (dump_base_name, ".sched2", insns);
4022 #ifdef LEAF_REGISTERS
4024 if (optimize > 0 && only_leaf_regs_used () && leaf_function_p ())
4028 /* One more attempt to remove jumps to .+1
4029 left by dead-store-elimination.
4030 Also do cross-jumping this time
4031 and delete no-op move insns. */
4035 TIMEVAR (jump_time, jump_optimize (insns, JUMP_CROSS_JUMP,
4037 !JUMP_AFTER_REGSCAN));
4039 /* Dump rtl code after jump, if we are doing that. */
4043 dump_rtl (".jump2", decl, print_rtl_with_bb, insns);
4044 if (graph_dump_format != no_graph)
4045 print_rtl_graph_with_bb (dump_base_name, ".jump2", insns);
4049 /* If a machine dependent reorganization is needed, call it. */
4050 #ifdef MACHINE_DEPENDENT_REORG
4051 MACHINE_DEPENDENT_REORG (insns);
4053 if (mach_dep_reorg_dump)
4055 dump_rtl (".mach", decl, print_rtl_with_bb, insns);
4056 if (graph_dump_format != no_graph)
4057 print_rtl_graph_with_bb (dump_base_name, ".mach", insns);
4061 /* If a scheduling pass for delayed branches is to be done,
4062 call the scheduling code. */
4065 if (optimize > 0 && flag_delayed_branch)
4067 TIMEVAR (dbr_sched_time, dbr_schedule (insns, rtl_dump_file));
4071 dump_rtl (".dbr", decl, print_rtl_with_bb, insns);
4072 if (graph_dump_format != no_graph)
4073 print_rtl_graph_with_bb (dump_base_name, ".dbr", insns);
4078 /* Shorten branches. */
4079 TIMEVAR (shorten_branch_time,
4081 shorten_branches (get_insns ());
4086 open_dump_file (".stack", decl_printable_name (decl, 2));
4088 TIMEVAR (stack_reg_time, reg_to_stack (insns, rtl_dump_file));
4092 dump_rtl (".stack", decl, print_rtl_with_bb, insns);
4093 if (graph_dump_format != no_graph)
4094 print_rtl_graph_with_bb (dump_base_name, ".stack", insns);
4098 /* Now turn the rtl into assembler code. */
4100 TIMEVAR (final_time,
4105 /* Get the function's name, as described by its RTL.
4106 This may be different from the DECL_NAME name used
4107 in the source file. */
4109 x = DECL_RTL (decl);
4110 if (GET_CODE (x) != MEM)
4113 if (GET_CODE (x) != SYMBOL_REF)
4115 fnname = XSTR (x, 0);
4117 assemble_start_function (decl, fnname);
4118 final_start_function (insns, asm_out_file, optimize);
4119 final (insns, asm_out_file, optimize, 0);
4120 final_end_function (insns, asm_out_file, optimize);
4121 assemble_end_function (decl, fnname);
4123 fflush (asm_out_file);
4125 /* Release all memory held by regsets now */
4126 regset_release_memory ();
4129 /* Write DBX symbols if requested */
4131 /* Note that for those inline functions where we don't initially
4132 know for certain that we will be generating an out-of-line copy,
4133 the first invocation of this routine (rest_of_compilation) will
4134 skip over this code by doing a `goto exit_rest_of_compilation;'.
4135 Later on, finish_compilation will call rest_of_compilation again
4136 for those inline functions that need to have out-of-line copies
4137 generated. During that call, we *will* be routed past here. */
4139 #ifdef DBX_DEBUGGING_INFO
4140 if (write_symbols == DBX_DEBUG)
4141 TIMEVAR (symout_time, dbxout_function (decl));
4144 #ifdef DWARF_DEBUGGING_INFO
4145 if (write_symbols == DWARF_DEBUG)
4146 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
4149 #ifdef DWARF2_DEBUGGING_INFO
4150 if (write_symbols == DWARF2_DEBUG)
4151 TIMEVAR (symout_time, dwarf2out_decl (decl));
4154 exit_rest_of_compilation:
4158 /* In case the function was not output,
4159 don't leave any temporary anonymous types
4160 queued up for sdb output. */
4161 #ifdef SDB_DEBUGGING_INFO
4162 if (write_symbols == SDB_DEBUG)
4163 sdbout_types (NULL_TREE);
4166 /* Put back the tree of subblocks and list of arguments
4167 from before we copied them.
4168 Code generation and the output of debugging info may have modified
4169 the copy, but the original is unchanged. */
4171 if (saved_block_tree != 0)
4173 DECL_INITIAL (decl) = saved_block_tree;
4174 DECL_ARGUMENTS (decl) = saved_arguments;
4175 DECL_ABSTRACT_ORIGIN (decl) = NULL_TREE;
4178 reload_completed = 0;
4179 flow2_completed = 0;
4182 TIMEVAR (final_time,
4184 /* Clear out the insn_length contents now that they are no
4186 init_insn_lengths ();
4188 /* Clear out the real_constant_chain before some of the rtx's
4189 it runs through become garbage. */
4190 clear_const_double_mem ();
4192 /* Cancel the effect of rtl_in_current_obstack. */
4193 resume_temporary_allocation ();
4195 /* Show no temporary slots allocated. */
4199 /* Make sure volatile mem refs aren't considered valid operands for
4200 arithmetic insns. We must call this here if this is a nested inline
4201 function, since the above code leaves us in the init_recog state
4202 (from final.c), and the function context push/pop code does not
4203 save/restore volatile_ok.
4205 ??? Maybe it isn't necessary for expand_start_function to call this
4206 anymore if we do it here? */
4208 init_recog_no_volatile ();
4210 /* The parsing time is all the time spent in yyparse
4211 *except* what is spent in this function. */
4213 parse_time -= get_run_time () - start_time;
4215 /* Reset global variables. */
4216 free_basic_block_vars (0);
4227 printf ("Usage: %s input [switches]\n", progname);
4228 printf ("Switches:\n");
4230 printf (" -ffixed-<register> Mark <register> as being unavailable to the compiler\n");
4231 printf (" -fcall-used-<register> Mark <register> as being corrupted by function calls\n");
4232 printf (" -fcall-saved-<register> Mark <register> as being preserved across functions\n");
4234 for (i = NUM_ELEM (f_options); i--;)
4236 char * description = f_options[i].description;
4238 if (description != NULL && * description != 0)
4239 printf (" -f%-21s %s\n",
4240 f_options[i].string, description);
4243 printf (" -O[number] Set optimisation level to [number]\n");
4244 printf (" -Os Optimise for space rather than speed\n");
4245 printf (" -pedantic Issue warnings needed by strict compliance to ANSI C\n");
4246 printf (" -pedantic-errors Like -pedantic except that errors are produced\n");
4247 printf (" -w Suppress warnings\n");
4248 printf (" -W Enable extra warnings\n");
4250 for (i = NUM_ELEM (W_options); i--;)
4252 char * description = W_options[i].description;
4254 if (description != NULL && * description != 0)
4255 printf (" -W%-21s %s\n",
4256 W_options[i].string, description);
4259 printf (" -Wid-clash-<num> Warn if 2 identifiers have the same first <num> chars\n");
4260 printf (" -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n");
4261 printf (" -p Enable function profiling\n");
4262 #if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER)
4263 printf (" -a Enable block profiling \n");
4265 #if defined (BLOCK_PROFILER) || defined (FUNCTION_BLOCK_PROFILER) || defined FUNCTION_BLOCK_PROFILER_EXIT
4266 printf (" -ax Enable jump profiling \n");
4268 printf (" -o <file> Place output into <file> \n");
4269 printf (" -G <number> Put global and static data smaller than <number>\n");
4270 printf (" bytes into a special section (on some targets)\n");
4272 for (i = NUM_ELEM (debug_args); i--;)
4274 if (debug_args[i].description != NULL)
4275 printf (" -%-22s %s\n", debug_args[i].arg, debug_args[i].description);
4278 printf (" -aux-info <file> Emit declaration info into <file>.X\n");
4279 printf (" -quiet Do not display functions compiled or elapsed time\n");
4280 printf (" -version Display the compiler's version\n");
4281 printf (" -d[letters] Enable dumps from specific passes of the compiler\n");
4282 printf (" -dumpbase <file> Base name to be used for dumps from specific passes\n");
4283 #if defined HAIFA || defined INSN_SCHEDULING
4284 printf (" -sched-verbose-<number> Set the verbosity level of the scheduler\n");
4286 printf (" --help Display this information\n");
4291 /* Display descriptions of language specific options.
4292 If there is no description, note that there is an undocumented option.
4293 If the description is empty, do not display anything. (This allows
4294 options to be deliberately undocumented, for whatever reason).
4295 If the option string is missing, then this is a marker, indicating
4296 that the description string is in fact the name of a language, whose
4297 language specific options are to follow. */
4299 if (NUM_ELEM (documented_lang_options) > 1)
4301 printf ("\nLanguage specific options:\n");
4303 for (i = 0; i < NUM_ELEM (documented_lang_options); i++)
4305 char * description = documented_lang_options[i].description;
4306 char * option = documented_lang_options[i].option;
4308 if (description == NULL)
4313 printf (" %-23.23s [undocumented]\n", option);
4315 else if (* description == 0)
4317 else if (option == NULL)
4321 ("\nThere are undocumented %s specific options as well.\n",
4325 printf ("\n Options for %s:\n", description);
4330 printf (" %-23.23s %s\n", option, description);
4335 printf ("\nThere are undocumented %s specific options as well.\n", lang);
4337 if (NUM_ELEM (target_switches) > 1
4338 #ifdef TARGET_OPTIONS
4339 || NUM_ELEM (target_options) > 1
4347 printf ("\nTarget specific options:\n");
4349 for (i = NUM_ELEM (target_switches); i--;)
4351 char * option = target_switches[i].name;
4352 char * description = target_switches[i].description;
4354 if (option == NULL || * option == 0)
4356 else if (description == NULL)
4361 printf (" -m%-21.21s [undocumented]\n", option);
4363 else if (* description != 0)
4364 doc += printf (" -m%-21.21s %s\n", option, description);
4367 #ifdef TARGET_OPTIONS
4368 for (i = NUM_ELEM (target_options); i--;)
4370 char * option = target_options[i].prefix;
4371 char * description = target_options[i].description;
4373 if (option == NULL || * option == 0)
4375 else if (description == NULL)
4380 printf (" -m%-21.21s [undocumented]\n", option);
4382 else if (* description != 0)
4383 doc += printf (" -m%-21.21s %s\n", option, description);
4389 printf ("\nThere are undocumented target specific options as well.\n");
4391 printf (" They exist, but they are not documented.\n");
4396 /* Compare the user specified 'option' with the language
4397 specific 'lang_option'. Return true if they match, or
4398 if 'option' is a viable prefix of 'lang_option'. */
4401 check_lang_option (option, lang_option)
4405 lang_independent_options * indep_options;
4410 /* Ignore NULL entries. */
4411 if (option == NULL || lang_option == NULL)
4414 if ((space = strchr (lang_option, ' ')) != NULL)
4415 len = space - lang_option;
4417 len = strlen (lang_option);
4419 /* If they do not match to the first n characters then fail. */
4420 if (strncmp (option, lang_option, len) != 0)
4423 /* Do not accept a lang option, if it matches a normal -f or -W
4424 option. Chill defines a -fpack, but we want to support
4427 /* An exact match is OK */
4428 if ((int) strlen (option) == len)
4431 /* If it is not an -f or -W option allow the match */
4432 if (option[0] != '-')
4437 case 'f': indep_options = f_options; break;
4438 case 'W': indep_options = W_options; break;
4442 /* The option is a -f or -W option.
4443 Skip past the prefix and search for the remainder in the
4444 appropriate table of options. */
4447 if (option[0] == 'n' && option[1] == 'o' && option[2] == '-')
4450 for (k = NUM_ELEM (indep_options); k--;)
4452 if (!strcmp (option, indep_options[k].string))
4454 /* The option matched a language independent option,
4455 do not allow the language specific match. */
4461 /* The option matches the start of the langauge specific option
4462 and it is not an exact match for a language independent option. */
4466 /* Entry point of cc1/c++. Decode command args, then call compile_file.
4467 Exit code is 35 if can't open files, 34 if fatal error,
4468 33 if had nonfatal errors, else success. */
4477 int flag_print_mem = 0;
4478 int version_flag = 0;
4481 /* save in case md file wants to emit args as a comment. */
4485 p = argv[0] + strlen (argv[0]);
4486 while (p != argv[0] && p[-1] != '/'
4487 #ifdef DIR_SEPARATOR
4488 && p[-1] != DIR_SEPARATOR
4494 #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
4495 /* Get rid of any avoidable limit on stack size. */
4499 /* Set the stack limit huge so that alloca does not fail. */
4500 getrlimit (RLIMIT_STACK, &rlim);
4501 rlim.rlim_cur = rlim.rlim_max;
4502 setrlimit (RLIMIT_STACK, &rlim);
4506 signal (SIGFPE, float_signal);
4509 signal (SIGPIPE, pipe_closed);
4512 decl_printable_name = decl_name;
4513 lang_expand_expr = (lang_expand_expr_t) do_abort;
4515 /* Initialize whether `char' is signed. */
4516 flag_signed_char = DEFAULT_SIGNED_CHAR;
4517 #ifdef DEFAULT_SHORT_ENUMS
4518 /* Initialize how much space enums occupy, by default. */
4519 flag_short_enums = DEFAULT_SHORT_ENUMS;
4522 /* Perform language-specific options intialization. */
4523 lang_init_options ();
4525 /* Scan to see what optimization level has been specified. That will
4526 determine the default value of many flags. */
4527 for (i = 1; i < argc; i++)
4529 if (!strcmp (argv[i], "-O"))
4533 else if (argv[i][0] == '-' && argv[i][1] == 'O')
4535 /* Handle -Os, -O2, -O3, -O69, ... */
4536 char *p = &argv[i][2];
4539 if ((p[0] == 's') && (p[1] == 0))
4544 if (! (c >= '0' && c <= '9'))
4547 optimize = atoi (&argv[i][2]);
4552 /* Optimizing for size forces optimize to be no less than 2. */
4553 if (optimize_size && (optimize < 2))
4556 obey_regdecls = (optimize == 0);
4561 flag_thread_jumps = 1;
4563 flag_delayed_branch = 1;
4565 #ifdef CAN_DEBUG_WITHOUT_FP
4566 flag_omit_frame_pointer = 1;
4572 flag_cse_follow_jumps = 1;
4573 flag_cse_skip_blocks = 1;
4575 flag_expensive_optimizations = 1;
4576 flag_strength_reduce = 1;
4577 flag_rerun_cse_after_loop = 1;
4578 flag_rerun_loop_opt = 1;
4579 flag_caller_saves = 1;
4581 #ifdef INSN_SCHEDULING
4582 flag_schedule_insns = 1;
4583 flag_schedule_insns_after_reload = 1;
4587 flag_strict_aliasing = 1;
4593 flag_inline_functions = 1;
4596 /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
4599 set_target_switch ("");
4601 #ifdef OPTIMIZATION_OPTIONS
4602 /* Allow default optimizations to be specified on a per-machine basis. */
4603 OPTIMIZATION_OPTIONS (optimize, optimize_size);
4606 /* Initialize register usage now so switches may override. */
4609 for (i = 1; i < argc; i++)
4613 /* If this is a language-specific option,
4614 decode it in a language-specific way. */
4615 for (j = NUM_ELEM (documented_lang_options); j--;)
4616 if (check_lang_option (argv[i], documented_lang_options[j].option))
4619 if (j != (size_t)-1)
4621 /* If the option is valid for *some* language,
4622 treat it as valid even if this language doesn't understand it. */
4623 int strings_processed = lang_decode_option (argc - i, argv + i);
4625 if (!strcmp (argv[i], "--help"))
4631 if (strings_processed != 0)
4632 i += strings_processed - 1;
4634 else if (argv[i][0] == '-' && argv[i][1] != 0)
4636 register char *str = argv[i] + 1;
4641 set_target_switch (&str[1]);
4642 else if (!strcmp (str, "dumpbase"))
4644 dump_base_name = argv[++i];
4646 else if (str[0] == 'd')
4648 register char *p = &str[1];
4653 branch_prob_dump = 1;
4659 global_reg_dump = 1;
4667 cse_dump = 1, cse2_dump = 1;
4674 #ifdef MACHINE_DEPENDENT_REORG
4675 mach_dep_reorg_dump = 1;
4682 branch_prob_dump = 1;
4699 global_reg_dump = 1;
4724 #ifdef MACHINE_DEPENDENT_REORG
4726 mach_dep_reorg_dump = 1;
4730 flag_print_asm_name = 1;
4751 graph_dump_format = vcg;
4757 rtl_dump_and_exit = 1;
4760 warning ("unrecognised gcc debugging option: %c", p[-1]);
4764 else if (str[0] == 'f')
4766 register char *p = &str[1];
4769 /* Some kind of -f option.
4770 P's value is the option sans `-f'.
4771 Search for it in the table of options. */
4774 !found && j < sizeof (f_options) / sizeof (f_options[0]);
4777 if (!strcmp (p, f_options[j].string))
4779 *f_options[j].variable = f_options[j].on_value;
4780 /* A goto here would be cleaner,
4781 but breaks the vax pcc. */
4784 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
4785 && ! strcmp (p+3, f_options[j].string))
4787 *f_options[j].variable = ! f_options[j].on_value;
4795 #ifdef INSN_SCHEDULING
4796 else if (!strncmp (p, "sched-verbose-",14))
4797 fix_sched_param("verbose",&p[14]);
4800 else if (!strncmp (p, "fixed-", 6))
4801 fix_register (&p[6], 1, 1);
4802 else if (!strncmp (p, "call-used-", 10))
4803 fix_register (&p[10], 0, 1);
4804 else if (!strncmp (p, "call-saved-", 11))
4805 fix_register (&p[11], 0, 0);
4807 error ("Invalid option `%s'", argv[i]);
4809 else if (str[0] == 'O')
4811 register char *p = str+1;
4815 while (*p && *p >= '0' && *p <= '9')
4820 error ("Invalid option `%s'", argv[i]);
4822 else if (!strcmp (str, "pedantic"))
4824 else if (!strcmp (str, "pedantic-errors"))
4825 flag_pedantic_errors = pedantic = 1;
4826 else if (!strcmp (str, "quiet"))
4828 else if (!strcmp (str, "version"))
4830 else if (!strcmp (str, "w"))
4831 inhibit_warnings = 1;
4832 else if (!strcmp (str, "W"))
4835 /* We save the value of warn_uninitialized, since if they put
4836 -Wuninitialized on the command line, we need to generate a
4837 warning about not using it without also specifying -O. */
4838 if (warn_uninitialized != 1)
4839 warn_uninitialized = 2;
4841 else if (str[0] == 'W')
4843 register char *p = &str[1];
4846 /* Some kind of -W option.
4847 P's value is the option sans `-W'.
4848 Search for it in the table of options. */
4851 !found && j < sizeof (W_options) / sizeof (W_options[0]);
4854 if (!strcmp (p, W_options[j].string))
4856 *W_options[j].variable = W_options[j].on_value;
4857 /* A goto here would be cleaner,
4858 but breaks the vax pcc. */
4861 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
4862 && ! strcmp (p+3, W_options[j].string))
4864 *W_options[j].variable = ! W_options[j].on_value;
4871 else if (!strncmp (p, "id-clash-", 9))
4877 if (*endp >= '0' && *endp <= '9')
4881 error ("Invalid option `%s'", argv[i]);
4886 id_clash_len = atoi (str + 10);
4889 else if (!strncmp (p, "larger-than-", 12))
4891 char *endp = p + 12;
4895 if (*endp >= '0' && *endp <= '9')
4899 error ("Invalid option `%s'", argv[i]);
4900 goto larger_than_lose;
4903 warn_larger_than = 1;
4904 larger_than_size = atoi (str + 13);
4908 error ("Invalid option `%s'", argv[i]);
4910 else if (!strcmp (str, "p"))
4914 else if (!strcmp (str, "a"))
4916 #if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4917 warning ("`-a' option (basic block profile) not supported");
4919 profile_block_flag = (profile_block_flag < 2) ? 1 : 3;
4922 else if (!strcmp (str, "ax"))
4924 #if !defined (FUNCTION_BLOCK_PROFILER_EXIT) || !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4925 warning ("`-ax' option (jump profiling) not supported");
4927 profile_block_flag = (!profile_block_flag
4928 || profile_block_flag == 2) ? 2 : 3;
4931 else if (str[0] == 'g')
4935 /* A lot of code assumes write_symbols == NO_DEBUG if the
4936 debugging level is 0 (thus -gstabs1 -gstabs0 would lose track
4937 of what debugging type has been selected). This records the
4938 selected type. It is an error to specify more than one
4940 static enum debug_info_type selected_debug_type = NO_DEBUG;
4941 /* Non-zero if debugging format has been explicitly set.
4942 -g and -ggdb don't explicitly set the debugging format so
4943 -gdwarf -g3 is equivalent to -gdwarf3. */
4944 static int type_explicitly_set_p = 0;
4945 /* Indexed by enum debug_info_type. */
4946 static char *debug_type_names[] =
4948 "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
4951 /* Look up STR in the table. */
4952 for (da = debug_args; da->arg; da++)
4954 if (! strncmp (str, da->arg, strlen (da->arg)))
4956 enum debug_info_type type = da->debug_type;
4959 p = str + strlen (da->arg);
4960 if (*p && (*p < '0' || *p > '9'))
4964 while (*q && (*q >= '0' && *q <= '9'))
4969 if (len > 1 && !strncmp (str, "gdwarf", len))
4971 error ("use -gdwarf -g%d for DWARF v1, level %d",
4974 error ("use -gdwarf-2 for DWARF v2");
4978 level = 2; /* default debugging info level */
4979 if (*q || level > 3)
4981 warning ("invalid debug level specification in option: `-%s'",
4983 /* ??? This error message is incorrect in the case of
4985 warning ("no debugging information will be generated");
4989 if (type == NO_DEBUG)
4991 type = PREFERRED_DEBUGGING_TYPE;
4992 if (len > 1 && strncmp (str, "ggdb", len) == 0)
4994 #if defined (DWARF2_DEBUGGING_INFO) && !defined (LINKER_DOES_NOT_WORK_WITH_DWARF2)
4995 type = DWARF2_DEBUG;
4997 #ifdef DBX_DEBUGGING_INFO
5004 if (type == NO_DEBUG)
5005 warning ("`-%s' not supported by this configuration of GCC",
5008 /* Does it conflict with an already selected type? */
5009 if (type_explicitly_set_p
5010 /* -g/-ggdb don't conflict with anything */
5011 && da->debug_type != NO_DEBUG
5012 && type != selected_debug_type)
5013 warning ("`-%s' ignored, conflicts with `-g%s'",
5014 str, debug_type_names[(int) selected_debug_type]);
5017 /* If the format has already been set, -g/-ggdb
5018 only change the debug level. */
5019 if (type_explicitly_set_p
5020 && da->debug_type == NO_DEBUG)
5021 ; /* don't change debugging type */
5024 selected_debug_type = type;
5025 type_explicitly_set_p = da->debug_type != NO_DEBUG;
5027 write_symbols = (level == 0
5029 : selected_debug_type);
5030 use_gnu_debug_info_extensions = da->use_extensions_p;
5031 debug_info_level = (enum debug_info_level) level;
5037 warning ("`-%s' not supported by this configuration of GCC",
5040 else if (!strcmp (str, "o"))
5042 asm_file_name = argv[++i];
5044 else if (str[0] == 'G')
5046 g_switch_set = TRUE;
5047 g_switch_value = atoi ((str[1] != '\0') ? str+1 : argv[++i]);
5049 else if (!strncmp (str, "aux-info", 8))
5051 flag_gen_aux_info = 1;
5052 aux_info_file_name = (str[8] != '\0' ? str+8 : argv[++i]);
5054 else if (!strcmp (str, "-help"))
5060 error ("Invalid option `%s'", argv[i]);
5062 else if (argv[i][0] == '+')
5063 error ("Invalid option `%s'", argv[i]);
5068 /* Checker uses the frame pointer. */
5069 if (flag_check_memory_usage)
5070 flag_omit_frame_pointer = 0;
5074 /* Inlining does not work if not optimizing,
5075 so force it not to be done. */
5079 /* The c_decode_option and lang_decode_option functions set
5080 this to `2' if -Wall is used, so we can avoid giving out
5081 lots of errors for people who don't realize what -Wall does. */
5082 if (warn_uninitialized == 1)
5083 warning ("-Wuninitialized is not supported without -O");
5086 #ifdef OVERRIDE_OPTIONS
5087 /* Some machines may reject certain combinations of options. */
5091 if (exceptions_via_longjmp == 2)
5093 #ifdef DWARF2_UNWIND_INFO
5094 exceptions_via_longjmp = ! DWARF2_UNWIND_INFO;
5096 exceptions_via_longjmp = 1;
5100 if (profile_block_flag == 3)
5102 warning ("`-ax' and `-a' are conflicting options. `-a' ignored.");
5103 profile_block_flag = 2;
5106 /* Unrolling all loops implies that standard loop unrolling must also
5108 if (flag_unroll_all_loops)
5109 flag_unroll_loops = 1;
5110 /* Loop unrolling requires that strength_reduction be on also. Silently
5111 turn on strength reduction here if it isn't already on. Also, the loop
5112 unrolling code assumes that cse will be run after loop, so that must
5113 be turned on also. */
5114 if (flag_unroll_loops)
5116 flag_strength_reduce = 1;
5117 flag_rerun_cse_after_loop = 1;
5120 /* Warn about options that are not supported on this machine. */
5121 #ifndef INSN_SCHEDULING
5122 if (flag_schedule_insns || flag_schedule_insns_after_reload)
5123 warning ("instruction scheduling not supported on this target machine");
5126 if (flag_delayed_branch)
5127 warning ("this target machine does not have delayed branches");
5130 user_label_prefix = USER_LABEL_PREFIX;
5131 if (flag_leading_underscore != -1)
5133 /* If the default prefix is more complicated than "" or "_",
5134 issue a warning and ignore this option. */
5135 if (user_label_prefix[0] == 0 ||
5136 (user_label_prefix[0] == '_' && user_label_prefix[1] == 0))
5138 user_label_prefix = flag_leading_underscore ? "_" : "";
5141 warning ("-f%sleading-underscore not supported on this target machine",
5142 flag_leading_underscore ? "" : "no-");
5145 /* If we are in verbose mode, write out the version and maybe all the
5146 option flags in use. */
5149 print_version (stderr, "");
5151 print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
5154 compile_file (filename);
5156 #if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN__))
5159 char *lim = (char *) sbrk (0);
5161 fprintf (stderr, "Data size %ld.\n", (long)(lim - (char *) &environ));
5166 system ("ps -l 1>&2");
5169 #endif /* not USG */
5172 #endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN) */
5175 exit (FATAL_EXIT_CODE);
5177 exit (FATAL_EXIT_CODE);
5178 exit (SUCCESS_EXIT_CODE);
5182 /* Decode -m switches. */
5183 /* Decode the switch -mNAME. */
5186 set_target_switch (name)
5192 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
5193 if (!strcmp (target_switches[j].name, name))
5195 if (target_switches[j].value < 0)
5196 target_flags &= ~-target_switches[j].value;
5198 target_flags |= target_switches[j].value;
5202 #ifdef TARGET_OPTIONS
5204 for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
5206 int len = strlen (target_options[j].prefix);
5207 if (!strncmp (target_options[j].prefix, name, len))
5209 *target_options[j].variable = name + len;
5216 error ("Invalid option `%s'", name);
5219 /* Print version information to FILE.
5220 Each line begins with INDENT (for the case where FILE is the
5221 assembler output file). */
5224 print_version (file, indent)
5228 fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
5229 language_string, version_string);
5230 fprintf (file, " (%s)", TARGET_NAME);
5233 #define __VERSION__ "[unknown]"
5235 fprintf (file, " compiled by GNU C version %s.\n", __VERSION__);
5237 fprintf (file, " compiled by CC.\n");
5241 /* Print an option value and return the adjusted position in the line.
5242 ??? We don't handle error returns from fprintf (disk full); presumably
5243 other code will catch a disk full though. */
5246 print_single_switch (file, pos, max, indent, sep, term, type, name)
5249 char *indent, *sep, *term, *type, *name;
5251 /* The ultrix fprintf returns 0 on success, so compute the result we want
5252 here since we need it for the following test. */
5253 int len = strlen (sep) + strlen (type) + strlen (name);
5258 fprintf (file, "%s", term);
5263 fprintf (file, "%s", indent);
5264 pos = strlen (indent);
5266 fprintf (file, "%s%s%s", sep, type, name);
5271 /* Print active target switches to FILE.
5272 POS is the current cursor position and MAX is the size of a "line".
5273 Each line begins with INDENT and ends with TERM.
5274 Each switch is separated from the next by SEP. */
5277 print_switch_values (file, pos, max, indent, sep, term)
5280 char *indent, *sep, *term;
5285 /* Print the options as passed. */
5287 pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
5288 "options passed: ", "");
5290 for (p = &save_argv[1]; *p != NULL; p++)
5294 if (strcmp (*p, "-o") == 0)
5300 if (strcmp (*p, "-quiet") == 0)
5302 if (strcmp (*p, "-version") == 0)
5307 pos = print_single_switch (file, pos, max, indent, sep, term, *p, "");
5310 fprintf (file, "%s", term);
5312 /* Print the -f and -m options that have been enabled.
5313 We don't handle language specific options but printing argv
5316 pos = print_single_switch (file, 0, max, indent, *indent ? " " : "", term,
5317 "options enabled: ", "");
5319 for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++)
5320 if (*f_options[j].variable == f_options[j].on_value)
5321 pos = print_single_switch (file, pos, max, indent, sep, term,
5322 "-f", f_options[j].string);
5324 /* Print target specific options. */
5326 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
5327 if (target_switches[j].name[0] != '\0'
5328 && target_switches[j].value > 0
5329 && ((target_switches[j].value & target_flags)
5330 == target_switches[j].value))
5332 pos = print_single_switch (file, pos, max, indent, sep, term,
5333 "-m", target_switches[j].name);
5336 #ifdef TARGET_OPTIONS
5337 for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
5338 if (*target_options[j].variable != NULL)
5341 sprintf (prefix, "-m%s", target_options[j].prefix);
5342 pos = print_single_switch (file, pos, max, indent, sep, term,
5343 prefix, *target_options[j].variable);
5347 fprintf (file, "%s", term);
5350 /* Record the beginning of a new source file, named FILENAME. */
5353 debug_start_source_file (filename)
5354 register char *filename;
5356 #ifdef DBX_DEBUGGING_INFO
5357 if (write_symbols == DBX_DEBUG)
5358 dbxout_start_new_source_file (filename);
5360 #ifdef DWARF_DEBUGGING_INFO
5361 if (debug_info_level == DINFO_LEVEL_VERBOSE
5362 && write_symbols == DWARF_DEBUG)
5363 dwarfout_start_new_source_file (filename);
5364 #endif /* DWARF_DEBUGGING_INFO */
5365 #ifdef DWARF2_DEBUGGING_INFO
5366 if (debug_info_level == DINFO_LEVEL_VERBOSE
5367 && write_symbols == DWARF2_DEBUG)
5368 dwarf2out_start_source_file (filename);
5369 #endif /* DWARF2_DEBUGGING_INFO */
5370 #ifdef SDB_DEBUGGING_INFO
5371 if (write_symbols == SDB_DEBUG)
5372 sdbout_start_new_source_file (filename);
5376 /* Record the resumption of a source file. LINENO is the line number in
5377 the source file we are returning to. */
5380 debug_end_source_file (lineno)
5381 register unsigned lineno ATTRIBUTE_UNUSED;
5383 #ifdef DBX_DEBUGGING_INFO
5384 if (write_symbols == DBX_DEBUG)
5385 dbxout_resume_previous_source_file ();
5387 #ifdef DWARF_DEBUGGING_INFO
5388 if (debug_info_level == DINFO_LEVEL_VERBOSE
5389 && write_symbols == DWARF_DEBUG)
5390 dwarfout_resume_previous_source_file (lineno);
5391 #endif /* DWARF_DEBUGGING_INFO */
5392 #ifdef DWARF2_DEBUGGING_INFO
5393 if (debug_info_level == DINFO_LEVEL_VERBOSE
5394 && write_symbols == DWARF2_DEBUG)
5395 dwarf2out_end_source_file ();
5396 #endif /* DWARF2_DEBUGGING_INFO */
5397 #ifdef SDB_DEBUGGING_INFO
5398 if (write_symbols == SDB_DEBUG)
5399 sdbout_resume_previous_source_file ();
5403 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
5404 the tail part of the directive line, i.e. the part which is past the
5405 initial whitespace, #, whitespace, directive-name, whitespace part. */
5408 debug_define (lineno, buffer)
5409 register unsigned lineno;
5410 register char *buffer;
5412 #ifdef DWARF_DEBUGGING_INFO
5413 if (debug_info_level == DINFO_LEVEL_VERBOSE
5414 && write_symbols == DWARF_DEBUG)
5415 dwarfout_define (lineno, buffer);
5416 #endif /* DWARF_DEBUGGING_INFO */
5417 #ifdef DWARF2_DEBUGGING_INFO
5418 if (debug_info_level == DINFO_LEVEL_VERBOSE
5419 && write_symbols == DWARF2_DEBUG)
5420 dwarf2out_define (lineno, buffer);
5421 #endif /* DWARF2_DEBUGGING_INFO */
5424 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
5425 the tail part of the directive line, i.e. the part which is past the
5426 initial whitespace, #, whitespace, directive-name, whitespace part. */
5429 debug_undef (lineno, buffer)
5430 register unsigned lineno;
5431 register char *buffer;
5433 #ifdef DWARF_DEBUGGING_INFO
5434 if (debug_info_level == DINFO_LEVEL_VERBOSE
5435 && write_symbols == DWARF_DEBUG)
5436 dwarfout_undef (lineno, buffer);
5437 #endif /* DWARF_DEBUGGING_INFO */
5438 #ifdef DWARF2_DEBUGGING_INFO
5439 if (debug_info_level == DINFO_LEVEL_VERBOSE
5440 && write_symbols == DWARF2_DEBUG)
5441 dwarf2out_undef (lineno, buffer);
5442 #endif /* DWARF2_DEBUGGING_INFO */