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. */
35 #include <sys/types.h>
39 #ifdef HAVE_SYS_PARAM_H
40 #include <sys/param.h>
56 #undef FLOAT /* This is for hpux. They should change hpux. */
57 #undef FFS /* Some systems define this in param.h. */
59 #ifdef TIME_WITH_SYS_TIME
60 # include <sys/time.h>
64 # include <sys/time.h>
70 #ifdef HAVE_SYS_RESOURCE_H
71 # include <sys/resource.h>
74 #ifdef HAVE_SYS_TIMES_H
75 # include <sys/times.h>
82 #include "insn-attr.h"
87 #ifdef XCOFF_DEBUGGING_INFO
92 /* The extra parameters substantially improve the I/O performance. */
94 vms_fopen (fname
, type
)
98 /* The <stdio.h> in the gcc-vms-1.42 distribution prototypes fopen with two
99 fixed arguments, which matches ANSI's specification but not VAXCRTL's
100 pre-ANSI implementation. This hack circumvents the mismatch problem. */
101 FILE *(*vmslib_fopen
)() = (FILE *(*)()) fopen
;
104 return (*vmslib_fopen
) (fname
, type
, "mbc=32",
105 "deq=64", "fop=tef", "shr=nil");
107 return (*vmslib_fopen
) (fname
, type
, "mbc=32");
109 #define fopen vms_fopen
112 #ifndef DEFAULT_GDB_EXTENSIONS
113 #define DEFAULT_GDB_EXTENSIONS 1
116 /* If more than one debugging type is supported, you must define
117 PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
119 This is one long line cause VAXC can't handle a \-newline. */
120 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
121 #ifndef PREFERRED_DEBUGGING_TYPE
122 You Lose
! You must define PREFERRED_DEBUGGING_TYPE
!
123 #endif /* no PREFERRED_DEBUGGING_TYPE */
124 #else /* Only one debugging format supported. Define PREFERRED_DEBUGGING_TYPE
125 so the following code needn't care. */
126 #ifdef DBX_DEBUGGING_INFO
127 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
129 #ifdef SDB_DEBUGGING_INFO
130 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
132 #ifdef DWARF_DEBUGGING_INFO
133 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
135 #ifdef DWARF2_DEBUGGING_INFO
136 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
138 #ifdef XCOFF_DEBUGGING_INFO
139 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
141 #endif /* More than one debugger format enabled. */
143 /* If still not defined, must have been because no debugging formats
145 #ifndef PREFERRED_DEBUGGING_TYPE
146 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
149 extern int rtx_equal_function_value_matters
;
151 #if ! (defined (VMS) || defined (OS2))
152 extern char **environ
;
154 extern char *version_string
, *language_string
;
156 /* Carry information from ASM_DECLARE_OBJECT_NAME
157 to ASM_FINISH_DECLARE_OBJECT. */
159 extern int size_directive_output
;
160 extern tree last_assemble_variable_decl
;
162 extern void init_lex ();
163 extern void init_decl_processing ();
164 extern void init_obstacks ();
165 extern void init_tree_codes ();
166 extern void init_rtl ();
167 extern void init_regs ();
168 extern void init_optabs ();
169 extern void init_stmt ();
170 extern void init_reg_sets ();
171 extern void dump_flow_info ();
172 extern void dump_sched_info ();
173 extern void dump_local_alloc ();
174 extern void regset_release_memory ();
176 extern void print_rtl ();
177 extern void print_rtl_with_bb ();
179 void rest_of_decl_compilation ();
180 void error_with_file_and_line
PVPROTO((char *file
, int line
, char *s
, ...));
181 void error_with_decl
PVPROTO((tree decl
, char *s
, ...));
182 void error_for_asm
PVPROTO((rtx insn
, char *s
, ...));
183 void error
PVPROTO((char *s
, ...));
184 void fatal
PVPROTO((char *s
, ...));
185 void warning_with_file_and_line
PVPROTO((char *file
, int line
, char *s
, ...));
186 void warning_with_decl
PVPROTO((tree decl
, char *s
, ...));
187 void warning_for_asm
PVPROTO((rtx insn
, char *s
, ...));
188 void warning
PVPROTO((char *s
, ...));
189 void pedwarn
PVPROTO((char *s
, ...));
190 void pedwarn_with_decl
PVPROTO((tree decl
, char *s
, ...));
191 void pedwarn_with_file_and_line
PVPROTO((char *file
, int line
, char *s
, ...));
192 void sorry
PVPROTO((char *s
, ...));
193 void really_sorry
PVPROTO((char *s
, ...));
198 void set_target_switch ();
199 static char *decl_name ();
201 void print_version ();
202 int print_single_switch ();
203 void print_switch_values ();
204 /* Length of line when printing switch values. */
207 #ifdef NEED_DECLARATION_SBRK
208 extern char *sbrk ();
211 /* Name of program invoked, sans directories. */
215 /* Copy of arguments to main. */
219 /* Name of current original source file (what was input to cpp).
220 This comes from each #-command in the actual input. */
222 char *input_filename
;
224 /* Name of top-level original source file (what was input to cpp).
225 This comes from the #-command at the beginning of the actual input.
226 If there isn't any there, then this is the cc1 input file name. */
228 char *main_input_filename
;
231 /* Stream for reading from the input file. */
235 /* Current line number in real source file. */
239 /* Stack of currently pending input files. */
241 struct file_stack
*input_file_stack
;
243 /* Incremented on each change to input_file_stack. */
244 int input_file_stack_tick
;
246 /* FUNCTION_DECL for function now being parsed or compiled. */
248 extern tree current_function_decl
;
250 /* Name to use as base of names for dump output files. */
252 char *dump_base_name
;
254 /* Bit flags that specify the machine subtype we are compiling for.
255 Bits are tested using macros TARGET_... defined in the tm.h file
256 and set by `-m...' switches. Must be defined in rtlanal.c. */
258 extern int target_flags
;
260 /* Flags saying which kinds of debugging dump have been requested. */
263 int rtl_dump_and_exit
= 0;
264 int jump_opt_dump
= 0;
265 int addressof_dump
= 0;
269 int branch_prob_dump
= 0;
271 int combine_dump
= 0;
272 int regmove_dump
= 0;
274 int local_reg_dump
= 0;
275 int global_reg_dump
= 0;
277 int jump2_opt_dump
= 0;
278 int dbr_sched_dump
= 0;
279 int flag_print_asm_name
= 0;
281 int stack_reg_dump
= 0;
283 #ifdef MACHINE_DEPENDENT_REORG
284 int mach_dep_reorg_dump
= 0;
287 /* Name for output file of assembly code, specified with -o. */
291 /* Value of the -G xx switch, and whether it was passed or not. */
295 /* Type(s) of debugging information we are producing (if any).
296 See flags.h for the definitions of the different possible
297 types of debugging information. */
298 enum debug_info_type write_symbols
= NO_DEBUG
;
300 /* Level of debugging information we are producing. See flags.h
301 for the definitions of the different possible levels. */
302 enum debug_info_level debug_info_level
= DINFO_LEVEL_NONE
;
304 /* Nonzero means use GNU-only extensions in the generated symbolic
305 debugging information. */
306 /* Currently, this only has an effect when write_symbols is set to
307 DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
308 int use_gnu_debug_info_extensions
= 0;
310 /* Nonzero means do optimizations. -O.
311 Particular numeric values stand for particular amounts of optimization;
312 thus, -O2 stores 2 here. However, the optimizations beyond the basic
313 ones are not controlled directly by this variable. Instead, they are
314 controlled by individual `flag_...' variables that are defaulted
315 based on this variable. */
319 /* Nonzero means optimize for size. -Os.
320 The only valid values are zero and non-zero. When optimize_size is
321 non-zero, optimize defaults to 2, but certain individual code
322 bloating optimizations are disabled. */
324 int optimize_size
= 0;
326 /* Number of error messages and warning messages so far. */
329 int warningcount
= 0;
332 /* Pointer to function to compute the name to use to print a declaration.
333 DECL is the declaration in question.
334 VERBOSITY determines what information will be printed:
335 0: DECL_NAME, demangled as necessary.
336 1: and scope information.
337 2: and any other information that might be interesting, such as function
338 parameter types in C++. */
340 char *(*decl_printable_name
) (/* tree decl, int verbosity */);
342 /* Pointer to function to compute rtl for a language-specific tree code. */
344 struct rtx_def
*(*lang_expand_expr
) ();
346 /* Pointer to function to finish handling an incomplete decl at the
347 end of compilation. */
349 void (*incomplete_decl_finalize_hook
) () = 0;
351 /* Highest label number used at the end of reload. */
353 int max_label_num_after_reload
;
355 /* Nonzero if generating code to do profiling. */
357 int profile_flag
= 0;
359 /* Nonzero if generating code to do profiling on a line-by-line basis. */
361 int profile_block_flag
;
363 /* Nonzero if generating code to profile program flow graph arcs. */
365 int profile_arc_flag
= 0;
367 /* Nonzero if generating info for gcov to calculate line test coverage. */
369 int flag_test_coverage
= 0;
371 /* Nonzero indicates that branch taken probabilities should be calculated. */
373 int flag_branch_probabilities
= 0;
375 /* Nonzero for -pedantic switch: warn about anything
376 that standard spec forbids. */
380 /* Temporarily suppress certain warnings.
381 This is set while reading code from a system header file. */
383 int in_system_header
= 0;
385 /* Nonzero means do stupid register allocation.
386 Currently, this is 1 if `optimize' is 0. */
388 int obey_regdecls
= 0;
390 /* Don't print functions as they are compiled and don't print
391 times taken by the various passes. -quiet. */
397 /* Nonzero means `char' should be signed. */
399 int flag_signed_char
;
401 /* Nonzero means give an enum type only as many bytes as it needs. */
403 int flag_short_enums
;
405 /* Nonzero for -fcaller-saves: allocate values in regs that need to
406 be saved across function calls, if that produces overall better code.
407 Optional now, so people can test it. */
409 #ifdef DEFAULT_CALLER_SAVES
410 int flag_caller_saves
= 1;
412 int flag_caller_saves
= 0;
415 /* Nonzero if structures and unions should be returned in memory.
417 This should only be defined if compatibility with another compiler or
418 with an ABI is needed, because it results in slower code. */
420 #ifndef DEFAULT_PCC_STRUCT_RETURN
421 #define DEFAULT_PCC_STRUCT_RETURN 1
424 /* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
426 int flag_pcc_struct_return
= DEFAULT_PCC_STRUCT_RETURN
;
428 /* Nonzero for -fforce-mem: load memory value into a register
429 before arithmetic on it. This makes better cse but slower compilation. */
431 int flag_force_mem
= 0;
433 /* Nonzero for -fforce-addr: load memory address into a register before
434 reference to memory. This makes better cse but slower compilation. */
436 int flag_force_addr
= 0;
438 /* Nonzero for -fdefer-pop: don't pop args after each function call;
439 instead save them up to pop many calls' args with one insns. */
441 int flag_defer_pop
= 0;
443 /* Nonzero for -ffloat-store: don't allocate floats and doubles
444 in extended-precision registers. */
446 int flag_float_store
= 0;
448 /* Nonzero for -fcse-follow-jumps:
449 have cse follow jumps to do a more extensive job. */
451 int flag_cse_follow_jumps
;
453 /* Nonzero for -fcse-skip-blocks:
454 have cse follow a branch around a block. */
455 int flag_cse_skip_blocks
;
457 /* Nonzero for -fexpensive-optimizations:
458 perform miscellaneous relatively-expensive optimizations. */
459 int flag_expensive_optimizations
;
461 /* Nonzero for -fthread-jumps:
462 have jump optimize output of loop. */
464 int flag_thread_jumps
;
466 /* Nonzero enables strength-reduction in loop.c. */
468 int flag_strength_reduce
= 0;
470 /* Nonzero enables loop unrolling in unroll.c. Only loops for which the
471 number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
472 UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
475 int flag_unroll_loops
;
477 /* Nonzero enables loop unrolling in unroll.c. All loops are unrolled.
478 This is generally not a win. */
480 int flag_unroll_all_loops
;
482 /* Nonzero forces all invariant computations in loops to be moved
485 int flag_move_all_movables
= 0;
487 /* Nonzero forces all general induction variables in loops to be
490 int flag_reduce_all_givs
= 0;
492 /* Nonzero for -fwritable-strings:
493 store string constants in data segment and don't uniquize them. */
495 int flag_writable_strings
= 0;
497 /* Nonzero means don't put addresses of constant functions in registers.
498 Used for compiling the Unix kernel, where strange substitutions are
499 done on the assembly output. */
501 int flag_no_function_cse
= 0;
503 /* Nonzero for -fomit-frame-pointer:
504 don't make a frame pointer in simple functions that don't require one. */
506 int flag_omit_frame_pointer
= 0;
508 /* Nonzero means place each function into its own section on those platforms
509 which support arbitrary section names and unlimited numbers of sections. */
511 int flag_function_sections
= 0;
513 /* Nonzero to inhibit use of define_optimization peephole opts. */
515 int flag_no_peephole
= 0;
517 /* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
518 operations in the interest of optimization. For example it allows
519 GCC to assume arguments to sqrt are nonnegative numbers, allowing
520 faster code for sqrt to be generated. */
522 int flag_fast_math
= 0;
524 /* Nonzero means all references through pointers are volatile. */
528 /* Nonzero means treat all global and extern variables as global. */
530 int flag_volatile_global
;
532 /* Nonzero means just do syntax checking; don't output anything. */
534 int flag_syntax_only
= 0;
536 /* Nonzero means to rerun cse after loop optimization. This increases
537 compilation time about 20% and picks up a few more common expressions. */
539 static int flag_rerun_cse_after_loop
;
541 /* Nonzero means to run loop optimizations twice. */
543 int flag_rerun_loop_opt
;
545 /* Nonzero for -finline-functions: ok to inline functions that look like
546 good inline candidates. */
548 int flag_inline_functions
;
550 /* Nonzero for -fkeep-inline-functions: even if we make a function
551 go inline everywhere, keep its definition around for debugging
554 int flag_keep_inline_functions
;
556 /* Nonzero means that functions will not be inlined. */
560 /* Nonzero means that we should emit static const variables
561 regardless of whether or not optimization is turned on. */
563 int flag_keep_static_consts
= 1;
565 /* Nonzero means we should be saving declaration info into a .X file. */
567 int flag_gen_aux_info
= 0;
569 /* Specified name of aux-info file. */
571 static char *aux_info_file_name
;
573 /* Nonzero means make the text shared if supported. */
575 int flag_shared_data
;
577 /* Nonzero means schedule into delayed branch slots if supported. */
579 int flag_delayed_branch
;
581 /* Nonzero if we are compiling pure (sharable) code.
582 Value is 1 if we are doing reasonable (i.e. simple
583 offset into offset table) pic. Value is 2 if we can
584 only perform register offsets. */
588 /* Nonzero means generate extra code for exception handling and enable
589 exception handling. */
591 int flag_exceptions
= 2;
593 /* Nonzero means don't place uninitialized global data in common storage
598 /* Nonzero means pretend it is OK to examine bits of target floats,
599 even if that isn't true. The resulting code will have incorrect constants,
600 but the same series of instructions that the native compiler would make. */
602 int flag_pretend_float
;
604 /* Nonzero means change certain warnings into errors.
605 Usually these are warnings about failure to conform to some standard. */
607 int flag_pedantic_errors
= 0;
609 /* flag_schedule_insns means schedule insns within basic blocks (before
611 flag_schedule_insns_after_reload means schedule insns after
614 int flag_schedule_insns
= 0;
615 int flag_schedule_insns_after_reload
= 0;
618 /* The following flags have effect only for scheduling before register
621 flag_schedule_interblock means schedule insns accross basic blocks.
622 flag_schedule_speculative means allow speculative motion of non-load insns.
623 flag_schedule_speculative_load means allow speculative motion of some
625 flag_schedule_speculative_load_dangerous allows speculative motion of more
627 flag_schedule_reverse_before_reload means try to reverse original order
629 flag_schedule_reverse_after_reload means try to reverse original order
632 int flag_schedule_interblock
= 1;
633 int flag_schedule_speculative
= 1;
634 int flag_schedule_speculative_load
= 0;
635 int flag_schedule_speculative_load_dangerous
= 0;
636 int flag_schedule_reverse_before_reload
= 0;
637 int flag_schedule_reverse_after_reload
= 0;
640 /* flag_on_branch_count_reg means try to replace add-1,compare,branch tupple
641 by a cheaper branch, on a count register. */
642 int flag_branch_on_count_reg
;
646 /* -finhibit-size-directive inhibits output of .size for ELF.
647 This is used only for compiling crtstuff.c,
648 and it may be extended to other effects
649 needed for crtstuff.c on other systems. */
650 int flag_inhibit_size_directive
= 0;
652 /* -fverbose-asm causes extra commentary information to be produced in
653 the generated assembly code (to make it more readable). This option
654 is generally only of use to those who actually need to read the
655 generated assembly code (perhaps while debugging the compiler itself).
656 -fno-verbose-asm, the default, causes the extra information
657 to be omitted and is useful when comparing two assembler files. */
659 int flag_verbose_asm
= 0;
661 /* -dA causes debug commentary information to be produced in
662 the generated assembly code (to make it more readable). This option
663 is generally only of use to those who actually need to read the
664 generated assembly code (perhaps while debugging the compiler itself).
665 Currently, this switch is only used by dwarfout.c; however, it is intended
666 to be a catchall for printing debug information in the assembler file. */
668 int flag_debug_asm
= 0;
670 /* -fgnu-linker specifies use of the GNU linker for initializations.
671 (Or, more generally, a linker that handles initializations.)
672 -fno-gnu-linker says that collect2 will be used. */
674 int flag_gnu_linker
= 0;
676 int flag_gnu_linker
= 1;
679 /* Tag all structures with __attribute__(packed) */
680 int flag_pack_struct
= 0;
682 /* Emit code to check for stack overflow; also may cause large objects
683 to be allocated dynamically. */
684 int flag_stack_check
;
686 /* -fcheck-memory-usage causes extra code to be generated in order to check
687 memory accesses. This is used by a detector of bad memory accesses such
689 int flag_check_memory_usage
= 0;
691 /* -fprefix-function-name causes function name to be prefixed. This
692 can be used with -fcheck-memory-usage to isolate code compiled with
693 -fcheck-memory-usage. */
694 int flag_prefix_function_name
= 0;
696 int flag_regmove
= 0;
698 /* 0 if pointer arguments may alias each other. True in C.
699 1 if pointer arguments may not alias each other but may alias
701 2 if pointer arguments may not alias each other and may not
702 alias global variables. True in Fortran.
703 This defaults to 0 for C. */
704 int flag_argument_noalias
= 0;
706 /* Table of language-independent -f options.
707 STRING is the option name. VARIABLE is the address of the variable.
708 ON_VALUE is the value to store in VARIABLE
709 if `-fSTRING' is seen as an option.
710 (If `-fno-STRING' is seen as an option, the opposite value is stored.) */
712 struct { char *string
; int *variable
; int on_value
;} f_options
[] =
714 {"float-store", &flag_float_store
, 1},
715 {"volatile", &flag_volatile
, 1},
716 {"volatile-global", &flag_volatile_global
, 1},
717 {"defer-pop", &flag_defer_pop
, 1},
718 {"omit-frame-pointer", &flag_omit_frame_pointer
, 1},
719 {"cse-follow-jumps", &flag_cse_follow_jumps
, 1},
720 {"cse-skip-blocks", &flag_cse_skip_blocks
, 1},
721 {"expensive-optimizations", &flag_expensive_optimizations
, 1},
722 {"thread-jumps", &flag_thread_jumps
, 1},
723 {"strength-reduce", &flag_strength_reduce
, 1},
724 {"unroll-loops", &flag_unroll_loops
, 1},
725 {"unroll-all-loops", &flag_unroll_all_loops
, 1},
726 {"move-all-movables", &flag_move_all_movables
, 1},
727 {"reduce-all-givs", &flag_reduce_all_givs
, 1},
728 {"writable-strings", &flag_writable_strings
, 1},
729 {"peephole", &flag_no_peephole
, 0},
730 {"force-mem", &flag_force_mem
, 1},
731 {"force-addr", &flag_force_addr
, 1},
732 {"function-cse", &flag_no_function_cse
, 0},
733 {"inline-functions", &flag_inline_functions
, 1},
734 {"keep-inline-functions", &flag_keep_inline_functions
, 1},
735 {"inline", &flag_no_inline
, 0},
736 {"keep-static-consts", &flag_keep_static_consts
, 1},
737 {"syntax-only", &flag_syntax_only
, 1},
738 {"shared-data", &flag_shared_data
, 1},
739 {"caller-saves", &flag_caller_saves
, 1},
740 {"pcc-struct-return", &flag_pcc_struct_return
, 1},
741 {"reg-struct-return", &flag_pcc_struct_return
, 0},
742 {"delayed-branch", &flag_delayed_branch
, 1},
743 {"rerun-cse-after-loop", &flag_rerun_cse_after_loop
, 1},
744 {"rerun-loop-opt", &flag_rerun_loop_opt
, 1},
745 {"pretend-float", &flag_pretend_float
, 1},
746 {"schedule-insns", &flag_schedule_insns
, 1},
747 {"schedule-insns2", &flag_schedule_insns_after_reload
, 1},
749 {"sched-interblock",&flag_schedule_interblock
, 1},
750 {"sched-spec",&flag_schedule_speculative
, 1},
751 {"sched-spec-load",&flag_schedule_speculative_load
, 1},
752 {"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous
, 1},
753 {"sched-reverse-S",&flag_schedule_reverse_before_reload
, 1},
754 {"sched-reverse-R",&flag_schedule_reverse_after_reload
, 1},
755 {"branch-count-reg",&flag_branch_on_count_reg
, 1},
757 {"pic", &flag_pic
, 1},
758 {"PIC", &flag_pic
, 2},
759 {"exceptions", &flag_exceptions
, 1},
760 {"sjlj-exceptions", &exceptions_via_longjmp
, 1},
761 {"asynchronous-exceptions", &asynchronous_exceptions
, 1},
762 {"profile-arcs", &profile_arc_flag
, 1},
763 {"test-coverage", &flag_test_coverage
, 1},
764 {"branch-probabilities", &flag_branch_probabilities
, 1},
765 {"fast-math", &flag_fast_math
, 1},
766 {"common", &flag_no_common
, 0},
767 {"inhibit-size-directive", &flag_inhibit_size_directive
, 1},
768 {"function-sections", &flag_function_sections
, 1},
769 {"verbose-asm", &flag_verbose_asm
, 1},
770 {"gnu-linker", &flag_gnu_linker
, 1},
771 {"regmove", &flag_regmove
, 1},
772 {"pack-struct", &flag_pack_struct
, 1},
773 {"stack-check", &flag_stack_check
, 1},
774 {"argument-alias", &flag_argument_noalias
, 0},
775 {"argument-noalias", &flag_argument_noalias
, 1},
776 {"argument-noalias-global", &flag_argument_noalias
, 2},
777 {"check-memory-usage", &flag_check_memory_usage
, 1},
778 {"prefix-function-name", &flag_prefix_function_name
, 1}
781 /* Table of language-specific options. */
783 char *lang_options
[] =
786 "-fallow-single-precision",
788 "-fsigned-bitfields",
789 "-funsigned-bitfields",
790 "-fno-signed-bitfields",
791 "-fno-unsigned-bitfields",
795 "-fno-unsigned-char",
811 "-fno-cond-mismatch",
812 "-fdollars-in-identifiers",
813 "-fno-dollars-in-identifiers",
822 "-Wbad-function-cast",
823 "-Wno-bad-function-cast",
827 "-Wno-char-subscripts",
838 "-Wimplicit-function-declaration",
839 "-Wno-implicit-function-declaration",
840 "-Werror-implicit-function-declaration",
848 "-Wno-missing-braces",
849 "-Wmissing-declarations",
850 "-Wno-missing-declarations",
851 "-Wmissing-prototypes",
852 "-Wno-missing-prototypes",
854 "-Wno-nested-externs",
858 "-Wno-pointer-arith",
860 "-Wno-redundant-decls",
864 "-Wno-unknown-pragmas",
865 "-Wstrict-prototypes",
866 "-Wno-strict-prototypes",
874 "-Wno-write-strings",
876 /* these are for obj c */
887 "-print-objc-runtime-info",
893 /* Options controlling warnings */
895 /* Don't print warning messages. -w. */
897 int inhibit_warnings
= 0;
899 /* Print various extra warnings. -W. */
901 int extra_warnings
= 0;
903 /* Treat warnings as errors. -Werror. */
905 int warnings_are_errors
= 0;
907 /* Nonzero to warn about unused local variables. */
911 /* Nonzero to warn about variables used before they are initialized. */
913 int warn_uninitialized
;
915 /* Nonzero means warn about all declarations which shadow others. */
919 /* Warn if a switch on an enum fails to have a case for every enum value. */
923 /* Nonzero means warn about function definitions that default the return type
924 or that use a null return and have a return-type other than void. */
926 int warn_return_type
;
928 /* Nonzero means warn about pointer casts that increase the required
929 alignment of the target type (and might therefore lead to a crash
930 due to a misaligned access). */
934 /* Nonzero means warn about any identifiers that match in the first N
935 characters. The value N is in `id_clash_len'. */
938 unsigned id_clash_len
;
940 /* Nonzero means warn about any objects definitions whose size is larger
941 than N bytes. Also want about function definitions whose returned
942 values are larger than N bytes. The value N is in `larger_than_size'. */
944 int warn_larger_than
;
945 unsigned larger_than_size
;
947 /* Nonzero means warn if inline function is too large. */
951 /* Warn if a function returns an aggregate,
952 since there are often incompatible calling conventions for doing this. */
954 int warn_aggregate_return
;
956 /* Likewise for -W. */
958 struct { char *string
; int *variable
; int on_value
;} W_options
[] =
960 {"unused", &warn_unused
, 1},
961 {"error", &warnings_are_errors
, 1},
962 {"shadow", &warn_shadow
, 1},
963 {"switch", &warn_switch
, 1},
964 {"aggregate-return", &warn_aggregate_return
, 1},
965 {"cast-align", &warn_cast_align
, 1},
966 {"uninitialized", &warn_uninitialized
, 1},
967 {"inline", &warn_inline
, 1}
970 /* Output files for assembler code (real compiler output)
971 and debugging dumps. */
975 FILE *rtl_dump_file
= NULL
;
977 /* Time accumulators, to count the total time spent in various passes. */
981 int integration_time
;
986 int branch_prob_time
;
991 int local_alloc_time
;
992 int global_alloc_time
;
995 int shorten_branch_time
;
1001 /* Return time used so far, in microseconds. */
1011 #else /* not BeOS */
1012 #if defined (_WIN32) && !defined (__CYGWIN32__)
1016 return (clock() * 1000);
1017 #else /* not _WIN32 */
1023 tick
= 1000000 / sysconf(_SC_CLK_TCK
);
1025 return (tms
.tms_utime
+ tms
.tms_stime
) * tick
;
1032 return (tms
.tms_utime
+ tms
.tms_stime
) * (1000000 / HZ
);
1037 struct rusage rusage
;
1038 getrusage (0, &rusage
);
1039 return (rusage
.ru_utime
.tv_sec
* 1000000 + rusage
.ru_utime
.tv_usec
1040 + rusage
.ru_stime
.tv_sec
* 1000000 + rusage
.ru_stime
.tv_usec
);
1047 int proc_system_time
;
1048 int child_user_time
;
1049 int child_system_time
;
1051 times ((void *) &vms_times
);
1052 return (vms_times
.proc_user_time
+ vms_times
.proc_system_time
) * 10000;
1056 #endif /* _SC_CLK_TCK */
1058 #endif /* __BEOS__ */
1061 #define TIMEVAR(VAR, BODY) \
1062 do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
1065 print_time (str
, total
)
1070 "time in %s: %d.%06d\n",
1071 str
, total
/ 1000000, total
% 1000000);
1074 /* Count an error or warning. Return 1 if the message should be printed. */
1077 count_error (warningp
)
1080 if (warningp
&& inhibit_warnings
)
1083 if (warningp
&& !warnings_are_errors
)
1087 static int warning_message
= 0;
1089 if (warningp
&& !warning_message
)
1091 fprintf (stderr
, "%s: warnings being treated as errors\n", progname
);
1092 warning_message
= 1;
1100 /* Print a fatal error message. NAME is the text.
1101 Also include a system error message based on `errno'. */
1104 pfatal_with_name (name
)
1107 fprintf (stderr
, "%s: ", progname
);
1109 exit (FATAL_EXIT_CODE
);
1113 fatal_io_error (name
)
1116 fprintf (stderr
, "%s: %s: I/O error\n", progname
, name
);
1117 exit (FATAL_EXIT_CODE
);
1120 /* Called to give a better error message for a bad insn rather than
1121 just calling abort(). */
1124 fatal_insn (message
, insn
)
1131 fflush (asm_out_file
);
1133 fflush (aux_info_file
);
1134 if (rtl_dump_file
!= NULL
)
1135 fflush (rtl_dump_file
);
1141 /* Called to give a better error message when we don't have an insn to match
1142 what we are looking for or if the insn's constraints aren't satisfied,
1143 rather than just calling abort(). */
1146 fatal_insn_not_found (insn
)
1149 if (INSN_CODE (insn
) < 0)
1150 fatal_insn ("internal error--unrecognizable insn:", insn
);
1152 fatal_insn ("internal error--insn does not satisfy its constraints:", insn
);
1155 /* This is the default decl_printable_name function. */
1158 decl_name (decl
, verbosity
)
1162 return IDENTIFIER_POINTER (DECL_NAME (decl
));
1165 static int need_error_newline
;
1167 /* Function of last error message;
1168 more generally, function such that if next error message is in it
1169 then we don't have to mention the function name. */
1170 static tree last_error_function
= NULL
;
1172 /* Used to detect when input_file_stack has changed since last described. */
1173 static int last_error_tick
;
1175 /* Called when the start of a function definition is parsed,
1176 this function prints on stderr the name of the function. */
1179 announce_function (decl
)
1184 if (rtl_dump_and_exit
)
1185 fprintf (stderr
, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl
)));
1187 fprintf (stderr
, " %s", (*decl_printable_name
) (decl
, 2));
1189 need_error_newline
= 1;
1190 last_error_function
= current_function_decl
;
1194 /* The default function to print out name of current function that caused
1198 default_print_error_function (file
)
1201 if (last_error_function
!= current_function_decl
)
1203 char *kind
= "function";
1204 if (current_function_decl
!= 0
1205 && TREE_CODE (TREE_TYPE (current_function_decl
)) == METHOD_TYPE
)
1209 fprintf (stderr
, "%s: ", file
);
1211 if (current_function_decl
== NULL
)
1212 fprintf (stderr
, "At top level:\n");
1215 char *name
= (*decl_printable_name
) (current_function_decl
, 2);
1216 fprintf (stderr
, "In %s `%s':\n", kind
, name
);
1219 last_error_function
= current_function_decl
;
1223 /* Called by report_error_function to print out function name.
1224 * Default may be overridden by language front-ends. */
1226 void (*print_error_function
) PROTO((char *)) = default_print_error_function
;
1228 /* Prints out, if necessary, the name of the current function
1229 that caused an error. Called from all error and warning functions. */
1232 report_error_function (file
)
1235 struct file_stack
*p
;
1237 if (need_error_newline
)
1239 fprintf (stderr
, "\n");
1240 need_error_newline
= 0;
1243 (*print_error_function
) (file
);
1245 if (input_file_stack
&& input_file_stack
->next
!= 0
1246 && input_file_stack_tick
!= last_error_tick
1247 && file
== input_filename
)
1249 fprintf (stderr
, "In file included");
1250 for (p
= input_file_stack
->next
; p
; p
= p
->next
)
1252 fprintf (stderr
, " from %s:%d", p
->name
, p
->line
);
1254 fprintf (stderr
, ",\n ");
1256 fprintf (stderr
, ":\n");
1257 last_error_tick
= input_file_stack_tick
;
1261 /* Print a message. */
1264 vmessage (prefix
, s
, ap
)
1270 fprintf (stderr
, "%s: ", prefix
);
1273 vfprintf (stderr
, s
, ap
);
1276 HOST_WIDE_INT v1
= va_arg(ap
, HOST_WIDE_INT
);
1277 HOST_WIDE_INT v2
= va_arg(ap
, HOST_WIDE_INT
);
1278 HOST_WIDE_INT v3
= va_arg(ap
, HOST_WIDE_INT
);
1279 HOST_WIDE_INT v4
= va_arg(ap
, HOST_WIDE_INT
);
1280 fprintf (stderr
, s
, v1
, v2
, v3
, v4
);
1285 /* Print a message relevant to line LINE of file FILE. */
1288 v_message_with_file_and_line (file
, line
, prefix
, s
, ap
)
1296 fprintf (stderr
, "%s:%d: ", file
, line
);
1298 fprintf (stderr
, "%s: ", progname
);
1300 vmessage (prefix
, s
, ap
);
1301 fputc ('\n', stderr
);
1304 /* Print a message relevant to the given DECL. */
1307 v_message_with_decl (decl
, prefix
, s
, ap
)
1315 fprintf (stderr
, "%s:%d: ",
1316 DECL_SOURCE_FILE (decl
), DECL_SOURCE_LINE (decl
));
1319 fprintf (stderr
, "%s: ", prefix
);
1321 /* Do magic to get around lack of varargs support for insertion
1322 of arguments into existing list. We know that the decl is first;
1323 we ass_u_me that it will be printed with "%s". */
1325 for (p
= s
; *p
; ++p
)
1329 if (*(p
+ 1) == '%')
1336 if (p
> s
) /* Print the left-hand substring. */
1338 char fmt
[sizeof "%.255s"];
1341 if (width
> 255L) width
= 255L; /* arbitrary */
1342 sprintf (fmt
, "%%.%lds", width
);
1343 fprintf (stderr
, fmt
, s
);
1346 if (*p
== '%') /* Print the name. */
1348 char *n
= (DECL_NAME (decl
)
1349 ? (*decl_printable_name
) (decl
, 2)
1355 if (isalpha (*(p
- 1) & 0xFF))
1360 if (*p
) /* Print the rest of the message. */
1361 vmessage ((char *)NULL
, p
, ap
);
1363 fputc ('\n', stderr
);
1366 /* Figure file and line of the given INSN. */
1369 file_and_line_for_asm (insn
, pfile
, pline
)
1374 rtx body
= PATTERN (insn
);
1377 /* Find the (or one of the) ASM_OPERANDS in the insn. */
1378 if (GET_CODE (body
) == SET
&& GET_CODE (SET_SRC (body
)) == ASM_OPERANDS
)
1379 asmop
= SET_SRC (body
);
1380 else if (GET_CODE (body
) == ASM_OPERANDS
)
1382 else if (GET_CODE (body
) == PARALLEL
1383 && GET_CODE (XVECEXP (body
, 0, 0)) == SET
)
1384 asmop
= SET_SRC (XVECEXP (body
, 0, 0));
1385 else if (GET_CODE (body
) == PARALLEL
1386 && GET_CODE (XVECEXP (body
, 0, 0)) == ASM_OPERANDS
)
1387 asmop
= XVECEXP (body
, 0, 0);
1393 *pfile
= ASM_OPERANDS_SOURCE_FILE (asmop
);
1394 *pline
= ASM_OPERANDS_SOURCE_LINE (asmop
);
1398 *pfile
= input_filename
;
1403 /* Report an error at line LINE of file FILE. */
1406 v_error_with_file_and_line (file
, line
, s
, ap
)
1413 report_error_function (file
);
1414 v_message_with_file_and_line (file
, line
, (char *)NULL
, s
, ap
);
1418 error_with_file_and_line
VPROTO((char *file
, int line
, char *s
, ...))
1430 file
= va_arg (ap
, char *);
1431 line
= va_arg (ap
, int);
1432 s
= va_arg (ap
, char *);
1435 v_error_with_file_and_line (file
, line
, s
, ap
);
1439 /* Report an error at the declaration DECL.
1440 S is a format string which uses %s to substitute the declaration
1441 name; subsequent substitutions are a la printf. */
1444 v_error_with_decl (decl
, s
, ap
)
1450 report_error_function (DECL_SOURCE_FILE (decl
));
1451 v_message_with_decl (decl
, (char *)NULL
, s
, ap
);
1455 error_with_decl
VPROTO((tree decl
, char *s
, ...))
1466 decl
= va_arg (ap
, tree
);
1467 s
= va_arg (ap
, char *);
1470 v_error_with_decl (decl
, s
, ap
);
1474 /* Report an error at the line number of the insn INSN.
1475 This is used only when INSN is an `asm' with operands,
1476 and each ASM_OPERANDS records its own source file and line. */
1479 v_error_for_asm (insn
, s
, ap
)
1488 file_and_line_for_asm (insn
, &file
, &line
);
1489 report_error_function (file
);
1490 v_message_with_file_and_line (file
, line
, (char *)NULL
, s
, ap
);
1494 error_for_asm
VPROTO((rtx insn
, char *s
, ...))
1505 insn
= va_arg (ap
, rtx
);
1506 s
= va_arg (ap
, char *);
1509 v_error_for_asm (insn
, s
, ap
);
1513 /* Report an error at the current line number. */
1520 v_error_with_file_and_line (input_filename
, lineno
, s
, ap
);
1524 error
VPROTO((char *s
, ...))
1534 s
= va_arg (ap
, char *);
1541 /* Report a fatal error at the current line number. */
1549 exit (FATAL_EXIT_CODE
);
1553 fatal
VPROTO((char *s
, ...))
1563 s
= va_arg (ap
, char *);
1570 /* Report a warning at line LINE of file FILE. */
1573 v_warning_with_file_and_line (file
, line
, s
, ap
)
1579 if (count_error (1))
1581 report_error_function (file
);
1582 v_message_with_file_and_line (file
, line
, "warning", s
, ap
);
1587 warning_with_file_and_line
VPROTO((char *file
, int line
, char *s
, ...))
1599 file
= va_arg (ap
, char *);
1600 line
= va_arg (ap
, int);
1601 s
= va_arg (ap
, char *);
1604 v_warning_with_file_and_line (file
, line
, s
, ap
);
1608 /* Report a warning at the declaration DECL.
1609 S is a format string which uses %s to substitute the declaration
1610 name; subsequent substitutions are a la printf. */
1613 v_warning_with_decl (decl
, s
, ap
)
1618 if (count_error (1))
1620 report_error_function (DECL_SOURCE_FILE (decl
));
1621 v_message_with_decl (decl
, "warning", s
, ap
);
1626 warning_with_decl
VPROTO((tree decl
, char *s
, ...))
1637 decl
= va_arg (ap
, tree
);
1638 s
= va_arg (ap
, char *);
1641 v_warning_with_decl (decl
, s
, ap
);
1645 /* Report a warning at the line number of the insn INSN.
1646 This is used only when INSN is an `asm' with operands,
1647 and each ASM_OPERANDS records its own source file and line. */
1650 v_warning_for_asm (insn
, s
, ap
)
1655 if (count_error (1))
1660 file_and_line_for_asm (insn
, &file
, &line
);
1661 report_error_function (file
);
1662 v_message_with_file_and_line (file
, line
, "warning", s
, ap
);
1667 warning_for_asm
VPROTO((rtx insn
, char *s
, ...))
1678 insn
= va_arg (ap
, rtx
);
1679 s
= va_arg (ap
, char *);
1682 v_warning_for_asm (insn
, s
, ap
);
1686 /* Report a warning at the current line number. */
1693 v_warning_with_file_and_line (input_filename
, lineno
, s
, ap
);
1697 warning
VPROTO((char *s
, ...))
1707 s
= va_arg (ap
, char *);
1714 /* These functions issue either warnings or errors depending on
1715 -pedantic-errors. */
1722 if (flag_pedantic_errors
)
1729 pedwarn
VPROTO((char *s
, ...))
1739 s
= va_arg (ap
, char *);
1747 v_pedwarn_with_decl (decl
, s
, ap
)
1752 /* We don't want -pedantic-errors to cause the compilation to fail from
1753 "errors" in system header files. Sometimes fixincludes can't fix what's
1754 broken (eg: unsigned char bitfields - fixing it may change the alignment
1755 which will cause programs to mysteriously fail because the C library
1756 or kernel uses the original layout). There's no point in issuing a
1757 warning either, it's just unnecessary noise. */
1759 if (! DECL_IN_SYSTEM_HEADER (decl
))
1761 if (flag_pedantic_errors
)
1762 v_error_with_decl (decl
, s
, ap
);
1764 v_warning_with_decl (decl
, s
, ap
);
1769 pedwarn_with_decl
VPROTO((tree decl
, char *s
, ...))
1780 decl
= va_arg (ap
, tree
);
1781 s
= va_arg (ap
, char *);
1784 v_pedwarn_with_decl (decl
, s
, ap
);
1789 v_pedwarn_with_file_and_line (file
, line
, s
, ap
)
1795 if (flag_pedantic_errors
)
1796 v_error_with_file_and_line (file
, line
, s
, ap
);
1798 v_warning_with_file_and_line (file
, line
, s
, ap
);
1802 pedwarn_with_file_and_line
VPROTO((char *file
, int line
, char *s
, ...))
1814 file
= va_arg (ap
, char *);
1815 line
= va_arg (ap
, int);
1816 s
= va_arg (ap
, char *);
1819 v_pedwarn_with_file_and_line (file
, line
, s
, ap
);
1823 /* Apologize for not implementing some feature. */
1832 fprintf (stderr
, "%s:%d: ", input_filename
, lineno
);
1834 fprintf (stderr
, "%s: ", progname
);
1835 vmessage ("sorry, not implemented", s
, ap
);
1836 fputc ('\n', stderr
);
1840 sorry
VPROTO((char *s
, ...))
1850 s
= va_arg (ap
, char *);
1857 /* Apologize for not implementing some feature, then quit. */
1860 v_really_sorry (s
, ap
)
1866 fprintf (stderr
, "%s:%d: ", input_filename
, lineno
);
1868 fprintf (stderr
, "%s: ", progname
);
1869 vmessage ("sorry, not implemented", s
, ap
);
1870 fatal (" (fatal)\n");
1874 really_sorry
VPROTO((char *s
, ...))
1884 s
= va_arg (ap
, char *);
1887 v_really_sorry (s
, ap
);
1891 /* More 'friendly' abort that prints the line and file.
1892 config.h can #define abort fancy_abort if you like that sort of thing.
1894 I don't think this is actually a good idea.
1895 Other sorts of crashes will look a certain way.
1896 It is a good thing if crashes from calling abort look the same way.
1902 fatal ("internal gcc abort");
1905 /* This calls abort and is used to avoid problems when abort if a macro.
1906 It is used when we need to pass the address of abort. */
1914 /* When `malloc.c' is compiled with `rcheck' defined,
1915 it calls this function to report clobberage. */
1924 /* Same as `malloc' but report error if no memory available. */
1930 register char *value
= (char *) malloc (size
);
1931 if (value
== 0 && size
!= 0)
1932 fatal ("virtual memory exhausted");
1936 /* Same as `realloc' but report error if no memory available.
1937 Also handle null PTR even if the vendor realloc gets it wrong. */
1940 xrealloc (ptr
, size
)
1945 ? (char *) realloc (ptr
, size
)
1946 : (char *) malloc (size
));
1948 fatal ("virtual memory exhausted");
1952 /* Same as `strdup' but report error if no memory available. */
1958 register char *result
= (char *) malloc (strlen (s
) + 1);
1961 fatal ("virtual memory exhausted");
1966 /* Return the logarithm of X, base 2, considering X unsigned,
1967 if X is a power of 2. Otherwise, returns -1.
1969 This should be used via the `exact_log2' macro. */
1973 register unsigned HOST_WIDE_INT x
;
1975 register int log
= 0;
1976 /* Test for 0 or a power of 2. */
1977 if (x
== 0 || x
!= (x
& -x
))
1979 while ((x
>>= 1) != 0)
1984 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
1985 If X is 0, return -1.
1987 This should be used via the floor_log2 macro. */
1991 register unsigned HOST_WIDE_INT x
;
1993 register int log
= -1;
2000 static int float_handler_set
;
2002 jmp_buf float_handler
;
2004 /* Signals actually come here. */
2007 float_signal (signo
)
2008 /* If this is missing, some compilers complain. */
2011 if (float_handled
== 0)
2013 #if defined (USG) || defined (hpux)
2014 signal (SIGFPE
, float_signal
); /* re-enable the signal catcher */
2017 signal (SIGFPE
, float_signal
);
2018 longjmp (float_handler
, 1);
2021 /* Specify where to longjmp to when a floating arithmetic error happens.
2022 If HANDLER is 0, it means don't handle the errors any more. */
2025 set_float_handler (handler
)
2028 float_handled
= (handler
!= 0);
2030 bcopy ((char *) handler
, (char *) float_handler
, sizeof (float_handler
));
2032 if (float_handled
&& ! float_handler_set
)
2034 signal (SIGFPE
, float_signal
);
2035 float_handler_set
= 1;
2039 /* Specify, in HANDLER, where to longjmp to when a floating arithmetic
2040 error happens, pushing the previous specification into OLD_HANDLER.
2041 Return an indication of whether there was a previous handler in effect. */
2044 push_float_handler (handler
, old_handler
)
2045 jmp_buf handler
, old_handler
;
2047 int was_handled
= float_handled
;
2051 bcopy ((char *) float_handler
, (char *) old_handler
,
2052 sizeof (float_handler
));
2054 bcopy ((char *) handler
, (char *) float_handler
, sizeof (float_handler
));
2058 /* Restore the previous specification of whether and where to longjmp to
2059 when a floating arithmetic error happens. */
2062 pop_float_handler (handled
, handler
)
2066 float_handled
= handled
;
2068 bcopy ((char *) handler
, (char *) float_handler
, sizeof (float_handler
));
2071 /* Handler for SIGPIPE. */
2075 /* If this is missing, some compilers complain. */
2078 fatal ("output pipe has been closed");
2081 /* Strip off a legitimate source ending from the input string NAME of
2082 length LEN. Rather than having to know the names used by all of
2083 our front ends, we strip off an ending of a period followed by one,
2084 two, or three characters. */
2087 strip_off_ending (name
, len
)
2091 if (len
> 2 && name
[len
- 2] == '.')
2092 name
[len
- 2] = '\0';
2093 else if (len
> 3 && name
[len
- 3] == '.')
2094 name
[len
- 3] = '\0';
2095 else if (len
> 4 && name
[len
- 4] == '.')
2096 name
[len
- 4] = '\0';
2099 /* Output a quoted string. */
2102 output_quoted_string (asm_file
, string
)
2106 #ifdef OUTPUT_QUOTED_STRING
2107 OUTPUT_QUOTED_STRING (asm_file
, string
);
2111 putc ('\"', asm_file
);
2112 while ((c
= *string
++) != 0)
2114 if (c
== '\"' || c
== '\\')
2115 putc ('\\', asm_file
);
2118 putc ('\"', asm_file
);
2122 /* Output a file name in the form wanted by System V. */
2125 output_file_directive (asm_file
, input_name
)
2129 int len
= strlen (input_name
);
2130 char *na
= input_name
+ len
;
2132 /* NA gets INPUT_NAME sans directory names. */
2133 while (na
> input_name
)
2140 #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
2141 ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file
, na
);
2143 #ifdef ASM_OUTPUT_SOURCE_FILENAME
2144 ASM_OUTPUT_SOURCE_FILENAME (asm_file
, na
);
2146 fprintf (asm_file
, "\t.file\t");
2147 output_quoted_string (asm_file
, na
);
2148 fputc ('\n', asm_file
);
2153 /* Routine to build language identifier for object file. */
2156 output_lang_identify (asm_out_file
)
2159 int len
= strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
2160 char *s
= (char *) alloca (len
);
2161 sprintf (s
, "__gnu_compiled_%s", lang_identify ());
2162 ASM_OUTPUT_LABEL (asm_out_file
, s
);
2165 /* Routine to open a dump file. */
2167 open_dump_file (suffix
, function_name
)
2169 char *function_name
;
2176 dumpname
= (char *) xmalloc (strlen (dump_base_name
) + strlen (suffix
) + 1);
2178 if (rtl_dump_file
!= NULL
)
2179 fclose (rtl_dump_file
);
2181 strcpy (dumpname
, dump_base_name
);
2182 strcat (dumpname
, suffix
);
2184 rtl_dump_file
= fopen (dumpname
, "a");
2186 if (rtl_dump_file
== NULL
)
2187 pfatal_with_name (dumpname
);
2192 fprintf (rtl_dump_file
, "\n;; Function %s\n\n", function_name
);
2198 /* Routine to close a dump file. */
2200 close_dump_file (func
, insns
)
2201 void (*func
)(FILE *, rtx
);
2208 func (rtl_dump_file
, insns
);
2210 fflush (rtl_dump_file
);
2211 fclose (rtl_dump_file
);
2213 rtl_dump_file
= NULL
;
2219 /* Routine to dump rtl into a file. */
2221 dump_rtl (suffix
, decl
, func
, insns
)
2224 void (*func
)(FILE *, rtx
);
2227 open_dump_file (suffix
, decl_printable_name (decl
, 2));
2228 close_dump_file (func
, insns
);
2231 /* Routine to empty a dump file. */
2233 clean_dump_file (suffix
)
2238 dumpname
= (char *) xmalloc (strlen (dump_base_name
) + strlen (suffix
) + 1);
2240 strcpy (dumpname
, dump_base_name
);
2241 strcat (dumpname
, suffix
);
2243 rtl_dump_file
= fopen (dumpname
, "w");
2245 if (rtl_dump_file
== NULL
)
2246 pfatal_with_name (dumpname
);
2250 fclose (rtl_dump_file
);
2251 rtl_dump_file
= NULL
;
2257 /* Compile an entire file of output from cpp, named NAME.
2258 Write a file of assembly output and various debugging dumps. */
2267 int name_specified
= name
!= 0;
2269 if (dump_base_name
== 0)
2270 dump_base_name
= name
? name
: "gccdump";
2274 integration_time
= 0;
2279 branch_prob_time
= 0;
2284 local_alloc_time
= 0;
2285 global_alloc_time
= 0;
2288 shorten_branch_time
= 0;
2295 /* Open input file. */
2297 if (name
== 0 || !strcmp (name
, "-"))
2303 finput
= fopen (name
, "r");
2305 pfatal_with_name (name
);
2307 #ifdef IO_BUFFER_SIZE
2308 setvbuf (finput
, (char *) xmalloc (IO_BUFFER_SIZE
), _IOFBF
, IO_BUFFER_SIZE
);
2310 #endif /* !USE_CPPLIB */
2312 /* Initialize data in various passes. */
2322 init_emit_once (debug_info_level
== DINFO_LEVEL_NORMAL
2323 || debug_info_level
== DINFO_LEVEL_VERBOSE
2324 || flag_test_coverage
);
2326 init_decl_processing ();
2335 if (flag_caller_saves
)
2336 init_caller_save ();
2338 /* If auxiliary info generation is desired, open the output file.
2339 This goes in the same directory as the source file--unlike
2340 all the other output files. */
2341 if (flag_gen_aux_info
)
2343 aux_info_file
= fopen (aux_info_file_name
, "w");
2344 if (aux_info_file
== 0)
2345 pfatal_with_name (aux_info_file_name
);
2348 /* Clear the dump files file. */
2350 clean_dump_file (".rtl");
2352 clean_dump_file (".jump");
2354 clean_dump_file (".addressof");
2356 clean_dump_file (".cse");
2358 clean_dump_file (".loop");
2360 clean_dump_file (".cse2");
2361 if (branch_prob_dump
)
2362 clean_dump_file (".bp");
2364 clean_dump_file (".flow");
2366 clean_dump_file (".combine");
2368 clean_dump_file (".regmove");
2370 clean_dump_file (".sched");
2372 clean_dump_file (".lreg");
2373 if (global_reg_dump
)
2374 clean_dump_file (".greg");
2376 clean_dump_file (".sched2");
2378 clean_dump_file (".jump2");
2380 clean_dump_file (".dbr");
2383 clean_dump_file (".stack");
2385 #ifdef MACHINE_DEPENDENT_REORG
2386 if (mach_dep_reorg_dump
)
2387 clean_dump_file (".mach");
2390 /* Open assembler code output file. */
2392 if (! name_specified
&& asm_file_name
== 0)
2393 asm_out_file
= stdout
;
2396 int len
= strlen (dump_base_name
);
2397 register char *dumpname
= (char *) xmalloc (len
+ 6);
2398 strcpy (dumpname
, dump_base_name
);
2399 strip_off_ending (dumpname
, len
);
2400 strcat (dumpname
, ".s");
2401 if (asm_file_name
== 0)
2403 asm_file_name
= (char *) xmalloc (strlen (dumpname
) + 1);
2404 strcpy (asm_file_name
, dumpname
);
2406 if (!strcmp (asm_file_name
, "-"))
2407 asm_out_file
= stdout
;
2409 asm_out_file
= fopen (asm_file_name
, "w");
2410 if (asm_out_file
== 0)
2411 pfatal_with_name (asm_file_name
);
2414 #ifdef IO_BUFFER_SIZE
2415 setvbuf (asm_out_file
, (char *) xmalloc (IO_BUFFER_SIZE
),
2416 _IOFBF
, IO_BUFFER_SIZE
);
2419 input_filename
= name
;
2421 /* Put an entry on the input file stack for the main input file. */
2423 = (struct file_stack
*) xmalloc (sizeof (struct file_stack
));
2424 input_file_stack
->next
= 0;
2425 input_file_stack
->name
= input_filename
;
2427 /* Gross. Gross. lang_init is (I think) the first callback into
2428 the language front end, and is thus the first opportunity to
2429 have the selected language override the default value for any
2432 So the default value for flag_exceptions is 2 (uninitialized).
2433 If we encounter -fno-exceptions or -fexceptions, then flag_exceptions
2434 will be set to zero or one respectively.
2436 flag_exceptions can also be set by lang_init to something other
2437 than the default "uninitialized" value of 2.
2439 After lang_init, if the value is still 2, then we default to
2440 -fno-exceptions (value will be reset to zero).
2442 When our EH mechanism is low enough overhead that we can enable
2443 it by default for languages other than C++, then all this braindamage
2446 /* Perform language-specific initialization.
2447 This may set main_input_filename. */
2450 if (flag_exceptions
== 2)
2451 flag_exceptions
= 0;
2453 /* If the input doesn't start with a #line, use the input name
2454 as the official input file name. */
2455 if (main_input_filename
== 0)
2456 main_input_filename
= name
;
2458 ASM_FILE_START (asm_out_file
);
2460 #ifdef ASM_COMMENT_START
2461 if (flag_verbose_asm
)
2463 /* Print the list of options in effect. */
2464 print_version (asm_out_file
, ASM_COMMENT_START
);
2465 print_switch_values (asm_out_file
, 0, MAX_LINE
,
2466 ASM_COMMENT_START
, " ", "\n");
2467 /* Add a blank line here so it appears in assembler output but not
2469 fprintf (asm_out_file
, "\n");
2473 /* Output something to inform GDB that this compilation was by GCC. */
2474 #ifndef ASM_IDENTIFY_GCC
2475 fprintf (asm_out_file
, "gcc2_compiled.:\n");
2477 ASM_IDENTIFY_GCC (asm_out_file
);
2480 /* Output something to identify which front-end produced this file. */
2481 #ifdef ASM_IDENTIFY_LANGUAGE
2482 ASM_IDENTIFY_LANGUAGE (asm_out_file
);
2485 #ifndef ASM_OUTPUT_SECTION_NAME
2486 if (flag_function_sections
)
2488 warning ("-ffunction-sections not supported for this target.");
2489 flag_function_sections
= 0;
2493 if (flag_function_sections
2494 && (profile_flag
|| profile_block_flag
))
2496 warning ("-ffunction-sections disabled; it makes profiling impossible.");
2497 flag_function_sections
= 0;
2500 if (flag_function_sections
&& write_symbols
!= NO_DEBUG
)
2501 warning ("-ffunction-sections may affect debugging on some targets.");
2503 /* ??? Note: There used to be a conditional here
2504 to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
2505 This was to guarantee separation between gcc_compiled. and
2506 the first function, for the sake of dbx on Suns.
2507 However, having the extra zero here confused the Emacs
2508 code for unexec, and might confuse other programs too.
2509 Therefore, I took out that change.
2510 In future versions we should find another way to solve
2511 that dbx problem. -- rms, 23 May 93. */
2513 /* Don't let the first function fall at the same address
2514 as gcc_compiled., if profiling. */
2515 if (profile_flag
|| profile_block_flag
)
2516 assemble_zeros (UNITS_PER_WORD
);
2518 /* If dbx symbol table desired, initialize writing it
2519 and output the predefined types. */
2520 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2521 if (write_symbols
== DBX_DEBUG
|| write_symbols
== XCOFF_DEBUG
)
2522 TIMEVAR (symout_time
, dbxout_init (asm_out_file
, main_input_filename
,
2525 #ifdef SDB_DEBUGGING_INFO
2526 if (write_symbols
== SDB_DEBUG
)
2527 TIMEVAR (symout_time
, sdbout_init (asm_out_file
, main_input_filename
,
2530 #ifdef DWARF_DEBUGGING_INFO
2531 if (write_symbols
== DWARF_DEBUG
)
2532 TIMEVAR (symout_time
, dwarfout_init (asm_out_file
, main_input_filename
));
2534 #ifdef DWARF2_UNWIND_INFO
2535 if (dwarf2out_do_frame ())
2536 dwarf2out_frame_init ();
2538 #ifdef DWARF2_DEBUGGING_INFO
2539 if (write_symbols
== DWARF2_DEBUG
)
2540 TIMEVAR (symout_time
, dwarf2out_init (asm_out_file
, main_input_filename
));
2543 /* Initialize yet another pass. */
2545 init_final (main_input_filename
);
2546 init_branch_prob (dump_base_name
);
2548 start_time
= get_run_time ();
2550 /* Call the parser, which parses the entire file
2551 (calling rest_of_compilation for each function). */
2553 if (yyparse () != 0)
2555 if (errorcount
== 0)
2556 fprintf (stderr
, "Errors detected in input file (your bison.simple is out of date)");
2558 /* In case there were missing closebraces,
2559 get us back to the global binding level. */
2560 while (! global_bindings_p ())
2564 output_func_start_profiler ();
2566 /* Compilation is now finished except for writing
2567 what's left of the symbol table output. */
2569 parse_time
+= get_run_time () - start_time
;
2571 parse_time
-= integration_time
;
2572 parse_time
-= varconst_time
;
2574 globals
= getdecls ();
2576 /* Really define vars that have had only a tentative definition.
2577 Really output inline functions that must actually be callable
2578 and have not been output so far. */
2581 int len
= list_length (globals
);
2582 tree
*vec
= (tree
*) alloca (sizeof (tree
) * len
);
2587 /* Process the decls in reverse order--earliest first.
2588 Put them into VEC from back to front, then take out from front. */
2590 for (i
= 0, decl
= globals
; i
< len
; i
++, decl
= TREE_CHAIN (decl
))
2591 vec
[len
- i
- 1] = decl
;
2593 for (i
= 0; i
< len
; i
++)
2597 /* We're not deferring this any longer. */
2598 DECL_DEFER_OUTPUT (decl
) = 0;
2600 if (TREE_CODE (decl
) == VAR_DECL
&& DECL_SIZE (decl
) == 0
2601 && incomplete_decl_finalize_hook
!= 0)
2602 (*incomplete_decl_finalize_hook
) (decl
);
2605 /* Now emit any global variables or functions that we have been putting
2606 off. We need to loop in case one of the things emitted here
2607 references another one which comes earlier in the list. */
2611 for (i
= 0; i
< len
; i
++)
2615 if (TREE_ASM_WRITTEN (decl
) || DECL_EXTERNAL (decl
))
2618 /* Don't write out static consts, unless we still need them.
2620 We also keep static consts if not optimizing (for debugging),
2621 unless the user specified -fno-keep-static-consts.
2622 ??? They might be better written into the debug information.
2623 This is possible when using DWARF.
2625 A language processor that wants static constants to be always
2626 written out (even if it is not used) is responsible for
2627 calling rest_of_decl_compilation itself. E.g. the C front-end
2628 calls rest_of_decl_compilation from finish_decl.
2629 One motivation for this is that is conventional in some
2630 environments to write things like:
2631 static const char rcsid[] = "... version string ...";
2632 intending to force the string to be in the executable.
2634 A language processor that would prefer to have unneeded
2635 static constants "optimized away" would just defer writing
2636 them out until here. E.g. C++ does this, because static
2637 constants are often defined in header files.
2639 ??? A tempting alternative (for both C and C++) would be
2640 to force a constant to be written if and only if it is
2641 defined in a main file, as opposed to an include file. */
2643 if (TREE_CODE (decl
) == VAR_DECL
&& TREE_STATIC (decl
)
2644 && (! TREE_READONLY (decl
)
2645 || TREE_PUBLIC (decl
)
2646 || (!optimize
&& flag_keep_static_consts
)
2647 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl
))))
2650 rest_of_decl_compilation (decl
, NULL_PTR
, 1, 1);
2653 if (TREE_CODE (decl
) == FUNCTION_DECL
2654 && DECL_INITIAL (decl
) != 0
2655 && DECL_SAVED_INSNS (decl
) != 0
2656 && (flag_keep_inline_functions
2657 || TREE_PUBLIC (decl
)
2658 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl
))))
2661 temporary_allocation ();
2662 output_inline_function (decl
);
2663 permanent_allocation (1);
2668 /* Now that all possible functions have been output, we can dump
2669 the exception table. */
2671 output_exception_table ();
2673 for (i
= 0; i
< len
; i
++)
2677 if (TREE_CODE (decl
) == VAR_DECL
&& TREE_STATIC (decl
)
2678 && ! TREE_ASM_WRITTEN (decl
))
2679 /* Cancel the RTL for this decl so that, if debugging info
2680 output for global variables is still to come,
2681 this one will be omitted. */
2682 DECL_RTL (decl
) = NULL
;
2684 /* Warn about any function
2685 declared static but not defined.
2686 We don't warn about variables,
2687 because many programs have static variables
2688 that exist only to get some text into the object file. */
2689 if (TREE_CODE (decl
) == FUNCTION_DECL
2691 || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl
)))
2692 && DECL_INITIAL (decl
) == 0
2693 && DECL_EXTERNAL (decl
)
2694 && ! DECL_ARTIFICIAL (decl
)
2695 && ! TREE_PUBLIC (decl
))
2697 pedwarn_with_decl (decl
,
2698 "`%s' declared `static' but never defined");
2699 /* This symbol is effectively an "extern" declaration now. */
2700 TREE_PUBLIC (decl
) = 1;
2701 assemble_external (decl
);
2704 /* Warn about static fns or vars defined but not used,
2705 but not about inline functions or static consts
2706 since defining those in header files is normal practice. */
2708 && ((TREE_CODE (decl
) == FUNCTION_DECL
&& ! DECL_INLINE (decl
))
2709 || (TREE_CODE (decl
) == VAR_DECL
&& ! TREE_READONLY (decl
)))
2710 && ! DECL_IN_SYSTEM_HEADER (decl
)
2711 && ! DECL_EXTERNAL (decl
)
2712 && ! TREE_PUBLIC (decl
)
2713 && ! TREE_USED (decl
)
2714 && (TREE_CODE (decl
) == FUNCTION_DECL
|| ! DECL_REGISTER (decl
))
2715 /* The TREE_USED bit for file-scope decls
2716 is kept in the identifier, to handle multiple
2717 external decls in different scopes. */
2718 && ! TREE_USED (DECL_NAME (decl
)))
2719 warning_with_decl (decl
, "`%s' defined but not used");
2721 #ifdef SDB_DEBUGGING_INFO
2722 /* The COFF linker can move initialized global vars to the end.
2723 And that can screw up the symbol ordering.
2724 By putting the symbols in that order to begin with,
2725 we avoid a problem. mcsun!unido!fauern!tumuc!pes@uunet.uu.net. */
2726 if (write_symbols
== SDB_DEBUG
&& TREE_CODE (decl
) == VAR_DECL
2727 && TREE_PUBLIC (decl
) && DECL_INITIAL (decl
)
2728 && ! DECL_EXTERNAL (decl
)
2729 && DECL_RTL (decl
) != 0)
2730 TIMEVAR (symout_time
, sdbout_symbol (decl
, 0));
2732 /* Output COFF information for non-global
2733 file-scope initialized variables. */
2734 if (write_symbols
== SDB_DEBUG
2735 && TREE_CODE (decl
) == VAR_DECL
2736 && DECL_INITIAL (decl
)
2737 && ! DECL_EXTERNAL (decl
)
2738 && DECL_RTL (decl
) != 0
2739 && GET_CODE (DECL_RTL (decl
)) == MEM
)
2740 TIMEVAR (symout_time
, sdbout_toplevel_data (decl
));
2741 #endif /* SDB_DEBUGGING_INFO */
2742 #ifdef DWARF_DEBUGGING_INFO
2743 /* Output DWARF information for file-scope tentative data object
2744 declarations, file-scope (extern) function declarations (which
2745 had no corresponding body) and file-scope tagged type declarations
2746 and definitions which have not yet been forced out. */
2748 if (write_symbols
== DWARF_DEBUG
2749 && (TREE_CODE (decl
) != FUNCTION_DECL
|| !DECL_INITIAL (decl
)))
2750 TIMEVAR (symout_time
, dwarfout_file_scope_decl (decl
, 1));
2752 #ifdef DWARF2_DEBUGGING_INFO
2753 /* Output DWARF2 information for file-scope tentative data object
2754 declarations, file-scope (extern) function declarations (which
2755 had no corresponding body) and file-scope tagged type declarations
2756 and definitions which have not yet been forced out. */
2758 if (write_symbols
== DWARF2_DEBUG
2759 && (TREE_CODE (decl
) != FUNCTION_DECL
|| !DECL_INITIAL (decl
)))
2760 TIMEVAR (symout_time
, dwarf2out_decl (decl
));
2765 /* Write out any pending weak symbol declarations. */
2769 /* Do dbx symbols */
2770 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2771 if (write_symbols
== DBX_DEBUG
|| write_symbols
== XCOFF_DEBUG
)
2772 TIMEVAR (symout_time
,
2774 dbxout_finish (asm_out_file
, main_input_filename
);
2778 #ifdef DWARF_DEBUGGING_INFO
2779 if (write_symbols
== DWARF_DEBUG
)
2780 TIMEVAR (symout_time
,
2786 #ifdef DWARF2_UNWIND_INFO
2787 if (dwarf2out_do_frame ())
2788 dwarf2out_frame_finish ();
2791 #ifdef DWARF2_DEBUGGING_INFO
2792 if (write_symbols
== DWARF2_DEBUG
)
2793 TIMEVAR (symout_time
,
2795 dwarf2out_finish ();
2799 /* Output some stuff at end of file if nec. */
2801 end_final (dump_base_name
);
2803 if (branch_prob_dump
)
2804 open_dump_file (".bp", NULL
);
2806 TIMEVAR (dump_time
, end_branch_prob (rtl_dump_file
));
2808 if (branch_prob_dump
)
2809 close_dump_file (NULL
, NULL_RTX
);
2812 ASM_FILE_END (asm_out_file
);
2815 /* Language-specific end of compilation actions. */
2819 /* Close the dump files. */
2821 if (flag_gen_aux_info
)
2823 fclose (aux_info_file
);
2825 unlink (aux_info_file_name
);
2830 open_dump_file (".combine", NULL
);
2831 TIMEVAR (dump_time
, dump_combine_total_stats (rtl_dump_file
));
2832 close_dump_file (NULL
, NULL_RTX
);
2835 /* Close non-debugging input and output files. Take special care to note
2836 whether fclose returns an error, since the pages might still be on the
2837 buffer chain while the file is open. */
2844 if (ferror (asm_out_file
) != 0 || fclose (asm_out_file
) != 0)
2845 fatal_io_error (asm_file_name
);
2847 /* Print the times. */
2851 fprintf (stderr
,"\n");
2852 print_time ("parse", parse_time
);
2854 print_time ("integration", integration_time
);
2855 print_time ("jump", jump_time
);
2856 print_time ("cse", cse_time
);
2857 print_time ("loop", loop_time
);
2858 print_time ("cse2", cse2_time
);
2859 print_time ("branch-prob", branch_prob_time
);
2860 print_time ("flow", flow_time
);
2861 print_time ("combine", combine_time
);
2862 print_time ("regmove", regmove_time
);
2863 print_time ("sched", sched_time
);
2864 print_time ("local-alloc", local_alloc_time
);
2865 print_time ("global-alloc", global_alloc_time
);
2866 print_time ("sched2", sched2_time
);
2867 print_time ("dbranch", dbr_sched_time
);
2868 print_time ("shorten-branch", shorten_branch_time
);
2869 print_time ("stack-reg", stack_reg_time
);
2870 print_time ("final", final_time
);
2871 print_time ("varconst", varconst_time
);
2872 print_time ("symout", symout_time
);
2873 print_time ("dump", dump_time
);
2877 /* This is called from various places for FUNCTION_DECL, VAR_DECL,
2878 and TYPE_DECL nodes.
2880 This does nothing for local (non-static) variables.
2881 Otherwise, it sets up the RTL and outputs any assembler code
2882 (label definition, storage allocation and initialization).
2884 DECL is the declaration. If ASMSPEC is nonzero, it specifies
2885 the assembler symbol name to be used. TOP_LEVEL is nonzero
2886 if this declaration is not within a function. */
2889 rest_of_decl_compilation (decl
, asmspec
, top_level
, at_end
)
2895 /* Declarations of variables, and of functions defined elsewhere. */
2897 /* The most obvious approach, to put an #ifndef around where
2898 this macro is used, doesn't work since it's inside a macro call. */
2899 #ifndef ASM_FINISH_DECLARE_OBJECT
2900 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
2903 /* Forward declarations for nested functions are not "external",
2904 but we need to treat them as if they were. */
2905 if (TREE_STATIC (decl
) || DECL_EXTERNAL (decl
)
2906 || TREE_CODE (decl
) == FUNCTION_DECL
)
2907 TIMEVAR (varconst_time
,
2909 make_decl_rtl (decl
, asmspec
, top_level
);
2910 /* Initialized extern variable exists to be replaced
2911 with its value, or represents something that will be
2912 output in another file. */
2913 if (! (TREE_CODE (decl
) == VAR_DECL
2914 && DECL_EXTERNAL (decl
) && TREE_READONLY (decl
)
2915 && DECL_INITIAL (decl
) != 0
2916 && DECL_INITIAL (decl
) != error_mark_node
))
2917 /* Don't output anything
2918 when a tentative file-scope definition is seen.
2919 But at end of compilation, do output code for them. */
2920 if (! (! at_end
&& top_level
2921 && (DECL_INITIAL (decl
) == 0
2922 || DECL_INITIAL (decl
) == error_mark_node
)))
2923 assemble_variable (decl
, top_level
, at_end
, 0);
2924 if (decl
== last_assemble_variable_decl
)
2926 ASM_FINISH_DECLARE_OBJECT (asm_out_file
, decl
,
2930 else if (DECL_REGISTER (decl
) && asmspec
!= 0)
2932 if (decode_reg_name (asmspec
) >= 0)
2934 DECL_RTL (decl
) = 0;
2935 make_decl_rtl (decl
, asmspec
, top_level
);
2938 error ("invalid register name `%s' for register variable", asmspec
);
2940 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2941 else if ((write_symbols
== DBX_DEBUG
|| write_symbols
== XCOFF_DEBUG
)
2942 && TREE_CODE (decl
) == TYPE_DECL
)
2943 TIMEVAR (symout_time
, dbxout_symbol (decl
, 0));
2945 #ifdef SDB_DEBUGGING_INFO
2946 else if (write_symbols
== SDB_DEBUG
&& top_level
2947 && TREE_CODE (decl
) == TYPE_DECL
)
2948 TIMEVAR (symout_time
, sdbout_symbol (decl
, 0));
2952 /* Called after finishing a record, union or enumeral type. */
2955 rest_of_type_compilation (type
, toplev
)
2959 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2960 if (write_symbols
== DBX_DEBUG
|| write_symbols
== XCOFF_DEBUG
)
2961 TIMEVAR (symout_time
, dbxout_symbol (TYPE_STUB_DECL (type
), !toplev
));
2963 #ifdef SDB_DEBUGGING_INFO
2964 if (write_symbols
== SDB_DEBUG
)
2965 TIMEVAR (symout_time
, sdbout_symbol (TYPE_STUB_DECL (type
), !toplev
));
2969 /* This is called from finish_function (within yyparse)
2970 after each top-level definition is parsed.
2971 It is supposed to compile that function or variable
2972 and output the assembler code for it.
2973 After we return, the tree storage is freed. */
2976 rest_of_compilation (decl
)
2980 int start_time
= get_run_time ();
2982 /* Nonzero if we have saved the original DECL_INITIAL of the function,
2983 to be restored after we finish compiling the function
2984 (for use when compiling inline calls to this function). */
2985 tree saved_block_tree
= 0;
2986 /* Likewise, for DECL_ARGUMENTS. */
2987 tree saved_arguments
= 0;
2990 /* If we are reconsidering an inline function
2991 at the end of compilation, skip the stuff for making it inline. */
2993 if (DECL_SAVED_INSNS (decl
) == 0)
2998 /* If requested, consider whether to make this function inline. */
2999 if (DECL_INLINE (decl
) || flag_inline_functions
)
3000 TIMEVAR (integration_time
,
3002 lose
= function_cannot_inline_p (decl
);
3003 if (lose
|| ! optimize
)
3005 if (warn_inline
&& DECL_INLINE (decl
))
3006 warning_with_decl (decl
, lose
);
3007 DECL_ABSTRACT_ORIGIN (decl
) = 0;
3008 /* Don't really compile an extern inline function.
3009 If we can't make it inline, pretend
3010 it was only declared. */
3011 if (DECL_EXTERNAL (decl
))
3013 DECL_INITIAL (decl
) = 0;
3014 goto exit_rest_of_compilation
;
3018 /* ??? Note that this has the effect of making it look
3019 like "inline" was specified for a function if we choose
3020 to inline it. This isn't quite right, but it's
3021 probably not worth the trouble to fix. */
3022 inlinable
= DECL_INLINE (decl
) = 1;
3025 insns
= get_insns ();
3027 /* Dump the rtl code if we are dumping rtl. */
3031 open_dump_file (".rtl", decl_printable_name (decl
, 2));
3033 if (DECL_SAVED_INSNS (decl
))
3034 fprintf (rtl_dump_file
, ";; (integrable)\n\n");
3036 close_dump_file (print_rtl
, insns
);
3039 /* If we can, defer compiling inlines until EOF.
3040 save_for_inline_copying can be extremely expensive. */
3041 if (inlinable
&& ! decl_function_context (decl
))
3042 DECL_DEFER_OUTPUT (decl
) = 1;
3044 /* If function is inline, and we don't yet know whether to
3045 compile it by itself, defer decision till end of compilation.
3046 finish_compilation will call rest_of_compilation again
3047 for those functions that need to be output. Also defer those
3048 functions that we are supposed to defer. We cannot defer
3049 functions containing nested functions since the nested function
3050 data is in our non-saved obstack. */
3052 /* If this is a nested inline, remove ADDRESSOF now so we can
3053 finish compiling ourselves. Otherwise, wait until EOF.
3054 We have to do this because the purge_addressof transformation
3055 changes the DECL_RTL for many variables, which confuses integrate. */
3058 if (decl_function_context (decl
))
3059 purge_addressof (insns
);
3061 DECL_DEFER_OUTPUT (decl
) = 1;
3064 if (! current_function_contains_functions
3065 && (DECL_DEFER_OUTPUT (decl
)
3066 || (DECL_INLINE (decl
)
3067 && ((! TREE_PUBLIC (decl
) && ! TREE_ADDRESSABLE (decl
)
3068 && ! flag_keep_inline_functions
)
3069 || DECL_EXTERNAL (decl
)))))
3071 DECL_DEFER_OUTPUT (decl
) = 1;
3073 /* If -Wreturn-type, we have to do a bit of compilation.
3074 However, if we just fall through we will call
3075 save_for_inline_copying() which results in excessive
3076 memory use. Instead, we just want to call
3077 jump_optimize() to figure out whether or not we can fall
3078 off the end of the function; we do the minimum amount of
3079 work necessary to make that safe. And, we set optimize
3080 to zero to keep jump_optimize from working too hard. */
3081 if (warn_return_type
)
3083 int saved_optimize
= optimize
;
3085 find_exception_handler_labels ();
3086 jump_optimize (get_insns(), 0, 0, 0);
3087 optimize
= saved_optimize
;
3090 #ifdef DWARF_DEBUGGING_INFO
3091 /* Generate the DWARF info for the "abstract" instance
3092 of a function which we may later generate inlined and/or
3093 out-of-line instances of. */
3094 if (write_symbols
== DWARF_DEBUG
)
3096 set_decl_abstract_flags (decl
, 1);
3097 TIMEVAR (symout_time
, dwarfout_file_scope_decl (decl
, 0));
3098 set_decl_abstract_flags (decl
, 0);
3101 #ifdef DWARF2_DEBUGGING_INFO
3102 /* Generate the DWARF2 info for the "abstract" instance
3103 of a function which we may later generate inlined and/or
3104 out-of-line instances of. */
3105 if (write_symbols
== DWARF2_DEBUG
)
3107 set_decl_abstract_flags (decl
, 1);
3108 TIMEVAR (symout_time
, dwarf2out_decl (decl
));
3109 set_decl_abstract_flags (decl
, 0);
3112 TIMEVAR (integration_time
, save_for_inline_nocopy (decl
));
3113 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl
)) = inlinable
;
3114 goto exit_rest_of_compilation
;
3117 /* If we have to compile the function now, save its rtl and subdecls
3118 so that its compilation will not affect what others get. */
3119 if (inlinable
|| DECL_DEFER_OUTPUT (decl
))
3121 #ifdef DWARF_DEBUGGING_INFO
3122 /* Generate the DWARF info for the "abstract" instance of
3123 a function which we will generate an out-of-line instance
3124 of almost immediately (and which we may also later generate
3125 various inlined instances of). */
3126 if (write_symbols
== DWARF_DEBUG
)
3128 set_decl_abstract_flags (decl
, 1);
3129 TIMEVAR (symout_time
, dwarfout_file_scope_decl (decl
, 0));
3130 set_decl_abstract_flags (decl
, 0);
3133 #ifdef DWARF2_DEBUGGING_INFO
3134 /* Generate the DWARF2 info for the "abstract" instance of
3135 a function which we will generate an out-of-line instance
3136 of almost immediately (and which we may also later generate
3137 various inlined instances of). */
3138 if (write_symbols
== DWARF2_DEBUG
)
3140 set_decl_abstract_flags (decl
, 1);
3141 TIMEVAR (symout_time
, dwarf2out_decl (decl
));
3142 set_decl_abstract_flags (decl
, 0);
3145 saved_block_tree
= DECL_INITIAL (decl
);
3146 saved_arguments
= DECL_ARGUMENTS (decl
);
3147 TIMEVAR (integration_time
, save_for_inline_copying (decl
));
3148 RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl
)) = inlinable
;
3151 /* If specified extern inline but we aren't inlining it, we are
3153 if (DECL_INLINE (decl
) && DECL_EXTERNAL (decl
))
3154 goto exit_rest_of_compilation
;
3157 if (! DECL_DEFER_OUTPUT (decl
))
3158 TREE_ASM_WRITTEN (decl
) = 1;
3160 /* Now that integrate will no longer see our rtl, we need not distinguish
3161 between the return value of this function and the return value of called
3163 rtx_equal_function_value_matters
= 0;
3165 /* Don't return yet if -Wreturn-type; we need to do jump_optimize. */
3166 if ((rtl_dump_and_exit
|| flag_syntax_only
) && !warn_return_type
)
3168 goto exit_rest_of_compilation
;
3171 /* Emit code to get eh context, if needed. */
3175 /* If we are doing position-independent code generation, now
3176 is the time to output special prologues and epilogues.
3177 We do not want to do this earlier, because it just clutters
3178 up inline functions with meaningless insns. */
3183 /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
3184 Note that that may have been done above, in save_for_inline_copying.
3185 The call to resume_temporary_allocation near the end of this function
3186 goes back to the usual state of affairs. This must be done after
3187 we've built up any unwinders for exception handling, and done
3188 the FINALIZE_PIC work, if necessary. */
3190 rtl_in_current_obstack ();
3192 insns
= get_insns ();
3194 /* Copy any shared structure that should not be shared. */
3196 unshare_all_rtl (insns
);
3198 #ifdef SETJMP_VIA_SAVE_AREA
3199 /* This must be performed before virutal register instantiation. */
3200 if (current_function_calls_alloca
)
3201 optimize_save_area_alloca (insns
);
3204 /* Instantiate all virtual registers. */
3206 instantiate_virtual_regs (current_function_decl
, get_insns ());
3208 /* See if we have allocated stack slots that are not directly addressable.
3209 If so, scan all the insns and create explicit address computation
3210 for all references to such slots. */
3211 /* fixup_stack_slots (); */
3213 /* Find all the EH handlers. */
3214 find_exception_handler_labels ();
3216 /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
3217 are initialized and to compute whether control can drop off the end
3219 TIMEVAR (jump_time
, reg_scan (insns
, max_reg_num (), 0));
3220 TIMEVAR (jump_time
, jump_optimize (insns
, 0, 0, 1));
3222 /* Now is when we stop if -fsyntax-only and -Wreturn-type. */
3223 if (rtl_dump_and_exit
|| flag_syntax_only
|| DECL_DEFER_OUTPUT (decl
))
3224 goto exit_rest_of_compilation
;
3226 /* Dump rtl code after jump, if we are doing that. */
3229 dump_rtl (".jump", decl
, print_rtl
, insns
);
3231 /* Perform common subexpression elimination.
3232 Nonzero value from `cse_main' means that jumps were simplified
3233 and some code may now be unreachable, so do
3234 jump optimization again. */
3239 open_dump_file (".cse", decl_printable_name (decl
, 2));
3241 TIMEVAR (cse_time
, reg_scan (insns
, max_reg_num (), 1));
3243 if (flag_thread_jumps
)
3244 /* Hacks by tiemann & kenner. */
3245 TIMEVAR (jump_time
, thread_jumps (insns
, max_reg_num (), 1));
3247 TIMEVAR (cse_time
, tem
= cse_main (insns
, max_reg_num (),
3249 TIMEVAR (cse_time
, delete_dead_from_cse (insns
, max_reg_num ()));
3251 if (tem
|| optimize
> 1)
3252 TIMEVAR (jump_time
, jump_optimize (insns
, 0, 0, 0));
3254 /* Dump rtl code after cse, if we are doing that. */
3257 close_dump_file (print_rtl
, insns
);
3260 purge_addressof (insns
);
3261 reg_scan (insns
, max_reg_num (), 1);
3264 dump_rtl (".addressof", decl
, print_rtl
, insns
);
3266 /* Move constant computations out of loops. */
3271 open_dump_file (".loop", decl_printable_name (decl
, 2));
3276 if (flag_rerun_loop_opt
)
3278 /* We only want to perform unrolling once. */
3280 loop_optimize (insns
, rtl_dump_file
, 0);
3282 /* The regscan pass may not be necessary, but let's
3283 be safe until we can prove otherwise. */
3284 reg_scan (insns
, max_reg_num (), 1);
3286 loop_optimize (insns
, rtl_dump_file
, flag_unroll_loops
);
3289 /* Dump rtl code after loop opt, if we are doing that. */
3292 close_dump_file (print_rtl
, insns
);
3298 open_dump_file (".cse2", decl_printable_name (decl
, 2));
3300 if (flag_rerun_cse_after_loop
)
3302 /* Running another jump optimization pass before the second
3303 cse pass sometimes simplifies the RTL enough to allow
3304 the second CSE pass to do a better job. Jump_optimize can change
3305 max_reg_num so we must rerun reg_scan afterwards.
3306 ??? Rework to not call reg_scan so often. */
3307 TIMEVAR (jump_time
, reg_scan (insns
, max_reg_num (), 0));
3308 TIMEVAR (jump_time
, jump_optimize (insns
, 0, 0, 1));
3310 TIMEVAR (cse2_time
, reg_scan (insns
, max_reg_num (), 0));
3311 TIMEVAR (cse2_time
, tem
= cse_main (insns
, max_reg_num (),
3314 TIMEVAR (jump_time
, jump_optimize (insns
, 0, 0, 0));
3317 if (flag_thread_jumps
)
3319 /* This pass of jump threading straightens out code
3320 that was kinked by loop optimization. */
3321 TIMEVAR (jump_time
, reg_scan (insns
, max_reg_num (), 0));
3322 TIMEVAR (jump_time
, thread_jumps (insns
, max_reg_num (), 0));
3325 /* Dump rtl code after cse, if we are doing that. */
3328 close_dump_file (print_rtl
, insns
);
3331 if (profile_arc_flag
|| flag_test_coverage
|| flag_branch_probabilities
)
3333 if (branch_prob_dump
)
3334 open_dump_file (".bp", decl_printable_name (decl
, 2));
3339 branch_prob (insns
, rtl_dump_file
);
3342 if (branch_prob_dump
)
3343 close_dump_file (print_rtl
, insns
);
3346 /* We are no longer anticipating cse in this function, at least. */
3348 cse_not_expected
= 1;
3350 /* Now we choose between stupid (pcc-like) register allocation
3351 (if we got the -noreg switch and not -opt)
3352 and smart register allocation. */
3354 if (optimize
> 0) /* Stupid allocation probably won't work */
3355 obey_regdecls
= 0; /* if optimizations being done. */
3359 /* Print function header into flow dump now
3360 because doing the flow analysis makes some of the dump. */
3363 open_dump_file (".flow", decl_printable_name (decl
, 2));
3369 regclass (insns
, max_reg_num ());
3370 stupid_life_analysis (insns
, max_reg_num (),
3376 /* Do control and data flow analysis,
3377 and write some of the results to dump file. */
3379 TIMEVAR (flow_time
, flow_analysis (insns
, max_reg_num (),
3381 if (warn_uninitialized
)
3383 uninitialized_vars_warning (DECL_INITIAL (decl
));
3384 setjmp_args_warning ();
3388 /* Dump rtl after flow analysis. */
3391 close_dump_file (print_rtl_with_bb
, insns
);
3393 /* If -opt, try combining insns through substitution. */
3397 TIMEVAR (combine_time
, combine_instructions (insns
, max_reg_num ()));
3399 /* Dump rtl code after insn combination. */
3402 dump_rtl (".combine", decl
, print_rtl_with_bb
, insns
);
3405 /* Register allocation pre-pass, to reduce number of moves
3406 necessary for two-address machines. */
3407 if (optimize
> 0 && flag_regmove
)
3410 open_dump_file (".regmove", decl_printable_name (decl
, 2));
3412 TIMEVAR (regmove_time
, regmove_optimize (insns
, max_reg_num (),
3416 close_dump_file (print_rtl_with_bb
, insns
);
3419 /* Print function header into sched dump now
3420 because doing the sched analysis makes some of the dump. */
3422 if (optimize
> 0 && flag_schedule_insns
)
3425 open_dump_file (".sched", decl_printable_name (decl
, 2));
3427 /* Do control and data sched analysis,
3428 and write some of the results to dump file. */
3430 TIMEVAR (sched_time
, schedule_insns (rtl_dump_file
));
3432 /* Dump rtl after instruction scheduling. */
3435 close_dump_file (print_rtl_with_bb
, insns
);
3438 /* Unless we did stupid register allocation,
3439 allocate pseudo-regs that are used only within 1 basic block. */
3442 TIMEVAR (local_alloc_time
,
3444 regclass (insns
, max_reg_num ());
3448 /* Dump rtl code after allocating regs within basic blocks. */
3452 open_dump_file (".lreg", decl_printable_name (decl
, 2));
3454 TIMEVAR (dump_time
, dump_flow_info (rtl_dump_file
));
3455 TIMEVAR (dump_time
, dump_local_alloc (rtl_dump_file
));
3457 close_dump_file (print_rtl_with_bb
, insns
);
3460 if (global_reg_dump
)
3461 open_dump_file (".greg", decl_printable_name (decl
, 2));
3463 /* Save the last label number used so far, so reorg can tell
3464 when it's safe to kill spill regs. */
3465 max_label_num_after_reload
= max_label_num ();
3467 /* Unless we did stupid register allocation,
3468 allocate remaining pseudo-regs, then do the reload pass
3469 fixing up any insns that are invalid. */
3471 TIMEVAR (global_alloc_time
,
3474 failure
= global_alloc (rtl_dump_file
);
3476 failure
= reload (insns
, 0, rtl_dump_file
);
3479 if (global_reg_dump
)
3481 TIMEVAR (dump_time
, dump_global_regs (rtl_dump_file
));
3482 close_dump_file (print_rtl_with_bb
, insns
);
3486 goto exit_rest_of_compilation
;
3488 reload_completed
= 1;
3490 /* Do a very simple CSE pass over just the hard registers. */
3492 reload_cse_regs (insns
);
3494 /* On some machines, the prologue and epilogue code, or parts thereof,
3495 can be represented as RTL. Doing so lets us schedule insns between
3496 it and the rest of the code and also allows delayed branch
3497 scheduling to operate in the epilogue. */
3499 thread_prologue_and_epilogue_insns (insns
);
3501 if (optimize
> 0 && flag_schedule_insns_after_reload
)
3504 open_dump_file (".sched2", decl_printable_name (decl
, 2));
3506 /* Do control and data sched analysis again,
3507 and write some more of the results to dump file. */
3509 TIMEVAR (sched2_time
, schedule_insns (rtl_dump_file
));
3511 /* Dump rtl after post-reorder instruction scheduling. */
3514 close_dump_file (print_rtl_with_bb
, insns
);
3517 #ifdef LEAF_REGISTERS
3519 if (optimize
> 0 && only_leaf_regs_used () && leaf_function_p ())
3523 /* One more attempt to remove jumps to .+1
3524 left by dead-store-elimination.
3525 Also do cross-jumping this time
3526 and delete no-op move insns. */
3530 TIMEVAR (jump_time
, jump_optimize (insns
, 1, 1, 0));
3532 /* Dump rtl code after jump, if we are doing that. */
3535 dump_rtl (".jump2", decl
, print_rtl_with_bb
, insns
);
3538 /* If a machine dependent reorganization is needed, call it. */
3539 #ifdef MACHINE_DEPENDENT_REORG
3540 MACHINE_DEPENDENT_REORG (insns
);
3542 if (mach_dep_reorg_dump
)
3543 dump_rtl (".mach", decl
, print_rtl_with_bb
, insns
);
3546 /* If a scheduling pass for delayed branches is to be done,
3547 call the scheduling code. */
3550 if (optimize
> 0 && flag_delayed_branch
)
3552 TIMEVAR (dbr_sched_time
, dbr_schedule (insns
, rtl_dump_file
));
3555 dump_rtl (".dbr", decl
, print_rtl_with_bb
, insns
);
3559 /* Shorten branches. */
3560 TIMEVAR (shorten_branch_time
,
3562 shorten_branches (get_insns ());
3566 TIMEVAR (stack_reg_time
, reg_to_stack (insns
, rtl_dump_file
));
3569 dump_rtl (".stack", decl
, print_rtl_with_bb
, insns
);
3572 /* Now turn the rtl into assembler code. */
3574 TIMEVAR (final_time
,
3579 /* Get the function's name, as described by its RTL.
3580 This may be different from the DECL_NAME name used
3581 in the source file. */
3583 x
= DECL_RTL (decl
);
3584 if (GET_CODE (x
) != MEM
)
3587 if (GET_CODE (x
) != SYMBOL_REF
)
3589 fnname
= XSTR (x
, 0);
3591 assemble_start_function (decl
, fnname
);
3592 final_start_function (insns
, asm_out_file
, optimize
);
3593 final (insns
, asm_out_file
, optimize
, 0);
3594 final_end_function (insns
, asm_out_file
, optimize
);
3595 assemble_end_function (decl
, fnname
);
3596 fflush (asm_out_file
);
3598 /* Release all memory held by regsets now */
3599 regset_release_memory ();
3602 /* Write DBX symbols if requested */
3604 /* Note that for those inline functions where we don't initially
3605 know for certain that we will be generating an out-of-line copy,
3606 the first invocation of this routine (rest_of_compilation) will
3607 skip over this code by doing a `goto exit_rest_of_compilation;'.
3608 Later on, finish_compilation will call rest_of_compilation again
3609 for those inline functions that need to have out-of-line copies
3610 generated. During that call, we *will* be routed past here. */
3612 #ifdef DBX_DEBUGGING_INFO
3613 if (write_symbols
== DBX_DEBUG
)
3614 TIMEVAR (symout_time
, dbxout_function (decl
));
3617 #ifdef DWARF_DEBUGGING_INFO
3618 if (write_symbols
== DWARF_DEBUG
)
3619 TIMEVAR (symout_time
, dwarfout_file_scope_decl (decl
, 0));
3622 #ifdef DWARF2_DEBUGGING_INFO
3623 if (write_symbols
== DWARF2_DEBUG
)
3624 TIMEVAR (symout_time
, dwarf2out_decl (decl
));
3627 exit_rest_of_compilation
:
3629 /* In case the function was not output,
3630 don't leave any temporary anonymous types
3631 queued up for sdb output. */
3632 #ifdef SDB_DEBUGGING_INFO
3633 if (write_symbols
== SDB_DEBUG
)
3634 sdbout_types (NULL_TREE
);
3637 /* Put back the tree of subblocks and list of arguments
3638 from before we copied them.
3639 Code generation and the output of debugging info may have modified
3640 the copy, but the original is unchanged. */
3642 if (saved_block_tree
!= 0)
3644 DECL_INITIAL (decl
) = saved_block_tree
;
3645 DECL_ARGUMENTS (decl
) = saved_arguments
;
3646 DECL_ABSTRACT_ORIGIN (decl
) = NULL_TREE
;
3649 reload_completed
= 0;
3651 /* Clear out the insn_length contents now that they are no longer valid. */
3652 init_insn_lengths ();
3654 /* Clear out the real_constant_chain before some of the rtx's
3655 it runs through become garbage. */
3657 clear_const_double_mem ();
3659 /* Cancel the effect of rtl_in_current_obstack. */
3661 resume_temporary_allocation ();
3663 /* Show no temporary slots allocated. */
3667 /* The parsing time is all the time spent in yyparse
3668 *except* what is spent in this function. */
3670 parse_time
-= get_run_time () - start_time
;
3673 /* Entry point of cc1/c++. Decode command args, then call compile_file.
3674 Exit code is 35 if can't open files, 34 if fatal error,
3675 33 if had nonfatal errors, else success. */
3678 main (argc
, argv
, envp
)
3685 int flag_print_mem
= 0;
3686 int version_flag
= 0;
3689 /* save in case md file wants to emit args as a comment. */
3693 p
= argv
[0] + strlen (argv
[0]);
3694 while (p
!= argv
[0] && p
[-1] != '/'
3695 #ifdef DIR_SEPARATOR
3696 && p
[-1] != DIR_SEPARATOR
3702 #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
3703 /* Get rid of any avoidable limit on stack size. */
3707 /* Set the stack limit huge so that alloca does not fail. */
3708 getrlimit (RLIMIT_STACK
, &rlim
);
3709 rlim
.rlim_cur
= rlim
.rlim_max
;
3710 setrlimit (RLIMIT_STACK
, &rlim
);
3714 signal (SIGFPE
, float_signal
);
3717 signal (SIGPIPE
, pipe_closed
);
3720 decl_printable_name
= decl_name
;
3721 lang_expand_expr
= (struct rtx_def
*(*)()) do_abort
;
3723 /* Initialize whether `char' is signed. */
3724 flag_signed_char
= DEFAULT_SIGNED_CHAR
;
3725 #ifdef DEFAULT_SHORT_ENUMS
3726 /* Initialize how much space enums occupy, by default. */
3727 flag_short_enums
= DEFAULT_SHORT_ENUMS
;
3730 /* Scan to see what optimization level has been specified. That will
3731 determine the default value of many flags. */
3732 for (i
= 1; i
< argc
; i
++)
3734 if (!strcmp (argv
[i
], "-O"))
3738 else if (argv
[i
][0] == '-' && argv
[i
][1] == 'O')
3740 /* Handle -Os, -O2, -O3, -O69, ... */
3741 char *p
= &argv
[i
][2];
3744 if ((p
[0] == 's') && (p
[1] == 0))
3749 if (! (c
>= '0' && c
<= '9'))
3752 optimize
= atoi (&argv
[i
][2]);
3757 /* Optimizing for size forces optimize to be no less than 2. */
3758 if (optimize_size
&& (optimize
< 2))
3761 obey_regdecls
= (optimize
== 0);
3766 flag_thread_jumps
= 1;
3768 flag_delayed_branch
= 1;
3770 #ifdef CAN_DEBUG_WITHOUT_FP
3771 flag_omit_frame_pointer
= 1;
3777 flag_cse_follow_jumps
= 1;
3778 flag_cse_skip_blocks
= 1;
3779 flag_expensive_optimizations
= 1;
3780 flag_strength_reduce
= 1;
3781 flag_rerun_cse_after_loop
= 1;
3782 flag_rerun_loop_opt
= 1;
3783 flag_caller_saves
= 1;
3785 #ifdef INSN_SCHEDULING
3786 flag_schedule_insns
= 1;
3787 flag_schedule_insns_after_reload
= 1;
3794 flag_inline_functions
= 1;
3797 /* Disable code bloating optimizations if optimizing for size. */
3800 flag_inline_functions
= 0;
3803 /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
3806 set_target_switch ("");
3808 #ifdef OPTIMIZATION_OPTIONS
3809 /* Allow default optimizations to be specified on a per-machine basis. */
3810 OPTIMIZATION_OPTIONS (optimize
, optimize_size
);
3813 /* Initialize register usage now so switches may override. */
3816 for (i
= 1; i
< argc
; i
++)
3819 /* If this is a language-specific option,
3820 decode it in a language-specific way. */
3821 for (j
= 0; lang_options
[j
] != 0; j
++)
3822 if (!strncmp (argv
[i
], lang_options
[j
],
3823 strlen (lang_options
[j
])))
3825 if (lang_options
[j
] != 0)
3826 /* If the option is valid for *some* language,
3827 treat it as valid even if this language doesn't understand it. */
3828 lang_decode_option (argv
[i
]);
3829 else if (argv
[i
][0] == '-' && argv
[i
][1] != 0)
3831 register char *str
= argv
[i
] + 1;
3836 set_target_switch (&str
[1]);
3837 else if (!strcmp (str
, "dumpbase"))
3839 dump_base_name
= argv
[++i
];
3841 else if (str
[0] == 'd')
3843 register char *p
= &str
[1];
3848 branch_prob_dump
= 1;
3852 global_reg_dump
= 1;
3860 cse_dump
= 1, cse2_dump
= 1;
3866 #ifdef MACHINE_DEPENDENT_REORG
3867 mach_dep_reorg_dump
= 1;
3871 branch_prob_dump
= 1;
3888 global_reg_dump
= 1;
3908 #ifdef MACHINE_DEPENDENT_REORG
3910 mach_dep_reorg_dump
= 1;
3914 flag_print_asm_name
= 1;
3938 rtl_dump_and_exit
= 1;
3944 warning ("unrecognised gcc debugging option: %c", p
[-1]);
3948 else if (str
[0] == 'f')
3950 register char *p
= &str
[1];
3953 /* Some kind of -f option.
3954 P's value is the option sans `-f'.
3955 Search for it in the table of options. */
3958 !found
&& j
< sizeof (f_options
) / sizeof (f_options
[0]);
3961 if (!strcmp (p
, f_options
[j
].string
))
3963 *f_options
[j
].variable
= f_options
[j
].on_value
;
3964 /* A goto here would be cleaner,
3965 but breaks the vax pcc. */
3968 if (p
[0] == 'n' && p
[1] == 'o' && p
[2] == '-'
3969 && ! strcmp (p
+3, f_options
[j
].string
))
3971 *f_options
[j
].variable
= ! f_options
[j
].on_value
;
3979 #ifdef INSN_SCHEDULING
3980 else if (!strncmp (p
, "sched-verbose-",14))
3981 fix_sched_param("verbose",&p
[14]);
3982 else if (!strncmp (p
, "sched-max-",10))
3983 fix_sched_param("max",&p
[10]);
3984 else if (!strncmp (p
, "sched-inter-max-b-",18))
3985 fix_sched_param("interblock-max-blocks",&p
[18]);
3986 else if (!strncmp (p
, "sched-inter-max-i-",18))
3987 fix_sched_param("interblock-max-insns",&p
[18]);
3990 else if (!strncmp (p
, "fixed-", 6))
3991 fix_register (&p
[6], 1, 1);
3992 else if (!strncmp (p
, "call-used-", 10))
3993 fix_register (&p
[10], 0, 1);
3994 else if (!strncmp (p
, "call-saved-", 11))
3995 fix_register (&p
[11], 0, 0);
3997 error ("Invalid option `%s'", argv
[i
]);
3999 else if (str
[0] == 'O')
4001 register char *p
= str
+1;
4005 while (*p
&& *p
>= '0' && *p
<= '9')
4010 error ("Invalid option `%s'", argv
[i
]);
4012 else if (!strcmp (str
, "pedantic"))
4014 else if (!strcmp (str
, "pedantic-errors"))
4015 flag_pedantic_errors
= pedantic
= 1;
4016 else if (!strcmp (str
, "quiet"))
4018 else if (!strcmp (str
, "version"))
4020 else if (!strcmp (str
, "w"))
4021 inhibit_warnings
= 1;
4022 else if (!strcmp (str
, "W"))
4025 /* We save the value of warn_uninitialized, since if they put
4026 -Wuninitialized on the command line, we need to generate a
4027 warning about not using it without also specifying -O. */
4028 if (warn_uninitialized
!= 1)
4029 warn_uninitialized
= 2;
4031 else if (str
[0] == 'W')
4033 register char *p
= &str
[1];
4036 /* Some kind of -W option.
4037 P's value is the option sans `-W'.
4038 Search for it in the table of options. */
4041 !found
&& j
< sizeof (W_options
) / sizeof (W_options
[0]);
4044 if (!strcmp (p
, W_options
[j
].string
))
4046 *W_options
[j
].variable
= W_options
[j
].on_value
;
4047 /* A goto here would be cleaner,
4048 but breaks the vax pcc. */
4051 if (p
[0] == 'n' && p
[1] == 'o' && p
[2] == '-'
4052 && ! strcmp (p
+3, W_options
[j
].string
))
4054 *W_options
[j
].variable
= ! W_options
[j
].on_value
;
4061 else if (!strncmp (p
, "id-clash-", 9))
4067 if (*endp
>= '0' && *endp
<= '9')
4071 error ("Invalid option `%s'", argv
[i
]);
4076 id_clash_len
= atoi (str
+ 10);
4079 else if (!strncmp (p
, "larger-than-", 12))
4081 char *endp
= p
+ 12;
4085 if (*endp
>= '0' && *endp
<= '9')
4089 error ("Invalid option `%s'", argv
[i
]);
4090 goto larger_than_lose
;
4093 warn_larger_than
= 1;
4094 larger_than_size
= atoi (str
+ 13);
4098 error ("Invalid option `%s'", argv
[i
]);
4100 else if (!strcmp (str
, "p"))
4104 else if (!strcmp (str
, "a"))
4106 #if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4107 warning ("`-a' option (basic block profile) not supported");
4109 profile_block_flag
= (profile_block_flag
< 2) ? 1 : 3;
4112 else if (!strcmp (str
, "ax"))
4114 #if !defined (FUNCTION_BLOCK_PROFILER_EXIT) || !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
4115 warning ("`-ax' option (jump profiling) not supported");
4117 profile_block_flag
= (!profile_block_flag
4118 || profile_block_flag
== 2) ? 2 : 3;
4121 else if (str
[0] == 'g')
4125 /* A lot of code assumes write_symbols == NO_DEBUG if the
4126 debugging level is 0 (thus -gstabs1 -gstabs0 would lose track
4127 of what debugging type has been selected). This records the
4128 selected type. It is an error to specify more than one
4130 static enum debug_info_type selected_debug_type
= NO_DEBUG
;
4131 /* Non-zero if debugging format has been explicitly set.
4132 -g and -ggdb don't explicitly set the debugging format so
4133 -gdwarf -g3 is equivalent to -gdwarf3. */
4134 static int type_explicitly_set_p
= 0;
4135 /* Table of supported debugging formats. */
4138 /* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
4139 constant expression, we use NO_DEBUG in its place. */
4140 enum debug_info_type debug_type
;
4141 int use_extensions_p
;
4142 } *da
, debug_args
[] = {
4143 { "g", NO_DEBUG
, DEFAULT_GDB_EXTENSIONS
},
4144 { "ggdb", NO_DEBUG
, 1 },
4145 #ifdef DBX_DEBUGGING_INFO
4146 { "gstabs", DBX_DEBUG
, 0 },
4147 { "gstabs+", DBX_DEBUG
, 1 },
4149 #ifdef DWARF_DEBUGGING_INFO
4150 { "gdwarf", DWARF_DEBUG
, 0 },
4151 { "gdwarf+", DWARF_DEBUG
, 1 },
4153 #ifdef DWARF2_DEBUGGING_INFO
4154 { "gdwarf-2", DWARF2_DEBUG
, 0 },
4156 #ifdef XCOFF_DEBUGGING_INFO
4157 { "gxcoff", XCOFF_DEBUG
, 0 },
4158 { "gxcoff+", XCOFF_DEBUG
, 1 },
4160 #ifdef SDB_DEBUGGING_INFO
4161 { "gcoff", SDB_DEBUG
, 0 },
4165 /* Indexed by enum debug_info_type. */
4166 static char *debug_type_names
[] = {
4167 "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
4170 /* Look up STR in the table. */
4171 for (da
= debug_args
; da
->arg
; da
++)
4173 if (! strncmp (str
, da
->arg
, strlen (da
->arg
)))
4175 enum debug_info_type type
= da
->debug_type
;
4178 p
= str
+ strlen (da
->arg
);
4179 if (*p
&& (*p
< '0' || *p
> '9'))
4183 while (*q
&& (*q
>= '0' && *q
<= '9'))
4188 if (len
> 1 && !strncmp (str
, "gdwarf", len
))
4190 error ("use -gdwarf -g%d for DWARF v1, level %d",
4193 error ("use -gdwarf-2 for DWARF v2");
4197 level
= 2; /* default debugging info level */
4198 if (*q
|| level
> 3)
4200 warning ("invalid debug level specification in option: `-%s'",
4202 /* ??? This error message is incorrect in the case of
4204 warning ("no debugging information will be generated");
4208 if (type
== NO_DEBUG
)
4210 type
= PREFERRED_DEBUGGING_TYPE
;
4211 if (len
> 1 && strncmp (str
, "ggdb", len
) == 0)
4213 #ifdef DWARF2_DEBUGGING_INFO
4214 type
= DWARF2_DEBUG
;
4216 #ifdef DBX_DEBUGGING_INFO
4223 if (type
== NO_DEBUG
)
4224 warning ("`-%s' not supported by this configuration of GCC",
4227 /* Does it conflict with an already selected type? */
4228 if (type_explicitly_set_p
4229 /* -g/-ggdb don't conflict with anything */
4230 && da
->debug_type
!= NO_DEBUG
4231 && type
!= selected_debug_type
)
4232 warning ("`-%s' ignored, conflicts with `-g%s'",
4233 str
, debug_type_names
[(int) selected_debug_type
]);
4236 /* If the format has already been set, -g/-ggdb
4237 only change the debug level. */
4238 if (type_explicitly_set_p
4239 && da
->debug_type
== NO_DEBUG
)
4240 ; /* don't change debugging type */
4243 selected_debug_type
= type
;
4244 type_explicitly_set_p
= da
->debug_type
!= NO_DEBUG
;
4246 write_symbols
= (level
== 0
4248 : selected_debug_type
);
4249 use_gnu_debug_info_extensions
= da
->use_extensions_p
;
4250 debug_info_level
= (enum debug_info_level
) level
;
4256 warning ("`-%s' not supported by this configuration of GCC",
4259 else if (!strcmp (str
, "o"))
4261 asm_file_name
= argv
[++i
];
4263 else if (str
[0] == 'G')
4265 g_switch_set
= TRUE
;
4266 g_switch_value
= atoi ((str
[1] != '\0') ? str
+1 : argv
[++i
]);
4268 else if (!strncmp (str
, "aux-info", 8))
4270 flag_gen_aux_info
= 1;
4271 aux_info_file_name
= (str
[8] != '\0' ? str
+8 : argv
[++i
]);
4274 error ("Invalid option `%s'", argv
[i
]);
4276 else if (argv
[i
][0] == '+')
4277 error ("Invalid option `%s'", argv
[i
]);
4282 /* Checker uses the frame pointer. */
4283 if (flag_check_memory_usage
)
4284 flag_omit_frame_pointer
= 0;
4288 /* Inlining does not work if not optimizing,
4289 so force it not to be done. */
4293 /* The c_decode_option and lang_decode_option functions set
4294 this to `2' if -Wall is used, so we can avoid giving out
4295 lots of errors for people who don't realize what -Wall does. */
4296 if (warn_uninitialized
== 1)
4297 warning ("-Wuninitialized is not supported without -O");
4300 #ifdef OVERRIDE_OPTIONS
4301 /* Some machines may reject certain combinations of options. */
4305 if (exceptions_via_longjmp
== 2)
4307 #ifdef DWARF2_UNWIND_INFO
4308 exceptions_via_longjmp
= ! DWARF2_UNWIND_INFO
;
4310 exceptions_via_longjmp
= 1;
4314 if (profile_block_flag
== 3)
4316 warning ("`-ax' and `-a' are conflicting options. `-a' ignored.");
4317 profile_block_flag
= 2;
4320 /* Unrolling all loops implies that standard loop unrolling must also
4322 if (flag_unroll_all_loops
)
4323 flag_unroll_loops
= 1;
4324 /* Loop unrolling requires that strength_reduction be on also. Silently
4325 turn on strength reduction here if it isn't already on. Also, the loop
4326 unrolling code assumes that cse will be run after loop, so that must
4327 be turned on also. */
4328 if (flag_unroll_loops
)
4330 flag_strength_reduce
= 1;
4331 flag_rerun_cse_after_loop
= 1;
4334 /* Warn about options that are not supported on this machine. */
4335 #ifndef INSN_SCHEDULING
4336 if (flag_schedule_insns
|| flag_schedule_insns_after_reload
)
4337 warning ("instruction scheduling not supported on this target machine");
4340 if (flag_delayed_branch
)
4341 warning ("this target machine does not have delayed branches");
4344 /* If we are in verbose mode, write out the version and maybe all the
4345 option flags in use. */
4348 print_version (stderr
, "");
4350 print_switch_values (stderr
, 0, MAX_LINE
, "", " ", "\n");
4353 compile_file (filename
);
4355 #if !defined(OS2) && !defined(VMS) && (!defined(_WIN32) || defined (__CYGWIN32__))
4358 char *lim
= (char *) sbrk (0);
4360 fprintf (stderr
, "Data size %d.\n",
4361 lim
- (char *) &environ
);
4366 system ("ps -l 1>&2");
4369 #endif /* not USG */
4372 #endif /* ! OS2 && ! VMS && (! _WIN32 || CYGWIN32) */
4375 exit (FATAL_EXIT_CODE
);
4377 exit (FATAL_EXIT_CODE
);
4378 exit (SUCCESS_EXIT_CODE
);
4382 /* Decode -m switches. */
4384 /* Here is a table, controlled by the tm.h file, listing each -m switch
4385 and which bits in `target_switches' it should set or clear.
4386 If VALUE is positive, it is bits to set.
4387 If VALUE is negative, -VALUE is bits to clear.
4388 (The sign bit is not used so there is no confusion.) */
4390 struct {char *name
; int value
;} target_switches
[]
4393 /* This table is similar, but allows the switch to have a value. */
4395 #ifdef TARGET_OPTIONS
4396 struct {char *prefix
; char ** variable
;} target_options
[]
4400 /* Decode the switch -mNAME. */
4403 set_target_switch (name
)
4409 for (j
= 0; j
< sizeof target_switches
/ sizeof target_switches
[0]; j
++)
4410 if (!strcmp (target_switches
[j
].name
, name
))
4412 if (target_switches
[j
].value
< 0)
4413 target_flags
&= ~-target_switches
[j
].value
;
4415 target_flags
|= target_switches
[j
].value
;
4419 #ifdef TARGET_OPTIONS
4421 for (j
= 0; j
< sizeof target_options
/ sizeof target_options
[0]; j
++)
4423 int len
= strlen (target_options
[j
].prefix
);
4424 if (!strncmp (target_options
[j
].prefix
, name
, len
))
4426 *target_options
[j
].variable
= name
+ len
;
4433 error ("Invalid option `%s'", name
);
4436 /* Print version information to FILE.
4437 Each line begins with INDENT (for the case where FILE is the
4438 assembler output file). */
4441 print_version (file
, indent
)
4445 fprintf (file
, "%s%s%s version %s", indent
, *indent
!= 0 ? " " : "",
4446 language_string
, version_string
);
4447 fprintf (file
, " (%s)", TARGET_NAME
);
4450 #define __VERSION__ "[unknown]"
4452 fprintf (file
, " compiled by GNU C version %s.\n", __VERSION__
);
4454 fprintf (file
, " compiled by CC.\n");
4458 /* Print an option value and return the adjusted position in the line.
4459 ??? We don't handle error returns from fprintf (disk full); presumably
4460 other code will catch a disk full though. */
4463 print_single_switch (file
, pos
, max
, indent
, sep
, term
, type
, name
)
4466 char *indent
, *sep
, *term
, *type
, *name
;
4468 /* The ultrix fprintf returns 0 on success, so compute the result we want
4469 here since we need it for the following test. */
4470 int len
= strlen (sep
) + strlen (type
) + strlen (name
);
4475 fprintf (file
, "%s", term
);
4480 fprintf (file
, "%s", indent
);
4481 pos
= strlen (indent
);
4483 fprintf (file
, "%s%s%s", sep
, type
, name
);
4488 /* Print active target switches to FILE.
4489 POS is the current cursor position and MAX is the size of a "line".
4490 Each line begins with INDENT and ends with TERM.
4491 Each switch is separated from the next by SEP. */
4494 print_switch_values (file
, pos
, max
, indent
, sep
, term
)
4497 char *indent
, *sep
, *term
;
4502 /* Print the options as passed. */
4504 pos
= print_single_switch (file
, pos
, max
, indent
, *indent
? " " : "", term
,
4505 "options passed: ", "");
4507 for (p
= &save_argv
[1]; *p
!= NULL
; p
++)
4511 if (strcmp (*p
, "-o") == 0)
4517 if (strcmp (*p
, "-quiet") == 0)
4519 if (strcmp (*p
, "-version") == 0)
4524 pos
= print_single_switch (file
, pos
, max
, indent
, sep
, term
, *p
, "");
4527 fprintf (file
, "%s", term
);
4529 /* Print the -f and -m options that have been enabled.
4530 We don't handle language specific options but printing argv
4533 pos
= print_single_switch (file
, 0, max
, indent
, *indent
? " " : "", term
,
4534 "options enabled: ", "");
4536 for (j
= 0; j
< sizeof f_options
/ sizeof f_options
[0]; j
++)
4537 if (*f_options
[j
].variable
== f_options
[j
].on_value
)
4538 pos
= print_single_switch (file
, pos
, max
, indent
, sep
, term
,
4539 "-f", f_options
[j
].string
);
4541 /* Print target specific options. */
4543 flags
= target_flags
;
4544 for (j
= 0; j
< sizeof target_switches
/ sizeof target_switches
[0]; j
++)
4545 if (target_switches
[j
].name
[0] != '\0'
4546 && target_switches
[j
].value
> 0
4547 && ((target_switches
[j
].value
& target_flags
)
4548 == target_switches
[j
].value
))
4550 pos
= print_single_switch (file
, pos
, max
, indent
, sep
, term
,
4551 "-m", target_switches
[j
].name
);
4552 flags
&= ~ target_switches
[j
].value
;
4555 #ifdef TARGET_OPTIONS
4556 for (j
= 0; j
< sizeof target_options
/ sizeof target_options
[0]; j
++)
4557 if (*target_options
[j
].variable
!= NULL
)
4560 sprintf (prefix
, "-m%s", target_options
[j
].prefix
);
4561 pos
= print_single_switch (file
, pos
, max
, indent
, sep
, term
,
4562 prefix
, *target_options
[j
].variable
);
4566 fprintf (file
, "%s", term
);
4569 /* Record the beginning of a new source file, named FILENAME. */
4572 debug_start_source_file (filename
)
4573 register char *filename
;
4575 #ifdef DBX_DEBUGGING_INFO
4576 if (write_symbols
== DBX_DEBUG
)
4577 dbxout_start_new_source_file (filename
);
4579 #ifdef DWARF_DEBUGGING_INFO
4580 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4581 && write_symbols
== DWARF_DEBUG
)
4582 dwarfout_start_new_source_file (filename
);
4583 #endif /* DWARF_DEBUGGING_INFO */
4584 #ifdef DWARF2_DEBUGGING_INFO
4585 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4586 && write_symbols
== DWARF2_DEBUG
)
4587 dwarf2out_start_source_file (filename
);
4588 #endif /* DWARF2_DEBUGGING_INFO */
4589 #ifdef SDB_DEBUGGING_INFO
4590 if (write_symbols
== SDB_DEBUG
)
4591 sdbout_start_new_source_file (filename
);
4595 /* Record the resumption of a source file. LINENO is the line number in
4596 the source file we are returning to. */
4599 debug_end_source_file (lineno
)
4600 register unsigned lineno
;
4602 #ifdef DBX_DEBUGGING_INFO
4603 if (write_symbols
== DBX_DEBUG
)
4604 dbxout_resume_previous_source_file ();
4606 #ifdef DWARF_DEBUGGING_INFO
4607 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4608 && write_symbols
== DWARF_DEBUG
)
4609 dwarfout_resume_previous_source_file (lineno
);
4610 #endif /* DWARF_DEBUGGING_INFO */
4611 #ifdef DWARF2_DEBUGGING_INFO
4612 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4613 && write_symbols
== DWARF2_DEBUG
)
4614 dwarf2out_end_source_file ();
4615 #endif /* DWARF2_DEBUGGING_INFO */
4616 #ifdef SDB_DEBUGGING_INFO
4617 if (write_symbols
== SDB_DEBUG
)
4618 sdbout_resume_previous_source_file ();
4622 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
4623 the tail part of the directive line, i.e. the part which is past the
4624 initial whitespace, #, whitespace, directive-name, whitespace part. */
4627 debug_define (lineno
, buffer
)
4628 register unsigned lineno
;
4629 register char *buffer
;
4631 #ifdef DWARF_DEBUGGING_INFO
4632 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4633 && write_symbols
== DWARF_DEBUG
)
4634 dwarfout_define (lineno
, buffer
);
4635 #endif /* DWARF_DEBUGGING_INFO */
4636 #ifdef DWARF2_DEBUGGING_INFO
4637 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4638 && write_symbols
== DWARF2_DEBUG
)
4639 dwarf2out_define (lineno
, buffer
);
4640 #endif /* DWARF2_DEBUGGING_INFO */
4643 /* Called from check_newline in c-parse.y. The `buffer' parameter contains
4644 the tail part of the directive line, i.e. the part which is past the
4645 initial whitespace, #, whitespace, directive-name, whitespace part. */
4648 debug_undef (lineno
, buffer
)
4649 register unsigned lineno
;
4650 register char *buffer
;
4652 #ifdef DWARF_DEBUGGING_INFO
4653 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4654 && write_symbols
== DWARF_DEBUG
)
4655 dwarfout_undef (lineno
, buffer
);
4656 #endif /* DWARF_DEBUGGING_INFO */
4657 #ifdef DWARF2_DEBUGGING_INFO
4658 if (debug_info_level
== DINFO_LEVEL_VERBOSE
4659 && write_symbols
== DWARF2_DEBUG
)
4660 dwarf2out_undef (lineno
, buffer
);
4661 #endif /* DWARF2_DEBUGGING_INFO */