OSDN Git Service

e02c3de6c26d2d711d984ee91ef0e743b82eb305
[pf3gnuchains/gcc-fork.git] / gcc / flags.h
1 /* Compilation switch flag definitions for GCC.
2    Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
3    Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #ifndef GCC_FLAGS_H
23 #define GCC_FLAGS_H
24
25 /* Name of the input .c file being compiled.  */
26 extern const char *main_input_filename;
27
28 enum debug_info_type
29 {
30   NO_DEBUG,         /* Write no debug info.  */
31   DBX_DEBUG,        /* Write BSD .stabs for DBX (using dbxout.c).  */
32   SDB_DEBUG,        /* Write COFF for (old) SDB (using sdbout.c).  */
33   DWARF_DEBUG,      /* Write Dwarf debug info (using dwarfout.c).  */
34   DWARF2_DEBUG,     /* Write Dwarf v2 debug info (using dwarf2out.c).  */
35   XCOFF_DEBUG,      /* Write IBM/Xcoff debug info (using dbxout.c).  */
36   VMS_DEBUG,        /* Write VMS debug info (using vmsdbgout.c).  */
37   VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c).
38                           and DWARF v2 debug info (using dwarf2out.c).  */
39 };
40
41 /* Specify which kind of debugging info to generate.  */
42 extern enum debug_info_type write_symbols;
43
44 /* Names of debug_info_type, for error messages.  */
45 extern const char *const debug_type_names[];
46
47 enum debug_info_level
48 {
49   DINFO_LEVEL_NONE,     /* Write no debugging info.  */
50   DINFO_LEVEL_TERSE,    /* Write minimal info to support tracebacks only.  */
51   DINFO_LEVEL_NORMAL,   /* Write info for all declarations (and line table).  */
52   DINFO_LEVEL_VERBOSE   /* Write normal info plus #define/#undef info.  */
53 };
54
55 /* Specify how much debugging info to generate.  */
56 extern enum debug_info_level debug_info_level;
57
58 /* Nonzero means use GNU-only extensions in the generated symbolic
59    debugging information.  */
60 extern int use_gnu_debug_info_extensions;
61
62 /* Nonzero means do optimizations.  -opt.  */
63
64 extern int optimize;
65
66 /* Nonzero means optimize for size.  -Os.  */
67
68 extern int optimize_size;
69
70 /* Don't print functions as they are compiled and don't print
71    times taken by the various passes.  -quiet.  */
72
73 extern int quiet_flag;
74
75 /* Print times taken by the various passes.  -ftime-report.  */
76
77 extern int time_report;
78
79 /* Print memory still in use at end of compilation (which may have little
80    to do with peak memory consumption).  -fmem-report.  */
81
82 extern int mem_report;
83
84 /* Don't print warning messages.  -w.  */
85
86 extern int inhibit_warnings;
87
88 /* Don't suppress warnings from system headers.  -Wsystem-headers.  */
89
90 extern int warn_system_headers;
91
92 /* Do print extra warnings (such as for uninitialized variables).
93    -W/-Wextra.  */
94
95 extern int extra_warnings;
96
97 /* Nonzero to warn about unused variables, functions et.al.  Use
98    set_Wunused() to update the -Wunused-* flags that correspond to the
99    -Wunused option.  */
100
101 extern void set_Wunused PARAMS ((int setting));
102
103 extern int warn_unused_function;
104 extern int warn_unused_label;
105 extern int warn_unused_parameter;
106 extern int warn_unused_variable;
107 extern int warn_unused_value;
108
109 /* Nonzero to warn about code which is never reached.  */
110
111 extern int warn_notreached;
112
113 /* Nonzero means warn if inline function is too large.  */
114
115 extern int warn_inline;
116
117 /* Nonzero to warn about variables used before they are initialized.  */
118
119 extern int warn_uninitialized;
120
121 /* Zero if unknown pragmas are ignored
122    One if the compiler should warn about an unknown pragma not in
123    a system include file.
124    Greater than one if the compiler should warn for all unknown
125    pragmas.  */
126
127 extern int warn_unknown_pragmas;
128
129 /* Nonzero means warn about all declarations which shadow others.  */
130
131 extern int warn_shadow;
132
133 /* Warn if a switch on an enum, that does not have a default case,
134    fails to have a case for every enum value.  */
135
136 extern int warn_switch;
137
138 /* Warn if a switch does not have a default case.  */
139
140 extern int warn_switch_default;
141
142 /* Warn if a switch on an enum fails to have a case for every enum
143    value (regardless of the presence or otherwise of a default case).  */
144
145 extern int warn_switch_enum;
146
147 /* Nonzero means warn about function definitions that default the return type
148    or that use a null return and have a return-type other than void.  */
149
150 extern int warn_return_type;
151
152 /* Warn about functions which might be candidates for attribute noreturn.  */
153
154 extern int warn_missing_noreturn;
155
156 /* Nonzero means warn about pointer casts that increase the required
157    alignment of the target type (and might therefore lead to a crash
158    due to a misaligned access).  */
159
160 extern int warn_cast_align;
161
162 /* Nonzero means warn about any objects definitions whose size is larger
163    than N bytes.  Also want about function definitions whose returned
164    values are larger than N bytes. The value N is in `larger_than_size'.  */
165
166 extern int warn_larger_than;
167 extern HOST_WIDE_INT larger_than_size;
168
169 /* Warn if a function returns an aggregate,
170    since there are often incompatible calling conventions for doing this.  */
171
172 extern int warn_aggregate_return;
173
174 /* Warn if packed attribute on struct is unnecessary and inefficient.  */
175
176 extern int warn_packed;
177
178 /* Warn when gcc pads a structure to an alignment boundary.  */
179
180 extern int warn_padded;
181
182 /* Warn when an optimization pass is disabled.  */
183
184 extern int warn_disabled_optimization;
185
186 /* Nonzero means warn about uses of __attribute__((deprecated)) 
187    declarations.  */
188
189 extern int warn_deprecated_decl;
190
191 /* Nonzero means warn about constructs which might not be strict
192    aliasing safe.  */
193
194 extern int warn_strict_aliasing;
195
196 /* Nonzero if generating code to do profiling.  */
197
198 extern int profile_flag;
199
200 /* Nonzero if generating code to profile program flow graph arcs.  */
201
202 extern int profile_arc_flag;
203
204 /* Nonzero if generating info for gcov to calculate line test coverage.  */
205
206 extern int flag_test_coverage;
207
208 /* Nonzero indicates that branch taken probabilities should be calculated.  */
209
210 extern int flag_branch_probabilities;
211
212 /* Nonzero if basic blocks should be reordered.  */
213
214 extern int flag_reorder_blocks;
215
216 /* Nonzero if functions should be reordered.  */
217
218 extern int flag_reorder_functions;
219
220 /* Nonzero if registers should be renamed.  */
221
222 extern int flag_rename_registers;
223
224 /* Nonzero for -pedantic switch: warn about anything
225    that standard C forbids.  */
226
227 extern int pedantic;
228
229 /* Temporarily suppress certain warnings.
230    This is set while reading code from a system header file.  */
231
232 extern int in_system_header;
233
234 /* Nonzero for -dp: annotate the assembly with a comment describing the
235    pattern and alternative used.  */
236
237 extern int flag_print_asm_name;
238 \f
239 /* Now the symbols that are set with `-f' switches.  */
240
241 /* Nonzero means `char' should be signed.  */
242
243 extern int flag_signed_char;
244
245 /* Nonzero means give an enum type only as many bytes as it needs.  */
246
247 extern int flag_short_enums;
248
249 /* Nonzero for -fcaller-saves: allocate values in regs that need to
250    be saved across function calls, if that produces overall better code.
251    Optional now, so people can test it.  */
252
253 extern int flag_caller_saves;
254
255 /* Nonzero for -fpcc-struct-return: return values the same way PCC does.  */
256
257 extern int flag_pcc_struct_return;
258
259 /* Nonzero for -fforce-mem: load memory value into a register
260    before arithmetic on it.  This makes better cse but slower compilation.  */
261
262 extern int flag_force_mem;
263
264 /* Nonzero for -fforce-addr: load memory address into a register before
265    reference to memory.  This makes better cse but slower compilation.  */
266
267 extern int flag_force_addr;
268
269 /* Nonzero for -fdefer-pop: don't pop args after each function call;
270    instead save them up to pop many calls' args with one insns.  */
271
272 extern int flag_defer_pop;
273
274 /* Nonzero for -ffloat-store: don't allocate floats and doubles
275    in extended-precision registers.  */
276
277 extern int flag_float_store;
278
279 /* Nonzero enables strength-reduction in loop.c.  */
280
281 extern int flag_strength_reduce;
282
283 /* Nonzero enables loop unrolling in unroll.c.  Only loops for which the
284    number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
285    UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
286    unrolled.  */
287
288 extern int flag_old_unroll_loops;
289
290 /* Nonzero enables loop unrolling in unroll.c.  All loops are unrolled.
291    This is generally not a win.  */
292
293 extern int flag_old_unroll_all_loops;
294
295 /* Nonzero forces all invariant computations in loops to be moved
296    outside the loop.  */
297
298 extern int flag_move_all_movables;
299
300 /* Nonzero enables prefetch optimizations for arrays in loops.  */
301
302 extern int flag_prefetch_loop_arrays;
303
304 /* Nonzero forces all general induction variables in loops to be
305    strength reduced.  */
306
307 extern int flag_reduce_all_givs;
308
309 /* Nonzero for -fcse-follow-jumps:
310    have cse follow jumps to do a more extensive job.  */
311
312 extern int flag_cse_follow_jumps;
313
314 /* Nonzero for -fcse-skip-blocks:
315    have cse follow a branch around a block.  */
316
317 extern int flag_cse_skip_blocks;
318
319 /* Nonzero for -fexpensive-optimizations:
320    perform miscellaneous relatively-expensive optimizations.  */
321 extern int flag_expensive_optimizations;
322
323 /* Nonzero for -fwritable-strings:
324    store string constants in data segment and don't uniquize them.  */
325
326 extern int flag_writable_strings;
327
328 /* Nonzero means don't put addresses of constant functions in registers.
329    Used for compiling the Unix kernel, where strange substitutions are
330    done on the assembly output.  */
331
332 extern int flag_no_function_cse;
333
334 /* Nonzero for -fomit-frame-pointer:
335    don't make a frame pointer in simple functions that don't require one.  */
336
337 extern int flag_omit_frame_pointer;
338
339 /* Nonzero to inhibit use of define_optimization peephole opts.  */
340
341 extern int flag_no_peephole;
342
343 /* Nonzero allows GCC to optimize sibling and tail recursive calls.  */
344
345 extern int flag_optimize_sibling_calls;
346
347 /* Nonzero means the front end generally wants `errno' maintained by math
348    operations, like built-in SQRT.  */
349
350 extern int flag_errno_math;
351
352 /* Nonzero means that unsafe floating-point math optimizations are allowed
353    for the sake of speed.  IEEE compliance is not guaranteed, and operations
354    are allowed to assume that their arguments and results are "normal"
355    (e.g., nonnegative for SQRT).  */
356
357 extern int flag_unsafe_math_optimizations;
358
359 /* Nonzero means that no NaNs or +-Infs are expected.  */
360
361 extern int flag_finite_math_only;
362
363 /* Zero means that floating-point math operations cannot generate a
364    (user-visible) trap.  This is the case, for example, in nonstop
365    IEEE 754 arithmetic.  */
366
367 extern int flag_trapping_math;
368
369 /* 0 means straightforward implementation of complex divide acceptable.
370    1 means wide ranges of inputs must work for complex divide.
371    2 means C99-like requirements for complex divide (not yet implemented).  */
372
373 extern int flag_complex_divide_method;
374
375 /* Nonzero means to run loop optimizations twice.  */
376
377 extern int flag_rerun_loop_opt;
378
379 /* Nonzero means make functions that look like good inline candidates
380    go inline.  */
381
382 extern int flag_inline_functions;
383
384 /* Nonzero for -fkeep-inline-functions: even if we make a function
385    go inline everywhere, keep its definition around for debugging
386    purposes.  */
387
388 extern int flag_keep_inline_functions;
389
390 /* Nonzero means that functions declared `inline' will be treated
391    as `static'.  Prevents generation of zillions of copies of unused
392    static inline functions; instead, `inlines' are written out
393    only when actually used.  Used in conjunction with -g.  Also
394    does the right thing with #pragma interface.  */
395
396 extern int flag_no_inline;
397
398 /* Nonzero means that we don't want inlining by virtue of -fno-inline,
399    not just because the tree inliner turned us off.  */
400
401 extern int flag_really_no_inline;
402
403 /* Nonzero if we are only using compiler to check syntax errors.  */
404
405 extern int flag_syntax_only;
406
407 /* Nonzero means we should save auxiliary info into a .X file.  */
408
409 extern int flag_gen_aux_info;
410
411 /* Nonzero means make the text shared if supported.  */
412
413 extern int flag_shared_data;
414
415 /* flag_schedule_insns means schedule insns within basic blocks (before
416    local_alloc).
417    flag_schedule_insns_after_reload means schedule insns after
418    global_alloc.  */
419
420 extern int flag_schedule_insns;
421 extern int flag_schedule_insns_after_reload;
422 extern int flag_sched2_use_superblocks;
423 extern int flag_sched2_use_traces;
424
425 /* The following flags have effect only for scheduling before register
426    allocation:
427
428    flag_schedule_interblock means schedule insns across basic blocks.
429    flag_schedule_speculative means allow speculative motion of non-load insns.
430    flag_schedule_speculative_load means allow speculative motion of some
431    load insns.
432    flag_schedule_speculative_load_dangerous allows speculative motion of more
433    load insns.  */
434
435 extern int flag_schedule_interblock;
436 extern int flag_schedule_speculative;
437 extern int flag_schedule_speculative_load;
438 extern int flag_schedule_speculative_load_dangerous;
439
440 /* flag_branch_on_count_reg means try to replace add-1,compare,branch tupple
441    by a cheaper branch, on a count register.  */
442 extern int flag_branch_on_count_reg;
443
444 /* This option is set to 1 on -fsingle-precision-constant option which is
445    used to convert the floating point constants to single precision 
446    constants.  */
447
448 extern int flag_single_precision_constant;
449
450 /* Nonzero means put things in delayed-branch slots if supported.  */
451
452 extern int flag_delayed_branch;
453
454 /* Nonzero means suppress output of instruction numbers and line number
455    notes in debugging dumps.  */
456
457 extern int flag_dump_unnumbered;
458
459 /* Nonzero means change certain warnings into errors.
460    Usually these are warnings about failure to conform to some standard.  */
461
462 extern int flag_pedantic_errors;
463
464 /* Nonzero means generate position-independent code.  1 vs 2 for a 
465    target-dependent "small" or "large" mode.  */
466
467 extern int flag_pic;
468
469 /* Nonzero means generate extra code for exception handling and enable
470    exception handling.  */
471
472 extern int flag_exceptions;
473
474 /* Nonzero means generate frame unwind info table when supported */
475
476 extern int flag_unwind_tables;
477
478 /* Nonzero means generate frame unwind info table exact at each insn boundary */
479
480 extern int flag_asynchronous_unwind_tables;
481
482 /* Nonzero means allow for forced unwinding.  */
483
484 extern int flag_forced_unwind_exceptions;
485
486 /* Nonzero means don't place uninitialized global data in common storage
487    by default.  */
488
489 extern int flag_no_common;
490
491 /* -finhibit-size-directive inhibits output of .size for ELF.
492    This is used only for compiling crtstuff.c,
493    and it may be extended to other effects
494    needed for crtstuff.c on other systems.  */
495 extern int flag_inhibit_size_directive;
496
497 /* Nonzero means place each function into its own section on those platforms
498    which support arbitrary section names and unlimited numbers of sections.  */
499
500 extern int flag_function_sections;
501
502 /* ... and similar for data.  */
503  
504 extern int flag_data_sections;
505
506 /* -fverbose-asm causes extra commentary information to be produced in
507    the generated assembly code (to make it more readable).  This option
508    is generally only of use to those who actually need to read the
509    generated assembly code (perhaps while debugging the compiler itself).
510    -fno-verbose-asm, the default, causes the extra information
511    to not be added and is useful when comparing two assembler files.  */
512
513 extern int flag_verbose_asm;
514
515 /* -dA causes debug information to be produced in
516    the generated assembly code (to make it more readable).  This option
517    is generally only of use to those who actually need to read the
518    generated assembly code (perhaps while debugging the compiler itself).
519    Currently, this switch is only used by dwarfout.c; however, it is intended
520    to be a catchall for printing debug information in the assembler file.  */
521
522 extern int flag_debug_asm;
523
524 extern int flag_dump_rtl_in_asm;
525
526 /* Greater than zero if user symbols are prepended by a leading underscore
527    in generated assembly code.  */
528 extern int flag_leading_underscore;
529
530 /* -fgnu-linker specifies use of the GNU linker for initializations.
531    -fno-gnu-linker says that collect will be used.  */
532 extern int flag_gnu_linker;
533
534 /* Tag all structures with __attribute__(packed) */
535 extern int flag_pack_struct;
536
537 /* This flag is only tested if alias checking is enabled.
538    0 if pointer arguments may alias each other.  True in C.
539    1 if pointer arguments may not alias each other but may alias
540    global variables.
541    2 if pointer arguments may not alias each other and may not
542    alias global variables.  True in Fortran.
543    The value is ignored if flag_alias_check is 0.  */
544 extern int flag_argument_noalias;
545
546 /* Nonzero if we should do (language-dependent) alias analysis.
547    Typically, this analysis will assume that expressions of certain
548    types do not alias expressions of certain other types.  Only used
549    if alias analysis (in general) is enabled.  */
550 extern int flag_strict_aliasing;
551
552 /* Emit code to probe the stack, to help detect stack overflow; also
553    may cause large objects to be allocated dynamically.  */
554 extern int flag_stack_check;
555
556 /* Do the full regmove optimization pass.  */
557 extern int flag_regmove;
558
559 /* Instrument functions with calls at entry and exit, for profiling.  */
560 extern int flag_instrument_function_entry_exit;
561
562 /* Perform a peephole pass before sched2.  */
563 extern int flag_peephole2;
564
565 /* Try to guess branch probabilities.  */
566 extern int flag_guess_branch_prob;
567
568 /* -fcheck-bounds causes gcc to generate array bounds checks.
569    For C, C++ and ObjC: defaults off.
570    For Java: defaults to on.
571    For Fortran: defaults to off.  */
572 extern int flag_bounds_check;
573
574 /* This will attempt to merge constant section constants, if 1 only
575    string constants and constants from constant pool, if 2 also constant
576    variables.  */
577 extern int flag_merge_constants;
578
579 /* If one, renumber instruction UIDs to reduce the number of
580    unused UIDs if there are a lot of instructions.  If greater than
581    one, unconditionally renumber instruction UIDs.  */
582 extern int flag_renumber_insns;
583 \f
584 /* Other basic status info about current function.  */
585
586 /* Nonzero means current function must be given a frame pointer.
587    Set in stmt.c if anything is allocated on the stack there.
588    Set in reload1.c if anything is allocated on the stack there.  */
589
590 extern int frame_pointer_needed;
591
592 /* Nonzero if the generated code should trap on signed overflow
593    for PLUS / SUB / MULT.  */
594 extern int flag_trapv;
595
596 /* Value of the -G xx switch, and whether it was passed or not.  */
597 extern int g_switch_value;
598 extern int g_switch_set;
599
600 /* Values of the -falign-* flags: how much to align labels in code. 
601    0 means `use default', 1 means `don't align'.  
602    For each variable, there is an _log variant which is the power
603    of two not less than the variable, for .align output.  */
604
605 extern int align_loops;
606 extern int align_loops_log;
607 extern int align_loops_max_skip;
608 extern int align_jumps;
609 extern int align_jumps_log;
610 extern int align_jumps_max_skip;
611 extern int align_labels;
612 extern int align_labels_log;
613 extern int align_labels_max_skip;
614 extern int align_functions;
615 extern int align_functions_log;
616
617 /* Like align_functions_log above, but used by front-ends to force the
618    minimum function alignment.  Zero means no alignment is forced.  */
619 extern int force_align_functions_log;
620
621 /* Nonzero if we dump in VCG format, not plain text.  */
622 extern int dump_for_graph;
623
624 /* Selection of the graph form.  */
625 enum graph_dump_types
626 {
627   no_graph = 0,
628   vcg
629 };
630 extern enum graph_dump_types graph_dump_format;
631
632 /* Nonzero means ignore `#ident' directives.  0 means handle them.
633    On SVR4 targets, it also controls whether or not to emit a
634    string identifying the compiler.  */
635
636 extern int flag_no_ident;
637
638 /* Nonzero means perform global CSE.  */
639
640 extern int flag_gcse;
641
642 /* Nonzero if we want to perform enhanced load motion during gcse.  */
643
644 extern int flag_gcse_lm;
645
646 /* Nonzero if we want to perform store motion after gcse.  */
647
648 extern int flag_gcse_sm;
649
650
651 /* Nonzero means we should do dwarf2 duplicate elimination.  */
652
653 extern int flag_eliminate_dwarf2_dups;
654
655 /* Nonzero means we should do unused type elimination.  */
656
657 extern int flag_eliminate_unused_debug_types;
658
659 /* Nonzero means to collect statistics which might be expensive
660    and to print them when we are done.  */
661 extern int flag_detailed_statistics;
662
663 /* Nonzero means enable synchronous exceptions for non-call instructions.  */
664 extern int flag_non_call_exceptions;
665
666 /* Nonzero means put zero initialized data in the bss section.  */
667 extern int flag_zero_initialized_in_bss;
668
669 /* Nonzero means disable transformations observable by signaling NaNs.  */
670 extern int flag_signaling_nans;
671
672 extern int flag_unit_at_a_time;
673
674 /* A string that's used when a random name is required.  NULL means
675    to make it really random.  */
676
677 extern const char *flag_random_seed;
678
679 /* True if the given mode has a NaN representation and the treatment of
680    NaN operands is important.  Certain optimizations, such as folding
681    x * 0 into x, are not correct for NaN operands, and are normally
682    disabled for modes with NaNs.  The user can ask for them to be
683    done anyway using the -funsafe-math-optimizations switch.  */
684 #define HONOR_NANS(MODE) \
685   (MODE_HAS_NANS (MODE) && !flag_finite_math_only)
686
687 /* Like HONOR_NANs, but true if we honor signaling NaNs (or sNaNs).  */
688 #define HONOR_SNANS(MODE) (flag_signaling_nans && HONOR_NANS (MODE))
689
690 /* As for HONOR_NANS, but true if the mode can represent infinity and
691    the treatment of infinite values is important.  */
692 #define HONOR_INFINITIES(MODE) \
693   (MODE_HAS_INFINITIES (MODE) && !flag_finite_math_only)
694
695 /* Like HONOR_NANS, but true if the given mode distinguishes between
696    positive and negative zero, and the sign of zero is important.  */
697 #define HONOR_SIGNED_ZEROS(MODE) \
698   (MODE_HAS_SIGNED_ZEROS (MODE) && !flag_unsafe_math_optimizations)
699
700 /* Like HONOR_NANS, but true if given mode supports sign-dependent rounding,
701    and the rounding mode is important.  */
702 #define HONOR_SIGN_DEPENDENT_ROUNDING(MODE) \
703   (MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE) && !flag_unsafe_math_optimizations)
704
705 #endif /* ! GCC_FLAGS_H */