1 /* Top level of GNU C compiler
2 Copyright (C) 1987, 88, 89, 92, 93, 1994 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, 675 Mass Ave, Cambridge, MA 02139, 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>
41 #include <sys/param.h>
42 /* This is for hpux. It is a real screw. They should change hpux. */
44 #include <sys/times.h>
45 #include <time.h> /* Correct for hpux at least. Is it good on other USG? */
46 #undef FFS /* Some systems define this in param.h. */
50 #include <sys/resource.h>
56 /* #include "c-tree.h" */
59 #include "insn-attr.h"
62 #ifdef XCOFF_DEBUGGING_INFO
70 /* The extra parameters substantially improve the I/O performance. */
72 VMS_fopen (fname, type)
76 if (strcmp (type, "w") == 0)
77 return fopen (fname, type, "mbc=16", "deq=64", "fop=tef", "shr=nil");
78 return fopen (fname, type, "mbc=16");
80 #define fopen VMS_fopen
83 #ifndef DEFAULT_GDB_EXTENSIONS
84 #define DEFAULT_GDB_EXTENSIONS 1
87 extern int rtx_equal_function_value_matters;
89 #if ! (defined (VMS) || defined (OS2))
90 extern char **environ;
92 extern char *version_string, *language_string;
94 /* Carry information from ASM_DECLARE_OBJECT_NAME
95 to ASM_FINISH_DECLARE_OBJECT. */
97 extern int size_directive_output;
98 extern tree last_assemble_variable_decl;
100 extern void init_lex ();
101 extern void init_decl_processing ();
102 extern void init_obstacks ();
103 extern void init_tree_codes ();
104 extern void init_rtl ();
105 extern void init_regs ();
106 extern void init_optabs ();
107 extern void init_stmt ();
108 extern void init_reg_sets ();
109 extern void dump_flow_info ();
110 extern void dump_sched_info ();
111 extern void dump_local_alloc ();
113 void rest_of_decl_compilation ();
114 void error_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
115 void error_with_decl PVPROTO((tree decl, char *s, ...));
116 void error_for_asm PVPROTO((rtx insn, char *s, ...));
117 void error PVPROTO((char *s, ...));
118 void fatal PVPROTO((char *s, ...));
119 void warning_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
120 void warning_with_decl PVPROTO((tree decl, char *s, ...));
121 void warning_for_asm PVPROTO((rtx insn, char *s, ...));
122 void warning PVPROTO((char *s, ...));
123 void pedwarn PVPROTO((char *s, ...));
124 void pedwarn_with_decl PVPROTO((tree decl, char *s, ...));
125 void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
126 void sorry PVPROTO((char *s, ...));
127 void really_sorry PVPROTO((char *s, ...));
132 void set_target_switch ();
133 static void print_switch_values ();
134 static char *decl_name ();
136 /* Name of program invoked, sans directories. */
140 /* Copy of arguments to main. */
144 /* Name of current original source file (what was input to cpp).
145 This comes from each #-command in the actual input. */
147 char *input_filename;
149 /* Name of top-level original source file (what was input to cpp).
150 This comes from the #-command at the beginning of the actual input.
151 If there isn't any there, then this is the cc1 input file name. */
153 char *main_input_filename;
155 /* Stream for reading from the input file. */
159 /* Current line number in real source file. */
163 /* Stack of currently pending input files. */
165 struct file_stack *input_file_stack;
167 /* Incremented on each change to input_file_stack. */
168 int input_file_stack_tick;
170 /* FUNCTION_DECL for function now being parsed or compiled. */
172 extern tree current_function_decl;
174 /* Name to use as base of names for dump output files. */
176 char *dump_base_name;
178 /* Bit flags that specify the machine subtype we are compiling for.
179 Bits are tested using macros TARGET_... defined in the tm.h file
180 and set by `-m...' switches. Must be defined in rtlanal.c. */
182 extern int target_flags;
184 /* Flags saying which kinds of debugging dump have been requested. */
187 int rtl_dump_and_exit = 0;
188 int jump_opt_dump = 0;
193 int combine_dump = 0;
195 int local_reg_dump = 0;
196 int global_reg_dump = 0;
198 int jump2_opt_dump = 0;
199 int dbr_sched_dump = 0;
200 int flag_print_asm_name = 0;
201 int stack_reg_dump = 0;
203 /* Name for output file of assembly code, specified with -o. */
207 /* Value of the -G xx switch, and whether it was passed or not. */
211 /* Type(s) of debugging information we are producing (if any).
212 See flags.h for the definitions of the different possible
213 types of debugging information. */
214 enum debug_info_type write_symbols = NO_DEBUG;
216 /* Level of debugging information we are producing. See flags.h
217 for the definitions of the different possible levels. */
218 enum debug_info_level debug_info_level = DINFO_LEVEL_NONE;
220 /* Nonzero means use GNU-only extensions in the generated symbolic
221 debugging information. */
222 /* Currently, this only has an effect when write_symbols is set to
223 DBX_DEBUG, XCOFF_DEBUG, or DWARF_DEBUG. */
224 int use_gnu_debug_info_extensions = 0;
226 /* Nonzero means do optimizations. -O.
227 Particular numeric values stand for particular amounts of optimization;
228 thus, -O2 stores 2 here. However, the optimizations beyond the basic
229 ones are not controlled directly by this variable. Instead, they are
230 controlled by individual `flag_...' variables that are defaulted
231 based on this variable. */
235 /* Number of error messages and warning messages so far. */
238 int warningcount = 0;
241 /* Flag to output bytecode instead of native assembler */
242 int output_bytecode = 0;
244 /* Pointer to function to compute the name to use to print a declaration. */
246 char *(*decl_printable_name) ();
248 /* Pointer to function to compute rtl for a language-specific tree code. */
250 struct rtx_def *(*lang_expand_expr) ();
252 /* Pointer to function to finish handling an incomplete decl at the
253 end of compilation. */
255 void (*incomplete_decl_finalize_hook) () = 0;
257 /* Nonzero if generating code to do profiling. */
259 int profile_flag = 0;
261 /* Nonzero if generating code to do profiling on a line-by-line basis. */
263 int profile_block_flag;
265 /* Nonzero for -pedantic switch: warn about anything
266 that standard spec forbids. */
270 /* Temporarily suppress certain warnings.
271 This is set while reading code from a system header file. */
273 int in_system_header = 0;
275 /* Nonzero means do stupid register allocation.
276 Currently, this is 1 if `optimize' is 0. */
278 int obey_regdecls = 0;
280 /* Don't print functions as they are compiled and don't print
281 times taken by the various passes. -quiet. */
287 /* Nonzero means `char' should be signed. */
289 int flag_signed_char;
291 /* Nonzero means give an enum type only as many bytes as it needs. */
293 int flag_short_enums;
295 /* Nonzero for -fcaller-saves: allocate values in regs that need to
296 be saved across function calls, if that produces overall better code.
297 Optional now, so people can test it. */
299 #ifdef DEFAULT_CALLER_SAVES
300 int flag_caller_saves = 1;
302 int flag_caller_saves = 0;
305 /* Nonzero if structures and unions should be returned in memory.
307 This should only be defined if compatibility with another compiler or
308 with an ABI is needed, because it results in slower code. */
310 #ifndef DEFAULT_PCC_STRUCT_RETURN
311 #define DEFAULT_PCC_STRUCT_RETURN 1
314 /* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
316 int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
318 /* Nonzero for -fforce-mem: load memory value into a register
319 before arithmetic on it. This makes better cse but slower compilation. */
321 int flag_force_mem = 0;
323 /* Nonzero for -fforce-addr: load memory address into a register before
324 reference to memory. This makes better cse but slower compilation. */
326 int flag_force_addr = 0;
328 /* Nonzero for -fdefer-pop: don't pop args after each function call;
329 instead save them up to pop many calls' args with one insns. */
331 int flag_defer_pop = 0;
333 /* Nonzero for -ffloat-store: don't allocate floats and doubles
334 in extended-precision registers. */
336 int flag_float_store = 0;
338 /* Nonzero for -fcse-follow-jumps:
339 have cse follow jumps to do a more extensive job. */
341 int flag_cse_follow_jumps;
343 /* Nonzero for -fcse-skip-blocks:
344 have cse follow a branch around a block. */
345 int flag_cse_skip_blocks;
347 /* Nonzero for -fexpensive-optimizations:
348 perform miscellaneous relatively-expensive optimizations. */
349 int flag_expensive_optimizations;
351 /* Nonzero for -fthread-jumps:
352 have jump optimize output of loop. */
354 int flag_thread_jumps;
356 /* Nonzero enables strength-reduction in loop.c. */
358 int flag_strength_reduce = 0;
360 /* Nonzero enables loop unrolling in unroll.c. Only loops for which the
361 number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
362 UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
365 int flag_unroll_loops;
367 /* Nonzero enables loop unrolling in unroll.c. All loops are unrolled.
368 This is generally not a win. */
370 int flag_unroll_all_loops;
372 /* Nonzero for -fwritable-strings:
373 store string constants in data segment and don't uniquize them. */
375 int flag_writable_strings = 0;
377 /* Nonzero means don't put addresses of constant functions in registers.
378 Used for compiling the Unix kernel, where strange substitutions are
379 done on the assembly output. */
381 int flag_no_function_cse = 0;
383 /* Nonzero for -fomit-frame-pointer:
384 don't make a frame pointer in simple functions that don't require one. */
386 int flag_omit_frame_pointer = 0;
388 /* Nonzero to inhibit use of define_optimization peephole opts. */
390 int flag_no_peephole = 0;
392 /* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
393 operations in the interest of optimization. For example it allows
394 GCC to assume arguments to sqrt are nonnegative numbers, allowing
395 faster code for sqrt to be generated. */
397 int flag_fast_math = 0;
399 /* Nonzero means all references through pointers are volatile. */
403 /* Nonzero means treat all global and extern variables as global. */
405 int flag_volatile_global;
407 /* Nonzero means just do syntax checking; don't output anything. */
409 int flag_syntax_only = 0;
411 /* Nonzero means to rerun cse after loop optimization. This increases
412 compilation time about 20% and picks up a few more common expressions. */
414 static int flag_rerun_cse_after_loop;
416 /* Nonzero for -finline-functions: ok to inline functions that look like
417 good inline candidates. */
419 int flag_inline_functions;
421 /* Nonzero for -fkeep-inline-functions: even if we make a function
422 go inline everywhere, keep its definition around for debugging
425 int flag_keep_inline_functions;
427 /* Nonzero means that functions declared `inline' will be treated
428 as `static'. Prevents generation of zillions of copies of unused
429 static inline functions; instead, `inlines' are written out
430 only when actually used. Used in conjunction with -g. Also
431 does the right thing with #pragma interface. */
435 /* Nonzero means we should be saving declaration info into a .X file. */
437 int flag_gen_aux_info = 0;
439 /* Specified name of aux-info file. */
441 static char *aux_info_file_name;
443 /* Nonzero means make the text shared if supported. */
445 int flag_shared_data;
447 /* Nonzero means schedule into delayed branch slots if supported. */
449 int flag_delayed_branch;
451 /* Nonzero means to run cleanups after CALL_EXPRs. */
453 int flag_short_temps;
455 /* Nonzero if we are compiling pure (sharable) code.
456 Value is 1 if we are doing reasonable (i.e. simple
457 offset into offset table) pic. Value is 2 if we can
458 only perform register offsets. */
462 /* Nonzero means place uninitialized global data in the bss section. */
466 /* Nonzero means pretend it is OK to examine bits of target floats,
467 even if that isn't true. The resulting code will have incorrect constants,
468 but the same series of instructions that the native compiler would make. */
470 int flag_pretend_float;
472 /* Nonzero means change certain warnings into errors.
473 Usually these are warnings about failure to conform to some standard. */
475 int flag_pedantic_errors = 0;
477 /* flag_schedule_insns means schedule insns within basic blocks (before
479 flag_schedule_insns_after_reload means schedule insns after
482 int flag_schedule_insns = 0;
483 int flag_schedule_insns_after_reload = 0;
485 /* -finhibit-size-directive inhibits output of .size for ELF.
486 This is used only for compiling crtstuff.c,
487 and it may be extended to other effects
488 needed for crtstuff.c on other systems. */
489 int flag_inhibit_size_directive = 0;
491 /* -fverbose-asm causes extra commentary information to be produced in
492 the generated assembly code (to make it more readable). This option
493 is generally only of use to those who actually need to read the
494 generated assembly code (perhaps while debugging the compiler itself). */
496 int flag_verbose_asm = 0;
498 /* -fgnu-linker specifies use of the GNU linker for initializations.
499 (Or, more generally, a linker that handles initializations.)
500 -fno-gnu-linker says that collect2 will be used. */
502 int flag_gnu_linker = 0;
504 int flag_gnu_linker = 1;
507 /* Table of language-independent -f options.
508 STRING is the option name. VARIABLE is the address of the variable.
509 ON_VALUE is the value to store in VARIABLE
510 if `-fSTRING' is seen as an option.
511 (If `-fno-STRING' is seen as an option, the opposite value is stored.) */
513 struct { char *string; int *variable; int on_value;} f_options[] =
515 {"float-store", &flag_float_store, 1},
516 {"volatile", &flag_volatile, 1},
517 {"volatile-global", &flag_volatile_global, 1},
518 {"defer-pop", &flag_defer_pop, 1},
519 {"omit-frame-pointer", &flag_omit_frame_pointer, 1},
520 {"cse-follow-jumps", &flag_cse_follow_jumps, 1},
521 {"cse-skip-blocks", &flag_cse_skip_blocks, 1},
522 {"expensive-optimizations", &flag_expensive_optimizations, 1},
523 {"thread-jumps", &flag_thread_jumps, 1},
524 {"strength-reduce", &flag_strength_reduce, 1},
525 {"unroll-loops", &flag_unroll_loops, 1},
526 {"unroll-all-loops", &flag_unroll_all_loops, 1},
527 {"writable-strings", &flag_writable_strings, 1},
528 {"peephole", &flag_no_peephole, 0},
529 {"force-mem", &flag_force_mem, 1},
530 {"force-addr", &flag_force_addr, 1},
531 {"function-cse", &flag_no_function_cse, 0},
532 {"inline-functions", &flag_inline_functions, 1},
533 {"keep-inline-functions", &flag_keep_inline_functions, 1},
534 {"inline", &flag_no_inline, 0},
535 {"syntax-only", &flag_syntax_only, 1},
536 {"shared-data", &flag_shared_data, 1},
537 {"caller-saves", &flag_caller_saves, 1},
538 {"pcc-struct-return", &flag_pcc_struct_return, 1},
539 {"reg-struct-return", &flag_pcc_struct_return, 0},
540 {"delayed-branch", &flag_delayed_branch, 1},
541 {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
542 {"pretend-float", &flag_pretend_float, 1},
543 {"schedule-insns", &flag_schedule_insns, 1},
544 {"schedule-insns2", &flag_schedule_insns_after_reload, 1},
545 {"pic", &flag_pic, 1},
546 {"PIC", &flag_pic, 2},
547 {"fast-math", &flag_fast_math, 1},
548 {"common", &flag_no_common, 0},
549 {"inhibit-size-directive", &flag_inhibit_size_directive, 1},
550 {"verbose-asm", &flag_verbose_asm, 1},
551 {"gnu-linker", &flag_gnu_linker, 1},
552 {"bytecode", &output_bytecode, 1}
555 /* Table of language-specific options. */
557 char *lang_options[] =
560 "-fallow-single-precision",
562 "-fsigned-bitfields",
563 "-funsigned-bitfields",
564 "-fno-signed-bitfields",
565 "-fno-unsigned-bitfields",
569 "-fno-unsigned-char",
581 "-fno-cond-mismatch",
582 "-fdollars-in-identifiers",
583 "-fno-dollars-in-identifiers",
595 "-Wno-char-subscripts",
609 "-Wno-missing-braces",
610 "-Wmissing-declarations",
611 "-Wno-missing-declarations",
612 "-Wmissing-prototypes",
613 "-Wno-missing-prototypes",
615 "-Wno-nested-externs",
619 "-Wno-pointer-arith",
621 "-Wno-redundant-decls",
622 "-Wstrict-prototypes",
623 "-Wno-strict-prototypes",
629 "-Wno-write-strings",
631 /* These are for C++. */
632 "-+e0", /* gcc.c tacks the `-' on the front. */
637 "-falt-external-templates",
638 "-fno-alt-external-templates",
639 "-fansi-overloading",
640 "-fno-ansi-overloading",
644 "-fno-conserve-space",
646 "-fno-default-inline",
649 "-felide-constructors",
650 "-fno-elide-constructors",
652 "-fno-enum-int-equiv",
653 "-fexternal-templates",
654 "-fno-external-templates",
657 "-fhandle-exceptions",
658 "-fno-handle-exceptions",
659 "-fhandle-signatures",
660 "-fno-handle-signatures",
663 "-fimplement-inlines",
664 "-fno-implement-inlines",
665 "-fimplicit-templates",
666 "-fno-implicit-templates",
670 "-fno-memoize-lookups",
672 "-fno-nonnull-objects",
674 "-fno-save-memoized",
679 "-fstrict-prototype",
680 "-fno-strict-prototype",
681 "-fthis-is-variable",
682 "-fno-this-is-variable",
684 "-fno-vtable-thunks",
690 "-Woverloaded-virtual",
691 "-Wno-overloaded-virtual",
694 "-Wtemplate-debugging",
695 "-Wno-template-debugging",
696 "-Wctor-dtor-privacy",
697 "-Wno-ctor-dtor-privacy",
699 "-Wno-extern-inline",
701 /* these are for obj c */
713 /* This is for GNAT and is temporary. */
718 /* Options controlling warnings */
720 /* Don't print warning messages. -w. */
722 int inhibit_warnings = 0;
724 /* Print various extra warnings. -W. */
726 int extra_warnings = 0;
728 /* Treat warnings as errors. -Werror. */
730 int warnings_are_errors = 0;
732 /* Nonzero to warn about unused local variables. */
736 /* Nonzero to warn about variables used before they are initialized. */
738 int warn_uninitialized;
740 /* Nonzero means warn about all declarations which shadow others. */
744 /* Warn if a switch on an enum fails to have a case for every enum value. */
748 /* Nonzero means warn about function definitions that default the return type
749 or that use a null return and have a return-type other than void. */
751 int warn_return_type;
753 /* Nonzero means warn about pointer casts that increase the required
754 alignment of the target type (and might therefore lead to a crash
755 due to a misaligned access). */
759 /* Nonzero means warn about any identifiers that match in the first N
760 characters. The value N is in `id_clash_len'. */
763 unsigned id_clash_len;
765 /* Nonzero means warn about any objects definitions whose size is larger
766 than N bytes. Also want about function definitions whose returned
767 values are larger than N bytes. The value N is in `larger_than_size'. */
769 int warn_larger_than;
770 unsigned larger_than_size;
772 /* Nonzero means warn if inline function is too large. */
776 /* Warn if a function returns an aggregate,
777 since there are often incompatible calling conventions for doing this. */
779 int warn_aggregate_return;
781 /* Likewise for -W. */
783 struct { char *string; int *variable; int on_value;} W_options[] =
785 {"unused", &warn_unused, 1},
786 {"error", &warnings_are_errors, 1},
787 {"shadow", &warn_shadow, 1},
788 {"switch", &warn_switch, 1},
789 {"aggregate-return", &warn_aggregate_return, 1},
790 {"cast-align", &warn_cast_align, 1},
791 {"uninitialized", &warn_uninitialized, 1},
792 {"inline", &warn_inline, 1}
795 /* Output files for assembler code (real compiler output)
796 and debugging dumps. */
801 FILE *jump_opt_dump_file;
803 FILE *loop_dump_file;
804 FILE *cse2_dump_file;
805 FILE *flow_dump_file;
806 FILE *combine_dump_file;
807 FILE *sched_dump_file;
808 FILE *local_reg_dump_file;
809 FILE *global_reg_dump_file;
810 FILE *sched2_dump_file;
811 FILE *jump2_opt_dump_file;
812 FILE *dbr_sched_dump_file;
813 FILE *stack_reg_dump_file;
815 /* Time accumulators, to count the total time spent in various passes. */
819 int integration_time;
827 int local_alloc_time;
828 int global_alloc_time;
831 int shorten_branch_time;
837 /* Return time used so far, in microseconds. */
846 struct rusage rusage;
851 int proc_system_time;
853 int child_system_time;
863 return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
866 getrusage (0, &rusage);
867 return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
868 + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
871 return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
876 #define TIMEVAR(VAR, BODY) \
877 do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
880 print_time (str, total)
885 "time in %s: %d.%06d\n",
886 str, total / 1000000, total % 1000000);
889 /* Count an error or warning. Return 1 if the message should be printed. */
892 count_error (warningp)
895 if (warningp && inhibit_warnings)
898 if (warningp && !warnings_are_errors)
902 static int warning_message = 0;
904 if (warningp && !warning_message)
906 fprintf (stderr, "%s: warnings being treated as errors\n", progname);
915 /* Print a fatal error message. NAME is the text.
916 Also include a system error message based on `errno'. */
919 pfatal_with_name (name)
922 fprintf (stderr, "%s: ", progname);
928 fatal_io_error (name)
931 fprintf (stderr, "%s: %s: I/O error\n", progname, name);
935 /* Called to give a better error message when we don't have an insn to match
936 what we are looking for or if the insn's constraints aren't satisfied,
937 rather than just calling abort(). */
940 fatal_insn_not_found (insn)
943 if (!output_bytecode)
945 if (INSN_CODE (insn) < 0)
946 error ("internal error--unrecognizable insn:");
948 error ("internal error--insn does not satisfy its constraints:");
952 fflush (asm_out_file);
954 fflush (aux_info_file);
956 fflush (rtl_dump_file);
957 if (jump_opt_dump_file)
958 fflush (jump_opt_dump_file);
960 fflush (cse_dump_file);
962 fflush (loop_dump_file);
964 fflush (cse2_dump_file);
966 fflush (flow_dump_file);
967 if (combine_dump_file)
968 fflush (combine_dump_file);
970 fflush (sched_dump_file);
971 if (local_reg_dump_file)
972 fflush (local_reg_dump_file);
973 if (global_reg_dump_file)
974 fflush (global_reg_dump_file);
975 if (sched2_dump_file)
976 fflush (sched2_dump_file);
977 if (jump2_opt_dump_file)
978 fflush (jump2_opt_dump_file);
979 if (dbr_sched_dump_file)
980 fflush (dbr_sched_dump_file);
981 if (stack_reg_dump_file)
982 fflush (stack_reg_dump_file);
986 /* This is the default decl_printable_name function. */
989 decl_name (decl, kind)
993 return IDENTIFIER_POINTER (DECL_NAME (decl));
996 static int need_error_newline;
998 /* Function of last error message;
999 more generally, function such that if next error message is in it
1000 then we don't have to mention the function name. */
1001 static tree last_error_function = NULL;
1003 /* Used to detect when input_file_stack has changed since last described. */
1004 static int last_error_tick;
1006 /* Called when the start of a function definition is parsed,
1007 this function prints on stderr the name of the function. */
1010 announce_function (decl)
1016 if (rtl_dump_and_exit)
1017 fprintf (stderr, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
1019 fprintf (stderr, " %s", (*decl_printable_name) (decl, &junk));
1021 need_error_newline = 1;
1022 last_error_function = current_function_decl;
1026 /* Prints out, if necessary, the name of the current function
1027 which caused an error. Called from all error and warning functions. */
1030 report_error_function (file)
1033 struct file_stack *p;
1035 if (need_error_newline)
1037 fprintf (stderr, "\n");
1038 need_error_newline = 0;
1041 if (last_error_function != current_function_decl)
1043 char *kind = "function";
1044 if (current_function_decl != 0
1045 && TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
1049 fprintf (stderr, "%s: ", file);
1051 if (current_function_decl == NULL)
1052 fprintf (stderr, "At top level:\n");
1055 char *name = (*decl_printable_name) (current_function_decl, &kind);
1056 fprintf (stderr, "In %s `%s':\n", kind, name);
1059 last_error_function = current_function_decl;
1061 if (input_file_stack && input_file_stack->next != 0
1062 && input_file_stack_tick != last_error_tick)
1064 fprintf (stderr, "In file included");
1065 for (p = input_file_stack->next; p; p = p->next)
1067 fprintf (stderr, " from %s:%d", p->name, p->line);
1069 fprintf (stderr, ",\n ");
1071 fprintf (stderr, ":\n");
1072 last_error_tick = input_file_stack_tick;
1076 /* Print a message. */
1079 vmessage (prefix, s, ap)
1085 fprintf (stderr, "%s: ", prefix);
1088 vfprintf (stderr, s, ap);
1091 HOST_WIDE_INT v1 = va_arg(ap, HOST_WIDE_INT);
1092 HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT);
1093 HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT);
1094 fprintf (stderr, s, v1, v2, v3);
1099 /* Print a message relevant to line LINE of file FILE. */
1102 v_message_with_file_and_line (file, line, prefix, s, ap)
1110 fprintf (stderr, "%s:%d: ", file, line);
1112 fprintf (stderr, "%s: ", progname);
1114 vmessage (prefix, s, ap);
1115 fputc ('\n', stderr);
1118 /* Print a message relevant to the given DECL. */
1121 v_message_with_decl (decl, prefix, s, ap)
1129 fprintf (stderr, "%s:%d: ",
1130 DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
1133 fprintf (stderr, "%s: ", prefix);
1135 /* Do magic to get around lack of varargs support for insertion
1136 of arguments into existing list. We know that the decl is first;
1137 we ass_u_me that it will be printed with "%s". */
1139 for (p = s; *p; ++p)
1143 if (*(p + 1) == '%')
1151 fwrite (s, p - s, 1, stderr);
1155 char *n = (DECL_NAME (decl)
1156 ? (*decl_printable_name) (decl, &junk)
1162 if (isalpha (*(p - 1) & 0xFF))
1168 vmessage ((char *)NULL, p, ap);
1170 fputc ('\n', stderr);
1173 /* Figure file and line of the given INSN. */
1176 file_and_line_for_asm (insn, pfile, pline)
1181 rtx body = PATTERN (insn);
1184 /* Find the (or one of the) ASM_OPERANDS in the insn. */
1185 if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
1186 asmop = SET_SRC (body);
1187 else if (GET_CODE (body) == ASM_OPERANDS)
1189 else if (GET_CODE (body) == PARALLEL
1190 && GET_CODE (XVECEXP (body, 0, 0)) == SET)
1191 asmop = SET_SRC (XVECEXP (body, 0, 0));
1192 else if (GET_CODE (body) == PARALLEL
1193 && GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
1194 asmop = XVECEXP (body, 0, 0);
1200 *pfile = ASM_OPERANDS_SOURCE_FILE (asmop);
1201 *pline = ASM_OPERANDS_SOURCE_LINE (asmop);
1205 *pfile = input_filename;
1210 /* Report an error at line LINE of file FILE. */
1213 v_error_with_file_and_line (file, line, s, ap)
1220 report_error_function (file);
1221 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1225 error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1237 file = va_arg (ap, char *);
1238 line = va_arg (ap, int);
1239 s = va_arg (ap, char *);
1242 v_error_with_file_and_line (file, line, s, ap);
1246 /* Report an error at the declaration DECL.
1247 S is a format string which uses %s to substitute the declaration
1248 name; subsequent substitutions are a la printf. */
1251 v_error_with_decl (decl, s, ap)
1257 report_error_function (DECL_SOURCE_FILE (decl));
1258 v_message_with_decl (decl, (char *)NULL, s, ap);
1262 error_with_decl VPROTO((tree decl, char *s, ...))
1273 decl = va_arg (ap, tree);
1274 s = va_arg (ap, char *);
1277 v_error_with_decl (decl, s, ap);
1281 /* Report an error at the line number of the insn INSN.
1282 This is used only when INSN is an `asm' with operands,
1283 and each ASM_OPERANDS records its own source file and line. */
1286 v_error_for_asm (insn, s, ap)
1295 file_and_line_for_asm (insn, &file, &line);
1296 report_error_function (file);
1297 v_message_with_file_and_line (file, line, (char *)NULL, s, ap);
1301 error_for_asm VPROTO((rtx insn, char *s, ...))
1312 insn = va_arg (ap, rtx);
1313 s = va_arg (ap, char *);
1316 v_error_for_asm (insn, s, ap);
1320 /* Report an error at the current line number. */
1327 v_error_with_file_and_line (input_filename, lineno, s, ap);
1331 error VPROTO((char *s, ...))
1341 s = va_arg (ap, char *);
1348 /* Report a fatal error at the current line number. */
1360 fatal VPROTO((char *s, ...))
1370 s = va_arg (ap, char *);
1377 /* Report a warning at line LINE of file FILE. */
1380 v_warning_with_file_and_line (file, line, s, ap)
1386 if (count_error (1))
1388 report_error_function (file);
1389 v_message_with_file_and_line (file, line, "warning", s, ap);
1394 warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1406 file = va_arg (ap, char *);
1407 line = va_arg (ap, int);
1408 s = va_arg (ap, char *);
1411 v_warning_with_file_and_line (file, line, s, ap);
1415 /* Report a warning at the declaration DECL.
1416 S is a format string which uses %s to substitute the declaration
1417 name; subsequent substitutions are a la printf. */
1420 v_warning_with_decl (decl, s, ap)
1425 if (count_error (1))
1427 report_error_function (DECL_SOURCE_FILE (decl));
1428 v_message_with_decl (decl, "warning", s, ap);
1433 warning_with_decl VPROTO((tree decl, char *s, ...))
1444 decl = va_arg (ap, tree);
1445 s = va_arg (ap, char *);
1448 v_warning_with_decl (decl, s, ap);
1452 /* Report a warning at the line number of the insn INSN.
1453 This is used only when INSN is an `asm' with operands,
1454 and each ASM_OPERANDS records its own source file and line. */
1457 v_warning_for_asm (insn, s, ap)
1462 if (count_error (1))
1467 file_and_line_for_asm (insn, &file, &line);
1468 report_error_function (file);
1469 v_message_with_file_and_line (file, line, "warning", s, ap);
1474 warning_for_asm VPROTO((rtx insn, char *s, ...))
1485 insn = va_arg (ap, rtx);
1486 s = va_arg (ap, char *);
1489 v_warning_for_asm (insn, s, ap);
1493 /* Report a warning at the current line number. */
1500 v_warning_with_file_and_line (input_filename, lineno, s, ap);
1504 warning VPROTO((char *s, ...))
1514 s = va_arg (ap, char *);
1521 /* These functions issue either warnings or errors depending on
1522 -pedantic-errors. */
1529 if (flag_pedantic_errors)
1536 pedwarn VPROTO((char *s, ...))
1546 s = va_arg (ap, char *);
1554 v_pedwarn_with_decl (decl, s, ap)
1559 /* We don't want -pedantic-errors to cause the compilation to fail from
1560 "errors" in system header files. Sometimes fixincludes can't fix what's
1561 broken (eg: unsigned char bitfields - fixing it may change the alignment
1562 which will cause programs to mysteriously fail because the C library
1563 or kernel uses the original layout). There's no point in issuing a
1564 warning either, it's just unnecessary noise. */
1566 if (! DECL_IN_SYSTEM_HEADER (decl))
1568 if (flag_pedantic_errors)
1569 v_error_with_decl (decl, s, ap);
1571 v_warning_with_decl (decl, s, ap);
1576 pedwarn_with_decl VPROTO((tree decl, char *s, ...))
1587 decl = va_arg (ap, tree);
1588 s = va_arg (ap, char *);
1591 v_pedwarn_with_decl (decl, s, ap);
1596 v_pedwarn_with_file_and_line (file, line, s, ap)
1602 if (flag_pedantic_errors)
1603 v_error_with_file_and_line (file, line, s, ap);
1605 v_warning_with_file_and_line (file, line, s, ap);
1609 pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
1621 file = va_arg (ap, char *);
1622 line = va_arg (ap, int);
1623 s = va_arg (ap, char *);
1626 v_pedwarn_with_file_and_line (file, line, s, ap);
1630 /* Apologize for not implementing some feature. */
1639 fprintf (stderr, "%s:%d: ", input_filename, lineno);
1641 fprintf (stderr, "%s: ", progname);
1642 vmessage ("sorry, not implemented", s, ap);
1643 fputc ('\n', stderr);
1647 sorry VPROTO((char *s, ...))
1657 s = va_arg (ap, char *);
1664 /* Apologize for not implementing some feature, then quit. */
1667 v_really_sorry (s, ap)
1673 fprintf (stderr, "%s:%d: ", input_filename, lineno);
1675 fprintf (stderr, "%s: ", progname);
1676 vmessage ("sorry, not implemented", s, ap);
1677 fatal (" (fatal)\n");
1681 really_sorry VPROTO((char *s, ...))
1691 s = va_arg (ap, char *);
1694 v_really_sorry (s, ap);
1698 /* More 'friendly' abort that prints the line and file.
1699 config.h can #define abort fancy_abort if you like that sort of thing.
1701 I don't think this is actually a good idea.
1702 Other sorts of crashes will look a certain way.
1703 It is a good thing if crashes from calling abort look the same way.
1709 fatal ("internal gcc abort");
1712 /* This calls abort and is used to avoid problems when abort if a macro.
1713 It is used when we need to pass the address of abort. */
1721 /* When `malloc.c' is compiled with `rcheck' defined,
1722 it calls this function to report clobberage. */
1730 /* Same as `malloc' but report error if no memory available. */
1736 register char *value = (char *) malloc (size);
1738 fatal ("virtual memory exhausted");
1742 /* Same as `realloc' but report error if no memory available. */
1745 xrealloc (ptr, size)
1749 char *result = (char *) realloc (ptr, size);
1751 fatal ("virtual memory exhausted");
1755 /* Return the logarithm of X, base 2, considering X unsigned,
1756 if X is a power of 2. Otherwise, returns -1.
1758 This should be used via the `exact_log2' macro. */
1762 register unsigned HOST_WIDE_INT x;
1764 register int log = 0;
1765 /* Test for 0 or a power of 2. */
1766 if (x == 0 || x != (x & -x))
1768 while ((x >>= 1) != 0)
1773 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
1774 If X is 0, return -1.
1776 This should be used via the floor_log2 macro. */
1780 register unsigned HOST_WIDE_INT x;
1782 register int log = -1;
1790 jmp_buf float_handler;
1792 /* Specify where to longjmp to when a floating arithmetic error happens.
1793 If HANDLER is 0, it means don't handle the errors any more. */
1796 set_float_handler (handler)
1799 float_handled = (handler != 0);
1801 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
1804 /* Specify, in HANDLER, where to longjmp to when a floating arithmetic
1805 error happens, pushing the previous specification into OLD_HANDLER.
1806 Return an indication of whether there was a previous handler in effect. */
1809 push_float_handler (handler, old_handler)
1810 jmp_buf handler, old_handler;
1812 int was_handled = float_handled;
1816 bcopy ((char *) float_handler, (char *) old_handler,
1817 sizeof (float_handler));
1819 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
1823 /* Restore the previous specification of whether and where to longjmp to
1824 when a floating arithmetic error happens. */
1827 pop_float_handler (handled, handler)
1831 float_handled = handled;
1833 bcopy ((char *) handler, (char *) float_handler, sizeof (float_handler));
1836 /* Signals actually come here. */
1839 float_signal (signo)
1840 /* If this is missing, some compilers complain. */
1843 if (float_handled == 0)
1845 #if defined (USG) || defined (hpux)
1846 signal (SIGFPE, float_signal); /* re-enable the signal catcher */
1849 signal (SIGFPE, float_signal);
1850 longjmp (float_handler, 1);
1853 /* Handler for SIGPIPE. */
1857 /* If this is missing, some compilers complain. */
1860 fatal ("output pipe has been closed");
1863 /* Strip off a legitimate source ending from the input string NAME of
1867 strip_off_ending (name, len)
1871 if (len > 2 && ! strcmp (".c", name + len - 2))
1873 else if (len > 2 && ! strcmp (".m", name + len - 2))
1875 else if (len > 2 && ! strcmp (".i", name + len - 2))
1877 else if (len > 3 && ! strcmp (".ii", name + len - 3))
1879 else if (len > 3 && ! strcmp (".co", name + len - 3))
1881 else if (len > 3 && ! strcmp (".cc", name + len - 3))
1883 else if (len > 2 && ! strcmp (".C", name + len - 2))
1885 else if (len > 4 && ! strcmp (".cxx", name + len - 4))
1887 else if (len > 4 && ! strcmp (".cpp", name + len - 4))
1889 else if (len > 2 && ! strcmp (".f", name + len - 2))
1891 /* Ada will use extensions like .ada, .adb, and .ads, so just test
1893 else if (len > 4 && ! strncmp (".ad", name + len - 4, 3))
1895 else if (len > 4 && ! strcmp (".atr", name + len - 4))
1899 /* Output a quoted string. */
1901 output_quoted_string (asm_file, string)
1907 putc ('\"', asm_file);
1908 while ((c = *string++) != 0)
1910 if (c == '\"' || c == '\\')
1911 putc ('\\', asm_file);
1914 putc ('\"', asm_file);
1917 /* Output a file name in the form wanted by System V. */
1920 output_file_directive (asm_file, input_name)
1924 int len = strlen (input_name);
1925 char *na = input_name + len;
1927 /* NA gets INPUT_NAME sans directory names. */
1928 while (na > input_name)
1935 #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
1936 ASM_OUTPUT_MAIN_SOURCE_FILENAME (asm_file, na);
1938 #ifdef ASM_OUTPUT_SOURCE_FILENAME
1939 ASM_OUTPUT_SOURCE_FILENAME (asm_file, na);
1941 fprintf (asm_file, "\t.file\t");
1942 output_quoted_string (asm_file, na);
1943 fputc ('\n', asm_file);
1948 /* Routine to build language identifier for object file. */
1950 output_lang_identify (asm_out_file)
1953 int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
1954 char *s = (char *) alloca (len);
1955 sprintf (s, "__gnu_compiled_%s", lang_identify ());
1956 ASM_OUTPUT_LABEL (asm_out_file, s);
1959 /* Routine to open a dump file. */
1961 open_dump_file (base_name, suffix)
1966 char *dumpname = (char *) alloca (strlen (base_name) + strlen (suffix) + 1);
1968 strcpy (dumpname, base_name);
1969 strcat (dumpname, suffix);
1970 f = fopen (dumpname, "w");
1972 pfatal_with_name (dumpname);
1976 /* Compile an entire file of output from cpp, named NAME.
1977 Write a file of assembly output and various debugging dumps. */
1986 int name_specified = name != 0;
1988 if (dump_base_name == 0)
1989 dump_base_name = name ? name : "gccdump";
1993 integration_time = 0;
2001 local_alloc_time = 0;
2002 global_alloc_time = 0;
2005 shorten_branch_time = 0;
2011 /* Open input file. */
2013 if (name == 0 || !strcmp (name, "-"))
2019 finput = fopen (name, "r");
2021 pfatal_with_name (name);
2023 #ifdef IO_BUFFER_SIZE
2024 setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
2027 /* Initialize data in various passes. */
2032 /* Some of these really don't need to be called when generating bytecode,
2033 but the options would have to be parsed first to know that. -bson */
2035 init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
2036 || debug_info_level == DINFO_LEVEL_VERBOSE);
2038 init_decl_processing ();
2046 if (flag_caller_saves)
2047 init_caller_save ();
2049 /* If auxiliary info generation is desired, open the output file.
2050 This goes in the same directory as the source file--unlike
2051 all the other output files. */
2052 if (flag_gen_aux_info)
2054 aux_info_file = fopen (aux_info_file_name, "w");
2055 if (aux_info_file == 0)
2056 pfatal_with_name (aux_info_file_name);
2059 /* If rtl dump desired, open the output file. */
2061 rtl_dump_file = open_dump_file (dump_base_name, ".rtl");
2063 /* If jump_opt dump desired, open the output file. */
2065 jump_opt_dump_file = open_dump_file (dump_base_name, ".jump");
2067 /* If cse dump desired, open the output file. */
2069 cse_dump_file = open_dump_file (dump_base_name, ".cse");
2071 /* If loop dump desired, open the output file. */
2073 loop_dump_file = open_dump_file (dump_base_name, ".loop");
2075 /* If cse2 dump desired, open the output file. */
2077 cse2_dump_file = open_dump_file (dump_base_name, ".cse2");
2079 /* If flow dump desired, open the output file. */
2081 flow_dump_file = open_dump_file (dump_base_name, ".flow");
2083 /* If combine dump desired, open the output file. */
2085 combine_dump_file = open_dump_file (dump_base_name, ".combine");
2087 /* If scheduling dump desired, open the output file. */
2089 sched_dump_file = open_dump_file (dump_base_name, ".sched");
2091 /* If local_reg dump desired, open the output file. */
2093 local_reg_dump_file = open_dump_file (dump_base_name, ".lreg");
2095 /* If global_reg dump desired, open the output file. */
2096 if (global_reg_dump)
2097 global_reg_dump_file = open_dump_file (dump_base_name, ".greg");
2099 /* If 2nd scheduling dump desired, open the output file. */
2101 sched2_dump_file = open_dump_file (dump_base_name, ".sched2");
2103 /* If jump2_opt dump desired, open the output file. */
2105 jump2_opt_dump_file = open_dump_file (dump_base_name, ".jump2");
2107 /* If dbr_sched dump desired, open the output file. */
2109 dbr_sched_dump_file = open_dump_file (dump_base_name, ".dbr");
2113 /* If stack_reg dump desired, open the output file. */
2115 stack_reg_dump_file = open_dump_file (dump_base_name, ".stack");
2119 /* Open assembler code output file. */
2121 if (! name_specified && asm_file_name == 0)
2122 asm_out_file = stdout;
2125 int len = strlen (dump_base_name);
2126 register char *dumpname = (char *) xmalloc (len + 6);
2127 strcpy (dumpname, dump_base_name);
2128 strip_off_ending (dumpname, len);
2129 strcat (dumpname, ".s");
2130 if (asm_file_name == 0)
2132 asm_file_name = (char *) xmalloc (strlen (dumpname) + 1);
2133 strcpy (asm_file_name, dumpname);
2135 if (!strcmp (asm_file_name, "-"))
2136 asm_out_file = stdout;
2138 asm_out_file = fopen (asm_file_name, "w");
2139 if (asm_out_file == 0)
2140 pfatal_with_name (asm_file_name);
2143 #ifdef IO_BUFFER_SIZE
2144 setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
2145 _IOFBF, IO_BUFFER_SIZE);
2148 input_filename = name;
2150 /* Perform language-specific initialization.
2151 This may set main_input_filename. */
2154 /* If the input doesn't start with a #line, use the input name
2155 as the official input file name. */
2156 if (main_input_filename == 0)
2157 main_input_filename = name;
2159 /* Put an entry on the input file stack for the main input file. */
2161 = (struct file_stack *) xmalloc (sizeof (struct file_stack));
2162 input_file_stack->next = 0;
2163 input_file_stack->name = input_filename;
2165 if (!output_bytecode)
2167 ASM_FILE_START (asm_out_file);
2170 /* Output something to inform GDB that this compilation was by GCC. Also
2171 serves to tell GDB file consists of bytecodes. */
2172 if (output_bytecode)
2173 fprintf (asm_out_file, "bc_gcc2_compiled.:\n");
2176 #ifndef ASM_IDENTIFY_GCC
2177 fprintf (asm_out_file, "gcc2_compiled.:\n");
2179 ASM_IDENTIFY_GCC (asm_out_file);
2183 /* Output something to identify which front-end produced this file. */
2184 #ifdef ASM_IDENTIFY_LANGUAGE
2185 ASM_IDENTIFY_LANGUAGE (asm_out_file);
2188 if (output_bytecode)
2190 if (profile_flag || profile_block_flag)
2191 error ("profiling not supported in bytecode compilation");
2195 /* ??? Note: There used to be a conditional here
2196 to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
2197 This was to guarantee separation between gcc_compiled. and
2198 the first function, for the sake of dbx on Suns.
2199 However, having the extra zero here confused the Emacs
2200 code for unexec, and might confuse other programs too.
2201 Therefore, I took out that change.
2202 In future versions we should find another way to solve
2203 that dbx problem. -- rms, 23 May 93. */
2205 /* Don't let the first function fall at the same address
2206 as gcc_compiled., if profiling. */
2207 if (profile_flag || profile_block_flag)
2208 assemble_zeros (UNITS_PER_WORD);
2211 /* If dbx symbol table desired, initialize writing it
2212 and output the predefined types. */
2213 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2214 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2215 TIMEVAR (symout_time, dbxout_init (asm_out_file, main_input_filename,
2218 #ifdef SDB_DEBUGGING_INFO
2219 if (write_symbols == SDB_DEBUG)
2220 TIMEVAR (symout_time, sdbout_init (asm_out_file, main_input_filename,
2223 #ifdef DWARF_DEBUGGING_INFO
2224 if (write_symbols == DWARF_DEBUG)
2225 TIMEVAR (symout_time, dwarfout_init (asm_out_file, main_input_filename));
2228 /* Initialize yet another pass. */
2230 if (!output_bytecode)
2231 init_final (main_input_filename);
2233 start_time = get_run_time ();
2235 /* Call the parser, which parses the entire file
2236 (calling rest_of_compilation for each function). */
2238 if (yyparse () != 0)
2240 if (errorcount == 0)
2241 fprintf (stderr, "Errors detected in input file (your bison.simple is out of date)");
2243 /* In case there were missing closebraces,
2244 get us back to the global binding level. */
2245 while (! global_bindings_p ())
2249 /* Compilation is now finished except for writing
2250 what's left of the symbol table output. */
2252 parse_time += get_run_time () - start_time;
2254 parse_time -= integration_time;
2255 parse_time -= varconst_time;
2257 globals = getdecls ();
2259 /* Really define vars that have had only a tentative definition.
2260 Really output inline functions that must actually be callable
2261 and have not been output so far. */
2264 int len = list_length (globals);
2265 tree *vec = (tree *) alloca (sizeof (tree) * len);
2269 /* Process the decls in reverse order--earliest first.
2270 Put them into VEC from back to front, then take out from front. */
2272 for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
2273 vec[len - i - 1] = decl;
2275 for (i = 0; i < len; i++)
2279 /* We're not deferring this any longer. */
2280 DECL_DEFER_OUTPUT (decl) = 0;
2282 if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0
2283 && incomplete_decl_finalize_hook != 0)
2284 (*incomplete_decl_finalize_hook) (decl);
2286 if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
2287 && ! TREE_ASM_WRITTEN (decl))
2289 /* Don't write out static consts, unless we still need them.
2291 We also keep static consts if not optimizing (for debugging).
2292 ??? They might be better written into the debug information.
2293 This is possible when using DWARF.
2295 A language processor that wants static constants to be always
2296 written out (even if it is not used) is responsible for
2297 calling rest_of_decl_compilation itself. E.g. the C front-end
2298 calls rest_of_decl_compilation from finish_decl.
2299 One motivation for this is that is conventional in some
2300 environments to write things like:
2301 static const char rcsid[] = "... version string ...";
2302 intending to force the string to be in the executable.
2304 A language processor that would prefer to have unneeded
2305 static constants "optimized away" would just defer writing
2306 them out until here. E.g. C++ does this, because static
2307 constants are often defined in header files.
2309 ??? A tempting alternative (for both C and C++) would be
2310 to force a constant to be written if and only if it is
2311 defined in a main file, as opposed to an include file. */
2313 if (! TREE_READONLY (decl)
2314 || TREE_PUBLIC (decl)
2316 || TREE_ADDRESSABLE (decl)
2317 || TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl)))
2318 rest_of_decl_compilation (decl, NULL_PTR, 1, 1);
2320 /* Cancel the RTL for this decl so that, if debugging info
2321 output for global variables is still to come,
2322 this one will be omitted. */
2323 DECL_RTL (decl) = NULL;
2326 if (TREE_CODE (decl) == FUNCTION_DECL
2327 && ! TREE_ASM_WRITTEN (decl)
2328 && DECL_INITIAL (decl) != 0
2329 && DECL_SAVED_INSNS (decl) != 0
2330 && (TREE_ADDRESSABLE (decl)
2331 || flag_keep_inline_functions
2332 || TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl)))
2333 && ! DECL_EXTERNAL (decl))
2335 temporary_allocation ();
2336 output_inline_function (decl);
2337 permanent_allocation (1);
2340 /* Warn about any function
2341 declared static but not defined.
2342 We don't warn about variables,
2343 because many programs have static variables
2344 that exist only to get some text into the object file. */
2347 || (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl))))
2348 && TREE_CODE (decl) == FUNCTION_DECL
2349 && DECL_INITIAL (decl) == 0
2350 && DECL_EXTERNAL (decl)
2351 && ! TREE_PUBLIC (decl))
2353 /* This should be a pedwarn, except that there is
2354 no easy way to prevent it from happening when the
2355 name is used only inside a sizeof.
2356 This at least avoids being incorrect. */
2357 warning_with_decl (decl,
2358 "`%s' declared `static' but never defined");
2359 /* This symbol is effectively an "extern" declaration now. */
2360 TREE_PUBLIC (decl) = 1;
2361 assemble_external (decl);
2364 /* Warn about static fns or vars defined but not used,
2365 but not about inline functions or static consts
2366 since defining those in header files is normal practice. */
2368 && ((TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
2369 || (TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
2370 && ! DECL_IN_SYSTEM_HEADER (decl)
2371 && ! DECL_EXTERNAL (decl)
2372 && ! TREE_PUBLIC (decl)
2373 && ! TREE_USED (decl)
2374 && ! DECL_REGISTER (decl)
2375 /* The TREE_USED bit for file-scope decls
2376 is kept in the identifier, to handle multiple
2377 external decls in different scopes. */
2378 && ! TREE_USED (DECL_NAME (decl)))
2379 warning_with_decl (decl, "`%s' defined but not used");
2381 #ifdef SDB_DEBUGGING_INFO
2382 /* The COFF linker can move initialized global vars to the end.
2383 And that can screw up the symbol ordering.
2384 By putting the symbols in that order to begin with,
2385 we avoid a problem. mcsun!unido!fauern!tumuc!pes@uunet.uu.net. */
2386 if (write_symbols == SDB_DEBUG && TREE_CODE (decl) == VAR_DECL
2387 && TREE_PUBLIC (decl) && DECL_INITIAL (decl)
2388 && ! DECL_EXTERNAL (decl)
2389 && DECL_RTL (decl) != 0)
2390 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
2392 /* Output COFF information for non-global
2393 file-scope initialized variables. */
2394 if (write_symbols == SDB_DEBUG
2395 && TREE_CODE (decl) == VAR_DECL
2396 && DECL_INITIAL (decl)
2397 && ! DECL_EXTERNAL (decl)
2398 && DECL_RTL (decl) != 0
2399 && GET_CODE (DECL_RTL (decl)) == MEM)
2400 TIMEVAR (symout_time, sdbout_toplevel_data (decl));
2401 #endif /* SDB_DEBUGGING_INFO */
2402 #ifdef DWARF_DEBUGGING_INFO
2403 /* Output DWARF information for file-scope tentative data object
2404 declarations, file-scope (extern) function declarations (which
2405 had no corresponding body) and file-scope tagged type declarations
2406 and definitions which have not yet been forced out. */
2408 if (write_symbols == DWARF_DEBUG
2409 && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
2410 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 1));
2415 /* Do dbx symbols */
2416 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2417 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2418 TIMEVAR (symout_time,
2420 dbxout_finish (asm_out_file, main_input_filename);
2424 #ifdef DWARF_DEBUGGING_INFO
2425 if (write_symbols == DWARF_DEBUG)
2426 TIMEVAR (symout_time,
2432 /* Output some stuff at end of file if nec. */
2434 if (!output_bytecode)
2436 end_final (main_input_filename);
2439 ASM_FILE_END (asm_out_file);
2443 /* Language-specific end of compilation actions. */
2447 if (output_bytecode)
2448 bc_write_file (asm_out_file);
2450 /* Close the dump files. */
2452 if (flag_gen_aux_info)
2454 fclose (aux_info_file);
2456 unlink (aux_info_file_name);
2460 fclose (rtl_dump_file);
2463 fclose (jump_opt_dump_file);
2466 fclose (cse_dump_file);
2469 fclose (loop_dump_file);
2472 fclose (cse2_dump_file);
2475 fclose (flow_dump_file);
2479 dump_combine_total_stats (combine_dump_file);
2480 fclose (combine_dump_file);
2484 fclose (sched_dump_file);
2487 fclose (local_reg_dump_file);
2489 if (global_reg_dump)
2490 fclose (global_reg_dump_file);
2493 fclose (sched2_dump_file);
2496 fclose (jump2_opt_dump_file);
2499 fclose (dbr_sched_dump_file);
2503 fclose (stack_reg_dump_file);
2506 /* Close non-debugging input and output files. Take special care to note
2507 whether fclose returns an error, since the pages might still be on the
2508 buffer chain while the file is open. */
2511 if (ferror (asm_out_file) != 0 || fclose (asm_out_file) != 0)
2512 fatal_io_error (asm_file_name);
2514 /* Print the times. */
2518 fprintf (stderr,"\n");
2519 print_time ("parse", parse_time);
2521 if (!output_bytecode)
2523 print_time ("integration", integration_time);
2524 print_time ("jump", jump_time);
2525 print_time ("cse", cse_time);
2526 print_time ("loop", loop_time);
2527 print_time ("cse2", cse2_time);
2528 print_time ("flow", flow_time);
2529 print_time ("combine", combine_time);
2530 print_time ("sched", sched_time);
2531 print_time ("local-alloc", local_alloc_time);
2532 print_time ("global-alloc", global_alloc_time);
2533 print_time ("sched2", sched2_time);
2534 print_time ("dbranch", dbr_sched_time);
2535 print_time ("shorten-branch", shorten_branch_time);
2536 print_time ("stack-reg", stack_reg_time);
2537 print_time ("final", final_time);
2538 print_time ("varconst", varconst_time);
2539 print_time ("symout", symout_time);
2540 print_time ("dump", dump_time);
2545 /* This is called from various places for FUNCTION_DECL, VAR_DECL,
2546 and TYPE_DECL nodes.
2548 This does nothing for local (non-static) variables.
2549 Otherwise, it sets up the RTL and outputs any assembler code
2550 (label definition, storage allocation and initialization).
2552 DECL is the declaration. If ASMSPEC is nonzero, it specifies
2553 the assembler symbol name to be used. TOP_LEVEL is nonzero
2554 if this declaration is not within a function. */
2557 rest_of_decl_compilation (decl, asmspec, top_level, at_end)
2563 /* Declarations of variables, and of functions defined elsewhere. */
2565 /* The most obvious approach, to put an #ifndef around where
2566 this macro is used, doesn't work since it's inside a macro call. */
2567 #ifndef ASM_FINISH_DECLARE_OBJECT
2568 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP, END)
2571 /* Forward declarations for nested functions are not "external",
2572 but we need to treat them as if they were. */
2573 if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
2574 || TREE_CODE (decl) == FUNCTION_DECL)
2575 TIMEVAR (varconst_time,
2577 make_decl_rtl (decl, asmspec, top_level);
2578 /* Initialized extern variable exists to be replaced
2579 with its value, or represents something that will be
2580 output in another file. */
2581 if (! (TREE_CODE (decl) == VAR_DECL
2582 && DECL_EXTERNAL (decl) && TREE_READONLY (decl)
2583 && DECL_INITIAL (decl) != 0
2584 && DECL_INITIAL (decl) != error_mark_node))
2585 /* Don't output anything
2586 when a tentative file-scope definition is seen.
2587 But at end of compilation, do output code for them. */
2588 if (! (! at_end && top_level
2589 && (DECL_INITIAL (decl) == 0
2590 || DECL_INITIAL (decl) == error_mark_node)))
2591 assemble_variable (decl, top_level, at_end, 0);
2592 if (decl == last_assemble_variable_decl)
2594 ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
2598 else if (DECL_REGISTER (decl) && asmspec != 0)
2600 if (decode_reg_name (asmspec) >= 0)
2602 DECL_RTL (decl) = 0;
2603 make_decl_rtl (decl, asmspec, top_level);
2606 error ("invalid register name `%s' for register variable", asmspec);
2608 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2609 else if ((write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2610 && TREE_CODE (decl) == TYPE_DECL)
2611 TIMEVAR (symout_time, dbxout_symbol (decl, 0));
2613 #ifdef SDB_DEBUGGING_INFO
2614 else if (write_symbols == SDB_DEBUG && top_level
2615 && TREE_CODE (decl) == TYPE_DECL)
2616 TIMEVAR (symout_time, sdbout_symbol (decl, 0));
2620 /* Called after finishing a record, union or enumeral type. */
2623 rest_of_type_compilation (type, toplev)
2627 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
2628 if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
2629 TIMEVAR (symout_time, dbxout_symbol (TYPE_STUB_DECL (type), !toplev));
2631 #ifdef SDB_DEBUGGING_INFO
2632 if (write_symbols == SDB_DEBUG)
2633 TIMEVAR (symout_time, sdbout_symbol (TYPE_STUB_DECL (type), !toplev));
2637 /* This is called from finish_function (within yyparse)
2638 after each top-level definition is parsed.
2639 It is supposed to compile that function or variable
2640 and output the assembler code for it.
2641 After we return, the tree storage is freed. */
2644 rest_of_compilation (decl)
2648 int start_time = get_run_time ();
2650 /* Nonzero if we have saved the original DECL_INITIAL of the function,
2651 to be restored after we finish compiling the function
2652 (for use when compiling inline calls to this function). */
2653 tree saved_block_tree = 0;
2654 /* Likewise, for DECL_ARGUMENTS. */
2655 tree saved_arguments = 0;
2658 if (output_bytecode)
2661 /* If we are reconsidering an inline function
2662 at the end of compilation, skip the stuff for making it inline. */
2664 if (DECL_SAVED_INSNS (decl) == 0)
2666 int specd = DECL_INLINE (decl);
2669 /* If requested, consider whether to make this function inline. */
2670 if (specd || flag_inline_functions)
2671 TIMEVAR (integration_time,
2673 lose = function_cannot_inline_p (decl);
2674 /* If not optimzing, then make sure the DECL_INLINE
2676 if (lose || ! optimize)
2678 if (warn_inline && specd)
2679 warning_with_decl (decl, lose);
2680 DECL_INLINE (decl) = 0;
2681 /* Don't really compile an extern inline function.
2682 If we can't make it inline, pretend
2683 it was only declared. */
2684 if (DECL_EXTERNAL (decl))
2686 DECL_INITIAL (decl) = 0;
2687 goto exit_rest_of_compilation;
2691 DECL_INLINE (decl) = 1;
2694 insns = get_insns ();
2696 /* Dump the rtl code if we are dumping rtl. */
2701 fprintf (rtl_dump_file, "\n;; Function %s\n\n",
2702 IDENTIFIER_POINTER (DECL_NAME (decl)));
2703 if (DECL_SAVED_INSNS (decl))
2704 fprintf (rtl_dump_file, ";; (integrable)\n\n");
2705 print_rtl (rtl_dump_file, insns);
2706 fflush (rtl_dump_file);
2709 /* If function is inline, and we don't yet know whether to
2710 compile it by itself, defer decision till end of compilation.
2711 finish_compilation will call rest_of_compilation again
2712 for those functions that need to be output. Also defer those
2713 functions that were marked inline but weren't inlined; they
2714 may never be used. */
2716 if ((specd || DECL_INLINE (decl))
2717 && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
2718 && ! flag_keep_inline_functions)
2719 || DECL_DEFER_OUTPUT (decl)
2720 || DECL_EXTERNAL (decl)))
2722 #ifdef DWARF_DEBUGGING_INFO
2723 /* Generate the DWARF info for the "abstract" instance
2724 of a function which we may later generate inlined and/or
2725 out-of-line instances of. */
2726 if (write_symbols == DWARF_DEBUG)
2728 set_decl_abstract_flags (decl, 1);
2729 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
2730 set_decl_abstract_flags (decl, 0);
2733 TIMEVAR (integration_time, save_for_inline_nocopy (decl));
2734 goto exit_rest_of_compilation;
2737 /* If we have to compile the function now, save its rtl and subdecls
2738 so that its compilation will not affect what others get. */
2739 if (DECL_INLINE (decl))
2741 #ifdef DWARF_DEBUGGING_INFO
2742 /* Generate the DWARF info for the "abstract" instance of
2743 a function which we will generate an out-of-line instance
2744 of almost immediately (and which we may also later generate
2745 various inlined instances of). */
2746 if (write_symbols == DWARF_DEBUG)
2748 set_decl_abstract_flags (decl, 1);
2749 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
2750 set_decl_abstract_flags (decl, 0);
2753 saved_block_tree = DECL_INITIAL (decl);
2754 saved_arguments = DECL_ARGUMENTS (decl);
2755 TIMEVAR (integration_time, save_for_inline_copying (decl));
2759 if (DECL_DEFER_OUTPUT (decl))
2760 goto exit_rest_of_compilation;
2762 TREE_ASM_WRITTEN (decl) = 1;
2764 /* Now that integrate will no longer see our rtl, we need not distinguish
2765 between the return value of this function and the return value of called
2767 rtx_equal_function_value_matters = 0;
2769 /* Don't return yet if -Wreturn-type; we need to do jump_optimize. */
2770 if ((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
2772 goto exit_rest_of_compilation;
2775 /* From now on, allocate rtl in current_obstack, not in saveable_obstack.
2776 Note that that may have been done above, in save_for_inline_copying.
2777 The call to resume_temporary_allocation near the end of this function
2778 goes back to the usual state of affairs. */
2780 rtl_in_current_obstack ();
2783 /* If we are doing position-independent code generation, now
2784 is the time to output special prologues and epilogues.
2785 We do not want to do this earlier, because it just clutters
2786 up inline functions with meaningless insns. */
2791 insns = get_insns ();
2793 /* Copy any shared structure that should not be shared. */
2795 unshare_all_rtl (insns);
2797 /* Instantiate all virtual registers. */
2799 instantiate_virtual_regs (current_function_decl, get_insns ());
2801 /* See if we have allocated stack slots that are not directly addressable.
2802 If so, scan all the insns and create explicit address computation
2803 for all references to such slots. */
2804 /* fixup_stack_slots (); */
2806 /* Do jump optimization the first time, if -opt.
2807 Also do it if -W, but in that case it doesn't change the rtl code,
2808 it only computes whether control can drop off the end of the function. */
2810 if (optimize > 0 || extra_warnings || warn_return_type
2811 /* If function is `noreturn', we should warn if it tries to return. */
2812 || TREE_THIS_VOLATILE (decl))
2814 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
2815 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
2818 /* Now is when we stop if -fsyntax-only and -Wreturn-type. */
2819 if (rtl_dump_and_exit || flag_syntax_only)
2820 goto exit_rest_of_compilation;
2822 /* Dump rtl code after jump, if we are doing that. */
2827 fprintf (jump_opt_dump_file, "\n;; Function %s\n\n",
2828 IDENTIFIER_POINTER (DECL_NAME (decl)));
2829 print_rtl (jump_opt_dump_file, insns);
2830 fflush (jump_opt_dump_file);
2833 /* Perform common subexpression elimination.
2834 Nonzero value from `cse_main' means that jumps were simplified
2835 and some code may now be unreachable, so do
2836 jump optimization again. */
2841 fprintf (cse_dump_file, "\n;; Function %s\n\n",
2842 IDENTIFIER_POINTER (DECL_NAME (decl)));
2847 TIMEVAR (cse_time, reg_scan (insns, max_reg_num (), 1));
2849 if (flag_thread_jumps)
2850 /* Hacks by tiemann & kenner. */
2851 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 1));
2853 TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (),
2855 TIMEVAR (cse_time, delete_dead_from_cse (insns, max_reg_num ()));
2858 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0));
2861 /* Dump rtl code after cse, if we are doing that. */
2866 print_rtl (cse_dump_file, insns);
2867 fflush (cse_dump_file);
2873 fprintf (loop_dump_file, "\n;; Function %s\n\n",
2874 IDENTIFIER_POINTER (DECL_NAME (decl)));
2877 /* Move constant computations out of loops. */
2883 loop_optimize (insns, loop_dump_file);
2887 /* Dump rtl code after loop opt, if we are doing that. */
2892 print_rtl (loop_dump_file, insns);
2893 fflush (loop_dump_file);
2899 fprintf (cse2_dump_file, "\n;; Function %s\n\n",
2900 IDENTIFIER_POINTER (DECL_NAME (decl)));
2903 if (optimize > 0 && flag_rerun_cse_after_loop)
2905 /* Running another jump optimization pass before the second
2906 cse pass sometimes simplifies the RTL enough to allow
2907 the second CSE pass to do a better job. Jump_optimize can change
2908 max_reg_num so we must rerun reg_scan afterwards.
2909 ??? Rework to not call reg_scan so often. */
2910 TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
2911 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
2913 TIMEVAR (cse2_time, reg_scan (insns, max_reg_num (), 0));
2914 TIMEVAR (cse2_time, tem = cse_main (insns, max_reg_num (),
2915 1, cse2_dump_file));
2917 TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0));
2920 if (optimize > 0 && flag_thread_jumps)
2921 /* This pass of jump threading straightens out code
2922 that was kinked by loop optimization. */
2923 TIMEVAR (jump_time, thread_jumps (insns, max_reg_num (), 0));
2925 /* Dump rtl code after cse, if we are doing that. */
2930 print_rtl (cse2_dump_file, insns);
2931 fflush (cse2_dump_file);
2934 /* We are no longer anticipating cse in this function, at least. */
2936 cse_not_expected = 1;
2938 /* Now we choose between stupid (pcc-like) register allocation
2939 (if we got the -noreg switch and not -opt)
2940 and smart register allocation. */
2942 if (optimize > 0) /* Stupid allocation probably won't work */
2943 obey_regdecls = 0; /* if optimizations being done. */
2947 /* Print function header into flow dump now
2948 because doing the flow analysis makes some of the dump. */
2953 fprintf (flow_dump_file, "\n;; Function %s\n\n",
2954 IDENTIFIER_POINTER (DECL_NAME (decl)));
2961 regclass (insns, max_reg_num ());
2962 stupid_life_analysis (insns, max_reg_num (),
2968 /* Do control and data flow analysis,
2969 and write some of the results to dump file. */
2971 TIMEVAR (flow_time, flow_analysis (insns, max_reg_num (),
2973 if (warn_uninitialized)
2975 uninitialized_vars_warning (DECL_INITIAL (decl));
2976 setjmp_args_warning ();
2980 /* Dump rtl after flow analysis. */
2985 print_rtl (flow_dump_file, insns);
2986 fflush (flow_dump_file);
2989 /* If -opt, try combining insns through substitution. */
2992 TIMEVAR (combine_time, combine_instructions (insns, max_reg_num ()));
2994 /* Dump rtl code after insn combination. */
2999 fprintf (combine_dump_file, "\n;; Function %s\n\n",
3000 IDENTIFIER_POINTER (DECL_NAME (decl)));
3001 dump_combine_stats (combine_dump_file);
3002 print_rtl (combine_dump_file, insns);
3003 fflush (combine_dump_file);
3006 /* Print function header into sched dump now
3007 because doing the sched analysis makes some of the dump. */
3012 fprintf (sched_dump_file, "\n;; Function %s\n\n",
3013 IDENTIFIER_POINTER (DECL_NAME (decl)));
3016 if (optimize > 0 && flag_schedule_insns)
3018 /* Do control and data sched analysis,
3019 and write some of the results to dump file. */
3021 TIMEVAR (sched_time, schedule_insns (sched_dump_file));
3024 /* Dump rtl after instruction scheduling. */
3029 print_rtl (sched_dump_file, insns);
3030 fflush (sched_dump_file);
3033 /* Unless we did stupid register allocation,
3034 allocate pseudo-regs that are used only within 1 basic block. */
3037 TIMEVAR (local_alloc_time,
3039 regclass (insns, max_reg_num ());
3043 /* Dump rtl code after allocating regs within basic blocks. */
3048 fprintf (local_reg_dump_file, "\n;; Function %s\n\n",
3049 IDENTIFIER_POINTER (DECL_NAME (decl)));
3050 dump_flow_info (local_reg_dump_file);
3051 dump_local_alloc (local_reg_dump_file);
3052 print_rtl (local_reg_dump_file, insns);
3053 fflush (local_reg_dump_file);
3056 if (global_reg_dump)
3058 fprintf (global_reg_dump_file, "\n;; Function %s\n\n",
3059 IDENTIFIER_POINTER (DECL_NAME (decl))));
3061 /* Unless we did stupid register allocation,
3062 allocate remaining pseudo-regs, then do the reload pass
3063 fixing up any insns that are invalid. */
3065 TIMEVAR (global_alloc_time,
3068 failure = global_alloc (global_reg_dump_file);
3070 failure = reload (insns, 0, global_reg_dump_file);
3073 if (global_reg_dump)
3076 dump_global_regs (global_reg_dump_file);
3077 print_rtl (global_reg_dump_file, insns);
3078 fflush (global_reg_dump_file);
3082 goto exit_rest_of_compilation;
3084 reload_completed = 1;
3086 /* On some machines, the prologue and epilogue code, or parts thereof,
3087 can be represented as RTL. Doing so lets us schedule insns between
3088 it and the rest of the code and also allows delayed branch
3089 scheduling to operate in the epilogue. */
3091 thread_prologue_and_epilogue_insns (insns);
3093 if (optimize > 0 && flag_schedule_insns_after_reload)
3098 fprintf (sched2_dump_file, "\n;; Function %s\n\n",
3099 IDENTIFIER_POINTER (DECL_NAME (decl)));
3102 /* Do control and data sched analysis again,
3103 and write some more of the results to dump file. */
3105 TIMEVAR (sched2_time, schedule_insns (sched2_dump_file));
3107 /* Dump rtl after post-reorder instruction scheduling. */
3112 print_rtl (sched2_dump_file, insns);
3113 fflush (sched2_dump_file);
3117 #ifdef LEAF_REGISTERS
3119 if (optimize > 0 && only_leaf_regs_used () && leaf_function_p ())
3123 /* One more attempt to remove jumps to .+1
3124 left by dead-store-elimination.
3125 Also do cross-jumping this time
3126 and delete no-op move insns. */
3130 TIMEVAR (jump_time, jump_optimize (insns, 1, 1, 0));
3133 /* Dump rtl code after jump, if we are doing that. */
3138 fprintf (jump2_opt_dump_file, "\n;; Function %s\n\n",
3139 IDENTIFIER_POINTER (DECL_NAME (decl)));
3140 print_rtl (jump2_opt_dump_file, insns);
3141 fflush (jump2_opt_dump_file);
3144 /* If a machine dependent reorganization is needed, call it. */
3145 #ifdef MACHINE_DEPENDENT_REORG
3146 MACHINE_DEPENDENT_REORG (insns);
3149 /* If a scheduling pass for delayed branches is to be done,
3150 call the scheduling code. */
3153 if (optimize > 0 && flag_delayed_branch)
3155 TIMEVAR (dbr_sched_time, dbr_schedule (insns, dbr_sched_dump_file));
3160 fprintf (dbr_sched_dump_file, "\n;; Function %s\n\n",
3161 IDENTIFIER_POINTER (DECL_NAME (decl)));
3162 print_rtl (dbr_sched_dump_file, insns);
3163 fflush (dbr_sched_dump_file);
3170 /* Shorten branches. */
3171 TIMEVAR (shorten_branch_time,
3173 shorten_branches (get_insns ());
3177 TIMEVAR (stack_reg_time, reg_to_stack (insns, stack_reg_dump_file));
3182 fprintf (stack_reg_dump_file, "\n;; Function %s\n\n",
3183 IDENTIFIER_POINTER (DECL_NAME (decl)));
3184 print_rtl (stack_reg_dump_file, insns);
3185 fflush (stack_reg_dump_file);
3190 /* Now turn the rtl into assembler code. */
3192 TIMEVAR (final_time,
3197 /* Get the function's name, as described by its RTL.
3198 This may be different from the DECL_NAME name used
3199 in the source file. */
3201 x = DECL_RTL (decl);
3202 if (GET_CODE (x) != MEM)
3205 if (GET_CODE (x) != SYMBOL_REF)
3207 fnname = XSTR (x, 0);
3209 assemble_start_function (decl, fnname);
3210 final_start_function (insns, asm_out_file, optimize);
3211 final (insns, asm_out_file, optimize, 0);
3212 final_end_function (insns, asm_out_file, optimize);
3213 assemble_end_function (decl, fnname);
3214 fflush (asm_out_file);
3217 /* Write DBX symbols if requested */
3219 /* Note that for those inline functions where we don't initially
3220 know for certain that we will be generating an out-of-line copy,
3221 the first invocation of this routine (rest_of_compilation) will
3222 skip over this code by doing a `goto exit_rest_of_compilation;'.
3223 Later on, finish_compilation will call rest_of_compilation again
3224 for those inline functions that need to have out-of-line copies
3225 generated. During that call, we *will* be routed past here. */
3227 #ifdef DBX_DEBUGGING_INFO
3228 if (write_symbols == DBX_DEBUG)
3229 TIMEVAR (symout_time, dbxout_function (decl));
3232 #ifdef DWARF_DEBUGGING_INFO
3233 if (write_symbols == DWARF_DEBUG)
3234 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
3237 exit_rest_of_compilation:
3239 /* In case the function was not output,
3240 don't leave any temporary anonymous types
3241 queued up for sdb output. */
3242 #ifdef SDB_DEBUGGING_INFO
3243 if (write_symbols == SDB_DEBUG)
3244 sdbout_types (NULL_TREE);
3247 /* Put back the tree of subblocks and list of arguments
3248 from before we copied them.
3249 Code generation and the output of debugging info may have modified
3250 the copy, but the original is unchanged. */
3252 if (saved_block_tree != 0)
3253 DECL_INITIAL (decl) = saved_block_tree;
3254 if (saved_arguments != 0)
3255 DECL_ARGUMENTS (decl) = saved_arguments;
3257 reload_completed = 0;
3259 /* Clear out the real_constant_chain before some of the rtx's
3260 it runs through become garbage. */
3262 clear_const_double_mem ();
3264 /* Cancel the effect of rtl_in_current_obstack. */
3266 resume_temporary_allocation ();
3268 /* The parsing time is all the time spent in yyparse
3269 *except* what is spent in this function. */
3271 parse_time -= get_run_time () - start_time;
3274 /* Entry point of cc1/c++. Decode command args, then call compile_file.
3275 Exit code is 35 if can't open files, 34 if fatal error,
3276 33 if had nonfatal errors, else success. */
3279 main (argc, argv, envp)
3286 int flag_print_mem = 0;
3287 int version_flag = 0;
3290 /* save in case md file wants to emit args as a comment. */
3294 p = argv[0] + strlen (argv[0]);
3295 while (p != argv[0] && p[-1] != '/') --p;
3299 /* Get rid of any avoidable limit on stack size. */
3303 /* Set the stack limit huge so that alloca does not fail. */
3304 getrlimit (RLIMIT_STACK, &rlim);
3305 rlim.rlim_cur = rlim.rlim_max;
3306 setrlimit (RLIMIT_STACK, &rlim);
3308 #endif /* RLIMIT_STACK */
3310 signal (SIGFPE, float_signal);
3313 signal (SIGPIPE, pipe_closed);
3316 decl_printable_name = decl_name;
3317 lang_expand_expr = (struct rtx_def *(*)()) do_abort;
3319 /* Initialize whether `char' is signed. */
3320 flag_signed_char = DEFAULT_SIGNED_CHAR;
3321 #ifdef DEFAULT_SHORT_ENUMS
3322 /* Initialize how much space enums occupy, by default. */
3323 flag_short_enums = DEFAULT_SHORT_ENUMS;
3326 /* Scan to see what optimization level has been specified. That will
3327 determine the default value of many flags. */
3328 for (i = 1; i < argc; i++)
3330 if (!strcmp (argv[i], "-O"))
3334 else if (argv[i][0] == '-' && argv[i][1] == 'O')
3336 /* Handle -O2, -O3, -O69, ... */
3337 char *p = &argv[i][2];
3341 if (! (c >= '0' && c <= '9'))
3344 optimize = atoi (&argv[i][2]);
3348 obey_regdecls = (optimize == 0);
3358 flag_thread_jumps = 1;
3360 flag_delayed_branch = 1;
3362 #ifdef CAN_DEBUG_WITHOUT_FP
3363 flag_omit_frame_pointer = 1;
3369 flag_cse_follow_jumps = 1;
3370 flag_cse_skip_blocks = 1;
3371 flag_expensive_optimizations = 1;
3372 flag_strength_reduce = 1;
3373 flag_rerun_cse_after_loop = 1;
3374 flag_caller_saves = 1;
3375 #ifdef INSN_SCHEDULING
3376 flag_schedule_insns = 1;
3377 flag_schedule_insns_after_reload = 1;
3383 flag_inline_functions = 1;
3386 #ifdef OPTIMIZATION_OPTIONS
3387 /* Allow default optimizations to be specified on a per-machine basis. */
3388 OPTIMIZATION_OPTIONS (optimize);
3391 /* Initialize register usage now so switches may override. */
3395 set_target_switch ("");
3397 for (i = 1; i < argc; i++)
3400 /* If this is a language-specific option,
3401 decode it in a language-specific way. */
3402 for (j = 0; lang_options[j] != 0; j++)
3403 if (!strncmp (argv[i], lang_options[j],
3404 strlen (lang_options[j])))
3406 if (lang_options[j] != 0)
3407 /* If the option is valid for *some* language,
3408 treat it as valid even if this language doesn't understand it. */
3409 lang_decode_option (argv[i]);
3410 else if (argv[i][0] == '-' && argv[i][1] != 0)
3412 register char *str = argv[i] + 1;
3417 set_target_switch (&str[1]);
3418 else if (!strcmp (str, "dumpbase"))
3420 dump_base_name = argv[++i];
3422 else if (str[0] == 'd')
3424 register char *p = &str[1];
3432 global_reg_dump = 1;
3438 cse_dump = 1, cse2_dump = 1;
3456 global_reg_dump = 1;
3474 flag_print_asm_name = 1;
3496 rtl_dump_and_exit = 1;
3500 else if (str[0] == 'f')
3502 register char *p = &str[1];
3505 /* Some kind of -f option.
3506 P's value is the option sans `-f'.
3507 Search for it in the table of options. */
3510 !found && j < sizeof (f_options) / sizeof (f_options[0]);
3513 if (!strcmp (p, f_options[j].string))
3515 *f_options[j].variable = f_options[j].on_value;
3516 /* A goto here would be cleaner,
3517 but breaks the vax pcc. */
3520 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
3521 && ! strcmp (p+3, f_options[j].string))
3523 *f_options[j].variable = ! f_options[j].on_value;
3530 else if (!strncmp (p, "fixed-", 6))
3531 fix_register (&p[6], 1, 1);
3532 else if (!strncmp (p, "call-used-", 10))
3533 fix_register (&p[10], 0, 1);
3534 else if (!strncmp (p, "call-saved-", 11))
3535 fix_register (&p[11], 0, 0);
3537 error ("Invalid option `%s'", argv[i]);
3539 else if (str[0] == 'O')
3541 register char *p = str+1;
3542 while (*p && *p >= '0' && *p <= '9')
3547 error ("Invalid option `%s'", argv[i]);
3549 else if (!strcmp (str, "pedantic"))
3551 else if (!strcmp (str, "pedantic-errors"))
3552 flag_pedantic_errors = pedantic = 1;
3553 else if (!strcmp (str, "quiet"))
3555 else if (!strcmp (str, "version"))
3557 else if (!strcmp (str, "w"))
3558 inhibit_warnings = 1;
3559 else if (!strcmp (str, "W"))
3562 /* We save the value of warn_uninitialized, since if they put
3563 -Wuninitialized on the command line, we need to generate a
3564 warning about not using it without also specifying -O. */
3565 if (warn_uninitialized != 1)
3566 warn_uninitialized = 2;
3568 else if (str[0] == 'W')
3570 register char *p = &str[1];
3573 /* Some kind of -W option.
3574 P's value is the option sans `-W'.
3575 Search for it in the table of options. */
3578 !found && j < sizeof (W_options) / sizeof (W_options[0]);
3581 if (!strcmp (p, W_options[j].string))
3583 *W_options[j].variable = W_options[j].on_value;
3584 /* A goto here would be cleaner,
3585 but breaks the vax pcc. */
3588 if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
3589 && ! strcmp (p+3, W_options[j].string))
3591 *W_options[j].variable = ! W_options[j].on_value;
3598 else if (!strncmp (p, "id-clash-", 9))
3604 if (*endp >= '0' && *endp <= '9')
3608 error ("Invalid option `%s'", argv[i]);
3613 id_clash_len = atoi (str + 10);
3616 else if (!strncmp (p, "larger-than-", 12))
3618 char *endp = p + 12;
3622 if (*endp >= '0' && *endp <= '9')
3626 error ("Invalid option `%s'", argv[i]);
3627 goto larger_than_lose;
3630 warn_larger_than = 1;
3631 larger_than_size = atoi (str + 13);
3635 error ("Invalid option `%s'", argv[i]);
3637 else if (!strcmp (str, "p"))
3639 if (!output_bytecode)
3642 error ("profiling not supported in bytecode compilation");
3644 else if (!strcmp (str, "a"))
3646 #if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
3647 warning ("`-a' option (basic block profile) not supported");
3649 profile_block_flag = 1;
3652 else if (str[0] == 'g')
3659 while (*p && (*p < '0' || *p > '9'))
3663 while (*q && (*q >= '0' && *q <= '9'))
3668 level = 2; /* default debugging info level */
3669 if (*q || level > 3)
3671 warning ("invalid debug level specification in option: `-%s'",
3673 warning ("no debugging information will be generated");
3677 /* If more than one debugging type is supported,
3678 you must define PREFERRED_DEBUGGING_TYPE
3679 to choose a format in a system-dependent way. */
3680 /* This is one long line cause VAXC can't handle a \-newline. */
3681 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
3682 #ifdef PREFERRED_DEBUGGING_TYPE
3683 if (!strncmp (str, "ggdb", len))
3684 write_symbols = PREFERRED_DEBUGGING_TYPE;
3685 #else /* no PREFERRED_DEBUGGING_TYPE */
3686 You Lose! You must define PREFERRED_DEBUGGING_TYPE!
3687 #endif /* no PREFERRED_DEBUGGING_TYPE */
3688 #endif /* More than one debugger format enabled. */
3689 #ifdef DBX_DEBUGGING_INFO
3690 if (write_symbols != NO_DEBUG)
3692 else if (!strncmp (str, "ggdb", len))
3693 write_symbols = DBX_DEBUG;
3694 else if (!strncmp (str, "gstabs", len))
3695 write_symbols = DBX_DEBUG;
3696 else if (!strncmp (str, "gstabs+", len))
3697 write_symbols = DBX_DEBUG;
3699 /* Always enable extensions for -ggdb or -gstabs+,
3700 always disable for -gstabs.
3701 For plain -g, use system-specific default. */
3702 if (write_symbols == DBX_DEBUG && !strncmp (str, "ggdb", len)
3704 use_gnu_debug_info_extensions = 1;
3705 else if (write_symbols == DBX_DEBUG && !strncmp (str, "gstabs+", len)
3707 use_gnu_debug_info_extensions = 1;
3708 else if (write_symbols == DBX_DEBUG
3709 && !strncmp (str, "gstabs", len) && len >= 2)
3710 use_gnu_debug_info_extensions = 0;
3712 use_gnu_debug_info_extensions = DEFAULT_GDB_EXTENSIONS;
3713 #endif /* DBX_DEBUGGING_INFO */
3714 #ifdef DWARF_DEBUGGING_INFO
3715 if (write_symbols != NO_DEBUG)
3717 else if (!strncmp (str, "g", len))
3718 write_symbols = DWARF_DEBUG;
3719 else if (!strncmp (str, "ggdb", len))
3720 write_symbols = DWARF_DEBUG;
3721 else if (!strncmp (str, "gdwarf", len))
3722 write_symbols = DWARF_DEBUG;
3724 /* Always enable extensions for -ggdb or -gdwarf+,
3725 always disable for -gdwarf.
3726 For plain -g, use system-specific default. */
3727 if (write_symbols == DWARF_DEBUG && !strncmp (str, "ggdb", len)
3729 use_gnu_debug_info_extensions = 1;
3730 else if (write_symbols == DWARF_DEBUG && !strcmp (str, "gdwarf+"))
3731 use_gnu_debug_info_extensions = 1;
3732 else if (write_symbols == DWARF_DEBUG
3733 && !strncmp (str, "gdwarf", len) && len >= 2)
3734 use_gnu_debug_info_extensions = 0;
3736 use_gnu_debug_info_extensions = DEFAULT_GDB_EXTENSIONS;
3738 #ifdef SDB_DEBUGGING_INFO
3739 if (write_symbols != NO_DEBUG)
3741 else if (!strncmp (str, "g", len))
3742 write_symbols = SDB_DEBUG;
3743 else if (!strncmp (str, "gdb", len))
3744 write_symbols = SDB_DEBUG;
3745 else if (!strncmp (str, "gcoff", len))
3746 write_symbols = SDB_DEBUG;
3747 #endif /* SDB_DEBUGGING_INFO */
3748 #ifdef XCOFF_DEBUGGING_INFO
3749 if (write_symbols != NO_DEBUG)
3751 else if (!strncmp (str, "g", len))
3752 write_symbols = XCOFF_DEBUG;
3753 else if (!strncmp (str, "ggdb", len))
3754 write_symbols = XCOFF_DEBUG;
3755 else if (!strncmp (str, "gxcoff", len))
3756 write_symbols = XCOFF_DEBUG;
3758 /* Always enable extensions for -ggdb or -gxcoff+,
3759 always disable for -gxcoff.
3760 For plain -g, use system-specific default. */
3761 if (write_symbols == XCOFF_DEBUG && !strncmp (str, "ggdb", len)
3763 use_gnu_debug_info_extensions = 1;
3764 else if (write_symbols == XCOFF_DEBUG && !strcmp (str, "gxcoff+"))
3765 use_gnu_debug_info_extensions = 1;
3766 else if (write_symbols == XCOFF_DEBUG
3767 && !strncmp (str, "gxcoff", len) && len >= 2)
3768 use_gnu_debug_info_extensions = 0;
3770 use_gnu_debug_info_extensions = DEFAULT_GDB_EXTENSIONS;
3772 if (write_symbols == NO_DEBUG)
3773 warning ("`-%s' option not supported on this version of GCC", str);
3774 else if (level == 0)
3775 write_symbols = NO_DEBUG;
3777 debug_info_level = (enum debug_info_level) level;
3779 else if (!strcmp (str, "o"))
3781 asm_file_name = argv[++i];
3783 else if (str[0] == 'G')
3785 g_switch_set = TRUE;
3786 g_switch_value = atoi ((str[1] != '\0') ? str+1 : argv[++i]);
3788 else if (!strncmp (str, "aux-info", 8))
3790 flag_gen_aux_info = 1;
3791 aux_info_file_name = (str[8] != '\0' ? str+8 : argv[++i]);
3794 error ("Invalid option `%s'", argv[i]);
3796 else if (argv[i][0] == '+')
3797 error ("Invalid option `%s'", argv[i]);
3802 /* Initialize for bytecode output. A good idea to do this as soon as
3803 possible after the "-f" options have been parsed. */
3804 if (output_bytecode)
3806 #ifndef TARGET_SUPPORTS_BYTECODE
3807 /* Just die with a fatal error if not supported */
3808 fatal ("-fbytecode not supporter for this target");
3816 /* Inlining does not work if not optimizing,
3817 so force it not to be done. */
3821 /* The c_decode_option and lang_decode_option functions set
3822 this to `2' if -Wall is used, so we can avoid giving out
3823 lots of errors for people who don't realize what -Wall does. */
3824 if (warn_uninitialized == 1)
3825 warning ("-Wuninitialized is not supported without -O");
3828 #if defined(DWARF_DEBUGGING_INFO)
3829 if (write_symbols == DWARF_DEBUG
3830 && strcmp (language_string, "GNU C++") == 0)
3832 warning ("-g option not supported for C++ on SVR4 systems");
3833 write_symbols = NO_DEBUG;
3835 #endif /* defined(DWARF_DEBUGGING_INFO) */
3837 #ifdef OVERRIDE_OPTIONS
3838 /* Some machines may reject certain combinations of options. */
3842 /* Unrolling all loops implies that standard loop unrolling must also
3844 if (flag_unroll_all_loops)
3845 flag_unroll_loops = 1;
3846 /* Loop unrolling requires that strength_reduction be on also. Silently
3847 turn on strength reduction here if it isn't already on. Also, the loop
3848 unrolling code assumes that cse will be run after loop, so that must
3849 be turned on also. */
3850 if (flag_unroll_loops)
3852 flag_strength_reduce = 1;
3853 flag_rerun_cse_after_loop = 1;
3856 /* Warn about options that are not supported on this machine. */
3857 #ifndef INSN_SCHEDULING
3858 if (flag_schedule_insns || flag_schedule_insns_after_reload)
3859 warning ("instruction scheduling not supported on this target machine");
3862 if (flag_delayed_branch)
3863 warning ("this target machine does not have delayed branches");
3866 /* If we are in verbose mode, write out the version and maybe all the
3867 option flags in use. */
3870 fprintf (stderr, "%s version %s", language_string, version_string);
3871 #ifdef TARGET_VERSION
3876 #define __VERSION__ "[unknown]"
3878 fprintf (stderr, " compiled by GNU C version %s.\n", __VERSION__);
3880 fprintf (stderr, " compiled by CC.\n");
3883 print_switch_values ();
3886 compile_file (filename);
3895 char *lim = (char *) sbrk (0);
3897 fprintf (stderr, "Data size %d.\n",
3898 lim - (char *) &environ);
3902 system ("ps -l 1>&2");
3905 #endif /* not USG */
3907 #endif /* not VMS */
3908 #endif /* not OS2 */
3911 exit (FATAL_EXIT_CODE);
3913 exit (FATAL_EXIT_CODE);
3914 exit (SUCCESS_EXIT_CODE);
3918 /* Decode -m switches. */
3920 /* Here is a table, controlled by the tm.h file, listing each -m switch
3921 and which bits in `target_switches' it should set or clear.
3922 If VALUE is positive, it is bits to set.
3923 If VALUE is negative, -VALUE is bits to clear.
3924 (The sign bit is not used so there is no confusion.) */
3926 struct {char *name; int value;} target_switches []
3929 /* This table is similar, but allows the switch to have a value. */
3931 #ifdef TARGET_OPTIONS
3932 struct {char *prefix; char ** variable;} target_options []
3936 /* Decode the switch -mNAME. */
3939 set_target_switch (name)
3945 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
3946 if (!strcmp (target_switches[j].name, name))
3948 if (target_switches[j].value < 0)
3949 target_flags &= ~-target_switches[j].value;
3951 target_flags |= target_switches[j].value;
3955 #ifdef TARGET_OPTIONS
3957 for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
3959 int len = strlen (target_options[j].prefix);
3960 if (!strncmp (target_options[j].prefix, name, len))
3962 *target_options[j].variable = name + len;
3969 error ("Invalid option `%s'", name);
3972 /* Variable used for communication between the following two routines. */
3974 static int line_position;
3976 /* Print an option value and adjust the position in the line. */
3979 print_single_switch (type, name)
3982 fprintf (stderr, " %s%s", type, name);
3984 line_position += strlen (type) + strlen (name) + 1;
3986 if (line_position > 65)
3988 fprintf (stderr, "\n\t");
3993 /* Print default target switches for -version. */
3996 print_switch_values ()
4000 fprintf (stderr, "enabled:");
4003 for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++)
4004 if (*f_options[j].variable == f_options[j].on_value)
4005 print_single_switch ("-f", f_options[j].string);
4007 for (j = 0; j < sizeof W_options / sizeof W_options[0]; j++)
4008 if (*W_options[j].variable == W_options[j].on_value)
4009 print_single_switch ("-W", W_options[j].string);
4011 for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
4012 if (target_switches[j].name[0] != '\0'
4013 && target_switches[j].value > 0
4014 && ((target_switches[j].value & target_flags)
4015 == target_switches[j].value))
4016 print_single_switch ("-m", target_switches[j].name);
4018 fprintf (stderr, "\n");