flags.h 19.9 KB
Newer Older
1
/* Compilation switch flag definitions for GCC.
2 3
   Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000
   Free Software Foundation, Inc.
Richard Stallman committed
4

5
This file is part of GCC.
Richard Stallman committed
6

7 8 9 10
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Richard Stallman committed
11

12 13 14 15
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.
Richard Stallman committed
16 17

You should have received a copy of the GNU General Public License
18 19 20
along with GCC; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.  */
Richard Stallman committed
21

Zack Weinberg committed
22 23 24
#ifndef GCC_FLAGS_H
#define GCC_FLAGS_H

Richard Stallman committed
25
/* Name of the input .c file being compiled.  */
Zack Weinberg committed
26
extern const char *main_input_filename;
Richard Stallman committed
27 28 29 30 31 32

enum debug_info_type
{
  NO_DEBUG,	    /* Write no debug info.  */
  DBX_DEBUG,	    /* Write BSD .stabs for DBX (using dbxout.c).  */
  SDB_DEBUG,	    /* Write COFF for (old) SDB (using sdbout.c).  */
33
  DWARF_DEBUG,	    /* Write Dwarf debug info (using dwarfout.c).  */
x  
Jason Merrill committed
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).  */
Richard Stallman committed
39 40 41 42 43 44 45 46 47
};

/* Specify which kind of debugging info to generate.  */
extern enum debug_info_type write_symbols;

enum debug_info_level
{
  DINFO_LEVEL_NONE,	/* Write no debugging info.  */
  DINFO_LEVEL_TERSE,	/* Write minimal info to support tracebacks only.  */
Kazu Hirata committed
48
  DINFO_LEVEL_NORMAL,	/* Write info for all declarations (and line table).  */
Richard Stallman committed
49 50 51 52 53 54
  DINFO_LEVEL_VERBOSE	/* Write normal info plus #define/#undef info.  */
};

/* Specify how much debugging info to generate.  */
extern enum debug_info_level debug_info_level;

Charles Hannum committed
55 56 57
/* Nonzero means use GNU-only extensions in the generated symbolic
   debugging information.  */
extern int use_gnu_debug_info_extensions;
Richard Stallman committed
58 59 60 61 62

/* Nonzero means do optimizations.  -opt.  */

extern int optimize;

63 64 65 66
/* Nonzero means optimize for size.  -Os.  */

extern int optimize_size;

Richard Stallman committed
67 68 69 70 71
/* Don't print functions as they are compiled and don't print
   times taken by the various passes.  -quiet.  */

extern int quiet_flag;

72 73 74 75 76 77 78 79 80
/* Print times taken by the various passes.  -ftime-report.  */

extern int time_report;

/* Print memory still in use at end of compilation (which may have little
   to do with peak memory consumption).  -fmem-report.  */

extern int mem_report;

Richard Stallman committed
81 82 83 84
/* Don't print warning messages.  -w.  */

extern int inhibit_warnings;

85 86 87 88
/* Don't suppress warnings from system headers.  -Wsystem-headers.  */

extern int warn_system_headers;

Richard Stallman committed
89 90 91 92
/* Do print extra warnings (such as for uninitialized variables).  -W.  */

extern int extra_warnings;

93 94
/* Nonzero to warn about unused variables, functions et.al.  Use
   set_Wunused() to update the -Wunused-* flags that correspond to the
Kazu Hirata committed
95
   -Wunused option.  */
Richard Stallman committed
96

97 98 99 100 101 102 103
extern void set_Wunused PARAMS ((int setting));

extern int warn_unused_function;
extern int warn_unused_label;
extern int warn_unused_parameter;
extern int warn_unused_variable;
extern int warn_unused_value;
Richard Stallman committed
104

105 106 107 108
/* Nonzero to warn about code which is never reached.  */

extern int warn_notreached;

109 110 111 112
/* Nonzero means warn if inline function is too large.  */

extern int warn_inline;

Richard Stallman committed
113 114 115 116
/* Nonzero to warn about variables used before they are initialized.  */

extern int warn_uninitialized;

117 118 119 120 121 122 123 124
/* Zero if unknown pragmas are ignored
   One if the compiler should warn about an unknown pragma not in
   a system include file.
   Greater than one if the compiler should warn for all unknown
   pragmas.  */

extern int warn_unknown_pragmas;

Kazu Hirata committed
125
/* Nonzero means warn about all declarations which shadow others.  */
Richard Stallman committed
126 127 128 129 130 131 132 133 134 135 136 137

extern int warn_shadow;

/* Warn if a switch on an enum fails to have a case for every enum value.  */

extern int warn_switch;

/* Nonzero means warn about function definitions that default the return type
   or that use a null return and have a return-type other than void.  */

extern int warn_return_type;

Kazu Hirata committed
138
/* Warn about functions which might be candidates for attribute noreturn.  */
139 140 141

extern int warn_missing_noreturn;

Richard Stallman committed
142 143 144 145 146 147
/* Nonzero means warn about pointer casts that increase the required
   alignment of the target type (and might therefore lead to a crash
   due to a misaligned access).  */

extern int warn_cast_align;

148 149 150 151 152
/* Nonzero means warn about any objects definitions whose size is larger
   than N bytes.  Also want about function definitions whose returned
   values are larger than N bytes. The value N is in `larger_than_size'.  */

extern int warn_larger_than;
153
extern HOST_WIDE_INT larger_than_size;
Richard Stallman committed
154 155 156 157 158 159

/* Warn if a function returns an aggregate,
   since there are often incompatible calling conventions for doing this.  */

extern int warn_aggregate_return;

160 161 162 163 164 165 166 167
/* Warn if packed attribute on struct is unnecessary and inefficient.  */

extern int warn_packed;

/* Warn when gcc pads a structure to an alignment boundary.  */

extern int warn_padded;

168 169 170 171
/* Warn when an optimization pass is disabled.  */

extern int warn_disabled_optimization;

172 173 174 175 176
/* Nonzero means warn about uses of __attribute__((deprecated)) 
   declarations.  */

extern int warn_deprecated_decl;

Richard Stallman committed
177 178 179 180
/* Nonzero if generating code to do profiling.  */

extern int profile_flag;

Kazu Hirata committed
181
/* Nonzero if generating code to profile program flow graph arcs.  */
182 183 184

extern int profile_arc_flag;

Kazu Hirata committed
185
/* Nonzero if generating info for gcov to calculate line test coverage.  */
186 187 188

extern int flag_test_coverage;

Kazu Hirata committed
189
/* Nonzero indicates that branch taken probabilities should be calculated.  */
190 191 192

extern int flag_branch_probabilities;

193 194 195 196 197 198 199 200
/* Nonzero if basic blocks should be reordered.  */

extern int flag_reorder_blocks;

/* Nonzero if registers should be renamed.  */

extern int flag_rename_registers;

Richard Stallman committed
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
/* Nonzero for -pedantic switch: warn about anything
   that standard C forbids.  */

extern int pedantic;

/* Temporarily suppress certain warnings.
   This is set while reading code from a system header file.  */

extern int in_system_header;

/* Nonzero for -dp: annotate the assembly with a comment describing the
   pattern and alternative used.  */

extern int flag_print_asm_name;

/* Now the symbols that are set with `-f' switches.  */

/* Nonzero means `char' should be signed.  */

extern int flag_signed_char;

/* Nonzero means give an enum type only as many bytes as it needs.  */

extern int flag_short_enums;

/* Nonzero for -fcaller-saves: allocate values in regs that need to
   be saved across function calls, if that produces overall better code.
   Optional now, so people can test it.  */

extern int flag_caller_saves;

/* Nonzero for -fpcc-struct-return: return values the same way PCC does.  */

extern int flag_pcc_struct_return;

/* Nonzero for -fforce-mem: load memory value into a register
   before arithmetic on it.  This makes better cse but slower compilation.  */

extern int flag_force_mem;

/* Nonzero for -fforce-addr: load memory address into a register before
   reference to memory.  This makes better cse but slower compilation.  */

extern int flag_force_addr;

/* Nonzero for -fdefer-pop: don't pop args after each function call;
   instead save them up to pop many calls' args with one insns.  */

extern int flag_defer_pop;

/* Nonzero for -ffloat-store: don't allocate floats and doubles
   in extended-precision registers.  */

extern int flag_float_store;

/* Nonzero enables strength-reduction in loop.c.  */

extern int flag_strength_reduce;

/* Nonzero enables loop unrolling in unroll.c.  Only loops for which the
   number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
   UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
   unrolled.  */

extern int flag_unroll_loops;

/* Nonzero enables loop unrolling in unroll.c.  All loops are unrolled.
   This is generally not a win.  */

extern int flag_unroll_all_loops;

272
/* Nonzero forces all invariant computations in loops to be moved
Kazu Hirata committed
273
   outside the loop.  */
274 275 276

extern int flag_move_all_movables;

277 278 279 280
/* Nonzero enables prefetch optimizations for arrays in loops.  */

extern int flag_prefetch_loop_arrays;

281
/* Nonzero forces all general induction variables in loops to be
Kazu Hirata committed
282
   strength reduced.  */
283 284 285

extern int flag_reduce_all_givs;

Richard Stallman committed
286 287 288 289 290
/* Nonzero for -fcse-follow-jumps:
   have cse follow jumps to do a more extensive job.  */

extern int flag_cse_follow_jumps;

291 292 293 294 295
/* Nonzero for -fcse-skip-blocks:
   have cse follow a branch around a block.  */

extern int flag_cse_skip_blocks;

Richard Stallman committed
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
/* Nonzero for -fexpensive-optimizations:
   perform miscellaneous relatively-expensive optimizations.  */
extern int flag_expensive_optimizations;

/* Nonzero for -fwritable-strings:
   store string constants in data segment and don't uniquize them.  */

extern int flag_writable_strings;

/* Nonzero means don't put addresses of constant functions in registers.
   Used for compiling the Unix kernel, where strange substitutions are
   done on the assembly output.  */

extern int flag_no_function_cse;

/* Nonzero for -fomit-frame-pointer:
   don't make a frame pointer in simple functions that don't require one.  */

extern int flag_omit_frame_pointer;

/* Nonzero to inhibit use of define_optimization peephole opts.  */

extern int flag_no_peephole;

/* Nonzero means all references through pointers are volatile.  */

extern int flag_volatile;

324
/* Nonzero means treat all global and extern variables as volatile.  */
325 326 327

extern int flag_volatile_global;

328 329 330 331
/* Nonzero means treat all static variables as volatile.  */

extern int flag_volatile_static;

332 333 334 335
/* Nonzero allows GCC to optimize sibling and tail recursive calls.  */

extern int flag_optimize_sibling_calls;

336
/* Nonzero means the front end generally wants `errno' maintained by math
337
   operations, like built-in SQRT.  */
338 339 340

extern int flag_errno_math;

341 342 343 344 345 346 347 348 349 350 351 352 353
/* Nonzero means that unsafe floating-point math optimizations are allowed
   for the sake of speed.  IEEE compliance is not guaranteed, and operations
   are allowed to assume that their arguments and results are "normal"
   (e.g., nonnegative for SQRT).  */

extern int flag_unsafe_math_optimizations;

/* Zero means that floating-point math operations cannot generate a
   (user-visible) trap.  This is the case, for example, in nonstop
   IEEE 754 arithmetic.  */

extern int flag_trapping_math;

354 355
/* 0 means straightforward implementation of complex divide acceptable.
   1 means wide ranges of inputs must work for complex divide.
356
   2 means C99-like requirements for complex divide (not yet implemented).  */
357 358 359

extern int flag_complex_divide_method;

360 361 362 363
/* Nonzero means to run loop optimizations twice.  */

extern int flag_rerun_loop_opt;

Richard Stallman committed
364 365 366 367 368 369
/* Nonzero means make functions that look like good inline candidates
   go inline.  */

extern int flag_inline_functions;

/* Nonzero for -fkeep-inline-functions: even if we make a function
370
   go inline everywhere, keep its definition around for debugging
Richard Stallman committed
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
   purposes.  */

extern int flag_keep_inline_functions;

/* Nonzero means that functions declared `inline' will be treated
   as `static'.  Prevents generation of zillions of copies of unused
   static inline functions; instead, `inlines' are written out
   only when actually used.  Used in conjunction with -g.  Also
   does the right thing with #pragma interface.  */

extern int flag_no_inline;

/* Nonzero if we are only using compiler to check syntax errors.  */

extern int flag_syntax_only;

387
/* Nonzero means we should save auxiliary info into a .X file.  */
Richard Stallman committed
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402

extern int flag_gen_aux_info;

/* Nonzero means make the text shared if supported.  */

extern int flag_shared_data;

/* flag_schedule_insns means schedule insns within basic blocks (before
   local_alloc).
   flag_schedule_insns_after_reload means schedule insns after
   global_alloc.  */

extern int flag_schedule_insns;
extern int flag_schedule_insns_after_reload;

403 404 405 406 407 408 409 410
/* The following flags have effect only for scheduling before register
   allocation:

   flag_schedule_interblock means schedule insns accross basic blocks.
   flag_schedule_speculative means allow speculative motion of non-load insns.
   flag_schedule_speculative_load means allow speculative motion of some
   load insns.
   flag_schedule_speculative_load_dangerous allows speculative motion of more
411
   load insns.  */
412 413 414 415 416 417

extern int flag_schedule_interblock;
extern int flag_schedule_speculative;
extern int flag_schedule_speculative_load;
extern int flag_schedule_speculative_load_dangerous;

418
/* flag_branch_on_count_reg means try to replace add-1,compare,branch tupple
Kazu Hirata committed
419
   by a cheaper branch, on a count register.  */
420 421
extern int flag_branch_on_count_reg;

422 423
/* This option is set to 1 on -fsingle-precision-constant option which is
   used to convert the floating point constants to single precision 
Kazu Hirata committed
424
   constants.  */
425 426

extern int flag_single_precision_constant;
427

Kazu Hirata committed
428
/* Nonzero means put things in delayed-branch slots if supported.  */
Richard Stallman committed
429 430 431

extern int flag_delayed_branch;

432 433 434 435 436
/* Nonzero means suppress output of instruction numbers and line number
   notes in debugging dumps.  */

extern int flag_dump_unnumbered;

Richard Stallman committed
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452
/* Nonzero means pretend it is OK to examine bits of target floats,
   even if that isn't true.  The resulting code will have incorrect constants,
   but the same series of instructions that the native compiler would make.  */

extern int flag_pretend_float;

/* Nonzero means change certain warnings into errors.
   Usually these are warnings about failure to conform to some standard.  */

extern int flag_pedantic_errors;

/* Nonzero means generate position-independent code.
   This is not fully implemented yet.  */

extern int flag_pic;

Mike Stump committed
453 454 455 456 457
/* Nonzero means generate extra code for exception handling and enable
   exception handling.  */

extern int flag_exceptions;

Richard Kenner committed
458 459 460 461
/* Nonzero means generate frame unwind info table when supported */

extern int flag_unwind_tables;

462 463 464 465
/* Nonzero means generate frame unwind info table exact at each insn boundary */

extern int flag_asynchronous_unwind_tables;

Jason Merrill committed
466 467
/* Nonzero means don't place uninitialized global data in common storage
   by default.  */
Richard Stallman committed
468 469 470 471 472 473 474 475 476

extern int flag_no_common;

/* -finhibit-size-directive inhibits output of .size for ELF.
   This is used only for compiling crtstuff.c,
   and it may be extended to other effects
   needed for crtstuff.c on other systems.  */
extern int flag_inhibit_size_directive;

477 478 479 480 481
/* Nonzero means place each function into its own section on those platforms
   which support arbitrary section names and unlimited numbers of sections.  */

extern int flag_function_sections;

482 483 484 485
/* ... and similar for data.  */
 
extern int flag_data_sections;

486 487 488
/* -fverbose-asm causes extra commentary information to be produced in
   the generated assembly code (to make it more readable).  This option
   is generally only of use to those who actually need to read the
489
   generated assembly code (perhaps while debugging the compiler itself).
490
   -fno-verbose-asm, the default, causes the extra information
491
   to not be added and is useful when comparing two assembler files.  */
492 493 494

extern int flag_verbose_asm;

495 496 497 498 499 500 501 502 503
/* -dA causes debug information to be produced in
   the generated assembly code (to make it more readable).  This option
   is generally only of use to those who actually need to read the
   generated assembly code (perhaps while debugging the compiler itself).
   Currently, this switch is only used by dwarfout.c; however, it is intended
   to be a catchall for printing debug information in the assembler file.  */

extern int flag_debug_asm;

504 505
extern int flag_dump_rtl_in_asm;

Richard Stallman committed
506 507 508
/* -fgnu-linker specifies use of the GNU linker for initializations.
   -fno-gnu-linker says that collect will be used.  */
extern int flag_gnu_linker;
Michael Meissner committed
509 510 511

/* Tag all structures with __attribute__(packed) */
extern int flag_pack_struct;
512

513 514 515 516 517 518 519 520 521
/* This flag is only tested if alias checking is enabled.
   0 if pointer arguments may alias each other.  True in C.
   1 if pointer arguments may not alias each other but may alias
   global variables.
   2 if pointer arguments may not alias each other and may not
   alias global variables.  True in Fortran.
   The value is ignored if flag_alias_check is 0.  */
extern int flag_argument_noalias;

522 523 524 525 526 527
/* Nonzero if we should do (language-dependent) alias analysis.
   Typically, this analysis will assume that expressions of certain
   types do not alias expressions of certain other types.  Only used
   if alias analysis (in general) is enabled.  */
extern int flag_strict_aliasing;

528 529
/* Emit code to probe the stack, to help detect stack overflow; also
   may cause large objects to be allocated dynamically.  */
530
extern int flag_stack_check;
J"orn Rennecke committed
531 532 533

/* Do the full regmove optimization pass.  */
extern int flag_regmove;
534 535 536

/* Instrument functions with calls at entry and exit, for profiling.  */
extern int flag_instrument_function_entry_exit;
537

Kazu Hirata committed
538
/* Perform a peephole pass before sched2.  */
539
extern int flag_peephole2;
540

541 542 543
/* Try to guess branch probablities.  */
extern int flag_guess_branch_prob;

544 545 546 547 548 549 550 551 552 553 554 555 556 557
/* -fbounded-pointers causes gcc to compile pointers as composite
   objects occupying three words: the pointer value, the base address
   of the referent object, and the address immediately beyond the end
   of the referent object.  The base and extent allow us to perform
   runtime bounds checking.  -fbounded-pointers implies -fcheck-bounds.  */
extern int flag_bounded_pointers;

/* -fcheck-bounds causes gcc to generate array bounds checks.
   For C, C++: defaults to value of flag_bounded_pointers.
   For ObjC: defaults to off.
   For Java: defaults to on.
   For Fortran: defaults to off.
   For CHILL: defaults to off.  */
extern int flag_bounds_check;
558

559 560 561 562 563
/* This will attempt to merge constant section constants, if 1 only
   string constants and constants from constant pool, if 2 also constant
   variables.  */
extern int flag_merge_constants;

564 565 566 567
/* If one, renumber instruction UIDs to reduce the number of
   unused UIDs if there are a lot of instructions.  If greater than
   one, unconditionally renumber instruction UIDs.  */
extern int flag_renumber_insns;
Richard Stallman committed
568 569 570 571 572 573 574 575 576

/* Other basic status info about current function.  */

/* Nonzero means current function must be given a frame pointer.
   Set in stmt.c if anything is allocated on the stack there.
   Set in reload1.c if anything is allocated on the stack there.  */

extern int frame_pointer_needed;

577 578 579 580
/* Nonzero if the generated code should trap on signed overflow
   for PLUS / SUB / MULT.  */
extern int flag_trapv;

581 582 583
/* Value of the -G xx switch, and whether it was passed or not.  */
extern int g_switch_value;
extern int g_switch_set;
584

585 586 587 588 589 590 591
/* Values of the -falign-* flags: how much to align labels in code. 
   0 means `use default', 1 means `don't align'.  
   For each variable, there is an _log variant which is the power
   of two not less than the variable, for .align output.  */

extern int align_loops;
extern int align_loops_log;
592
extern int align_loops_max_skip;
593 594
extern int align_jumps;
extern int align_jumps_log;
595
extern int align_jumps_max_skip;
596 597
extern int align_labels;
extern int align_labels_log;
598
extern int align_labels_max_skip;
599 600 601
extern int align_functions;
extern int align_functions_log;

602 603 604 605 606 607 608 609 610 611
/* Nonzero if we dump in VCG format, not plain text.  */
extern int dump_for_graph;

/* Selection of the graph form.  */
enum graph_dump_types
{
  no_graph = 0,
  vcg
};
extern enum graph_dump_types graph_dump_format;
612 613 614 615 616 617

/* Nonzero means ignore `#ident' directives.  0 means handle them.
   On SVR4 targets, it also controls whether or not to emit a
   string identifying the compiler.  */

extern int flag_no_ident;
Jason Merrill committed
618

619 620 621 622 623 624 625 626 627
/* Nonzero if we want to perform enhanced load motion during gcse.  */

extern int flag_gcse_lm;

/* Nonzero if we want to perform store motion after gcse.  */

extern int flag_gcse_sm;


Jason Merrill committed
628 629 630
/* Nonzero means we should do dwarf2 duplicate elimination.  */

extern int flag_eliminate_dwarf2_dups;
Zack Weinberg committed
631 632 633 634 635

/* Non-zero means to collect statistics which might be expensive
   and to print them when we are done.  */
extern int flag_detailed_statistics;

636 637 638
/* Nonzero means enable synchronous exceptions for non-call instructions.  */
extern int flag_non_call_exceptions;

639
#endif /* ! GCC_FLAGS_H */