flags.h revision 38510
122347Spst/* Compilation switch flag definitions for GNU CC.
222347Spst   Copyright (C) 1987, 1988, 1994, 1995 Free Software Foundation, Inc.
322347Spst
422347SpstThis file is part of GNU CC.
522347Spst
622347SpstGNU CC is free software; you can redistribute it and/or modify
729964Sacheit under the terms of the GNU General Public License as published by
892914Smarkmthe Free Software Foundation; either version 2, or (at your option)
922347Spstany later version.
1022347Spst
1122347SpstGNU CC is distributed in the hope that it will be useful,
1222347Spstbut WITHOUT ANY WARRANTY; without even the implied warranty of
1322347SpstMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1422347SpstGNU General Public License for more details.
1522347Spst
1622347SpstYou should have received a copy of the GNU General Public License
1722347Spstalong with GNU CC; see the file COPYING.  If not, write to
1822347Spstthe Free Software Foundation, 59 Temple Place - Suite 330,
1922347SpstBoston, MA 02111-1307, USA.  */
2022347Spst
2192914Smarkm/* Name of the input .c file being compiled.  */
2229964Sacheextern char *main_input_filename;
2329964Sache
2429964Sacheenum debug_info_type
2522347Spst{
2622347Spst  NO_DEBUG,	    /* Write no debug info.  */
2722347Spst  DBX_DEBUG,	    /* Write BSD .stabs for DBX (using dbxout.c).  */
2822347Spst  SDB_DEBUG,	    /* Write COFF for (old) SDB (using sdbout.c).  */
2922347Spst  DWARF_DEBUG,	    /* Write Dwarf debug info (using dwarfout.c).  */
3022347Spst  XCOFF_DEBUG	    /* Write IBM/Xcoff debug info (using dbxout.c).  */
3122347Spst};
3222347Spst
3322347Spst/* Specify which kind of debugging info to generate.  */
3422347Spstextern enum debug_info_type write_symbols;
3522347Spst
3622347Spstenum debug_info_level
3722347Spst{
3822347Spst  DINFO_LEVEL_NONE,	/* Write no debugging info.  */
3981596Sache  DINFO_LEVEL_TERSE,	/* Write minimal info to support tracebacks only.  */
4081596Sache  DINFO_LEVEL_NORMAL,	/* Write info for all declarations (and line table). */
4181596Sache  DINFO_LEVEL_VERBOSE	/* Write normal info plus #define/#undef info.  */
4222347Spst};
4322347Spst
4422347Spst/* Specify how much debugging info to generate.  */
4522347Spstextern enum debug_info_level debug_info_level;
4622347Spst
4722347Spst/* Nonzero means use GNU-only extensions in the generated symbolic
4822347Spst   debugging information.  */
4922347Spstextern int use_gnu_debug_info_extensions;
5022347Spst
5122347Spst/* Nonzero means do optimizations.  -opt.  */
5222347Spst
5322347Spstextern int optimize;
5422347Spst
5522347Spst/* Nonzero means do stupid register allocation.  -noreg.
5622347Spst   Currently, this is 1 if `optimize' is 0.  */
5722347Spst
5822347Spstextern int obey_regdecls;
5922347Spst
6022347Spst/* Don't print functions as they are compiled and don't print
6122347Spst   times taken by the various passes.  -quiet.  */
6222347Spst
6322347Spstextern int quiet_flag;
6422347Spst
6522347Spst/* Don't print warning messages.  -w.  */
6622347Spst
6722347Spstextern int inhibit_warnings;
6822347Spst
6922347Spst/* Do print extra warnings (such as for uninitialized variables).  -W.  */
7022347Spst
7122347Spstextern int extra_warnings;
7222347Spst
7322347Spst/* Nonzero to warn about unused local variables.  */
7422347Spst
7522347Spstextern int warn_unused;
7622347Spst
7722347Spst/* Nonzero means warn if inline function is too large.  */
7829964Sache
7922347Spstextern int warn_inline;
8022347Spst
8122347Spst/* Nonzero to warn about variables used before they are initialized.  */
8222347Spst
8322347Spstextern int warn_uninitialized;
8422347Spst
8522347Spst/* Nonzero means warn about all declarations which shadow others.   */
8622347Spst
8722347Spstextern int warn_shadow;
8822347Spst
8922347Spst/* Warn if a switch on an enum fails to have a case for every enum value.  */
9029964Sache
9122347Spstextern int warn_switch;
9222347Spst
9322347Spst/* Nonzero means warn about function definitions that default the return type
9422347Spst   or that use a null return and have a return-type other than void.  */
9522347Spst
9622347Spstextern int warn_return_type;
9722347Spst
9822347Spst/* Nonzero means warn about pointer casts that increase the required
9922347Spst   alignment of the target type (and might therefore lead to a crash
10022347Spst   due to a misaligned access).  */
10122347Spst
10222347Spstextern int warn_cast_align;
10322347Spst
10422347Spst/* Nonzero means warn that dbx info for template class methods isn't fully
10522347Spst   supported yet.  */
10622347Spst
10722347Spstextern int warn_template_debugging;
10822347Spst
10922347Spst/* Nonzero means warn about any identifiers that match in the first N
11022347Spst   characters.  The value N is in `id_clash_len'.  */
11122347Spst
112246873Sdimextern int warn_id_clash;
11322347Spstextern unsigned id_clash_len;
11422347Spst
11522347Spst/* Nonzero means warn about any objects definitions whose size is larger
11622347Spst   than N bytes.  Also want about function definitions whose returned
11722347Spst   values are larger than N bytes. The value N is in `larger_than_size'.  */
118246873Sdim
11922347Spstextern int warn_larger_than;
12022347Spstextern unsigned larger_than_size;
12122347Spst
12222347Spst/* Warn if a function returns an aggregate,
12389135Sjoerg   since there are often incompatible calling conventions for doing this.  */
124246873Sdim
12522347Spstextern int warn_aggregate_return;
12622347Spst
12722347Spst/* Nonzero if generating code to do profiling.  */
12822347Spst
12922347Spstextern int profile_flag;
13022347Spst
13122347Spst/* Nonzero if generating code to do profiling on the basis of basic blocks.  */
13222347Spst
13322347Spstextern int profile_block_flag;
13422347Spst
13522347Spst/* Nonzero for -pedantic switch: warn about anything
13622347Spst   that standard C forbids.  */
13722347Spst
13822347Spstextern int pedantic;
13992914Smarkm
14022347Spst/* Temporarily suppress certain warnings.
14122347Spst   This is set while reading code from a system header file.  */
14222347Spst
14322347Spstextern int in_system_header;
14422347Spst
14581596Sache/* Nonzero for -dp: annotate the assembly with a comment describing the
14622347Spst   pattern and alternative used.  */
14722347Spst
14822347Spstextern int flag_print_asm_name;
14922347Spst
15022347Spst/* Now the symbols that are set with `-f' switches.  */
15122347Spst
15222347Spst/* Nonzero means `char' should be signed.  */
15322347Spst
15422347Spstextern int flag_signed_char;
15522347Spst
15622347Spst/* Nonzero means give an enum type only as many bytes as it needs.  */
15722347Spst
15822347Spstextern int flag_short_enums;
15922347Spst
16022347Spst/* Nonzero for -fcaller-saves: allocate values in regs that need to
16122347Spst   be saved across function calls, if that produces overall better code.
16222347Spst   Optional now, so people can test it.  */
16322347Spst
16422347Spstextern int flag_caller_saves;
16522347Spst
16622347Spst/* Nonzero for -fpcc-struct-return: return values the same way PCC does.  */
16722347Spst
16822347Spstextern int flag_pcc_struct_return;
16922347Spst
17022347Spst/* Nonzero for -fforce-mem: load memory value into a register
17122347Spst   before arithmetic on it.  This makes better cse but slower compilation.  */
17222347Spst
17322347Spstextern int flag_force_mem;
17422347Spst
17522347Spst/* Nonzero for -fforce-addr: load memory address into a register before
17622347Spst   reference to memory.  This makes better cse but slower compilation.  */
17722347Spst
17822347Spstextern int flag_force_addr;
17922347Spst
18022347Spst/* Nonzero for -fdefer-pop: don't pop args after each function call;
18122347Spst   instead save them up to pop many calls' args with one insns.  */
18222347Spst
18322347Spstextern int flag_defer_pop;
18422347Spst
18522347Spst/* Nonzero for -ffloat-store: don't allocate floats and doubles
18622347Spst   in extended-precision registers.  */
18722347Spst
18822347Spstextern int flag_float_store;
18922347Spst
19022347Spst/* Nonzero enables strength-reduction in loop.c.  */
19122347Spst
19222347Spstextern int flag_strength_reduce;
19322347Spst
19422347Spst/* Nonzero enables loop unrolling in unroll.c.  Only loops for which the
19522347Spst   number of iterations can be calculated at compile-time (UNROLL_COMPLETELY,
19622347Spst   UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are
19722347Spst   unrolled.  */
19822347Spst
19922347Spstextern int flag_unroll_loops;
20022347Spst
20122347Spst/* Nonzero enables loop unrolling in unroll.c.  All loops are unrolled.
20222347Spst   This is generally not a win.  */
20322347Spst
20422347Spstextern int flag_unroll_all_loops;
20522347Spst
20622347Spst/* Nonzero for -fcse-follow-jumps:
20722347Spst   have cse follow jumps to do a more extensive job.  */
20822347Spst
20922347Spstextern int flag_cse_follow_jumps;
21022347Spst
21122347Spst/* Nonzero for -fcse-skip-blocks:
21222347Spst   have cse follow a branch around a block.  */
21322347Spst
21422347Spstextern int flag_cse_skip_blocks;
21522347Spst
21622347Spst/* Nonzero for -fexpensive-optimizations:
21722347Spst   perform miscellaneous relatively-expensive optimizations.  */
21822347Spstextern int flag_expensive_optimizations;
21922347Spst
22022347Spst/* Nonzero for -fwritable-strings:
22122347Spst   store string constants in data segment and don't uniquize them.  */
22222347Spst
22322347Spstextern int flag_writable_strings;
22422347Spst
22522347Spst/* Nonzero means don't put addresses of constant functions in registers.
22622347Spst   Used for compiling the Unix kernel, where strange substitutions are
22722347Spst   done on the assembly output.  */
22822347Spst
22922347Spstextern int flag_no_function_cse;
23022347Spst
23122347Spst/* Nonzero for -fomit-frame-pointer:
23222347Spst   don't make a frame pointer in simple functions that don't require one.  */
23322347Spst
23422347Spstextern int flag_omit_frame_pointer;
23522347Spst
23622347Spst/* Nonzero to inhibit use of define_optimization peephole opts.  */
23722347Spst
23822347Spstextern int flag_no_peephole;
23922347Spst
24022347Spst/* Nonzero means all references through pointers are volatile.  */
24122347Spst
24222347Spstextern int flag_volatile;
24322347Spst
24422347Spst/* Nonzero means treat all global and extern variables as global.  */
24522347Spst
24622347Spstextern int flag_volatile_global;
24722347Spst
24822347Spst/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math
24922347Spst   operations in the interest of optimization.  For example it allows
25022347Spst   GCC to assume arguments to sqrt are nonnegative numbers, allowing
25122347Spst   faster code for sqrt to be generated. */
25222347Spst
25322347Spstextern int flag_fast_math;
25422347Spst
25529964Sache/* Nonzero means make functions that look like good inline candidates
25622347Spst   go inline.  */
25722347Spst
25822347Spstextern int flag_inline_functions;
25922347Spst
26022347Spst/* Nonzero for -fkeep-inline-functions: even if we make a function
26122347Spst   go inline everywhere, keep its definition around for debugging
26222347Spst   purposes.  */
26322347Spst
26422347Spstextern int flag_keep_inline_functions;
26522347Spst
26622347Spst/* Nonzero means that functions declared `inline' will be treated
26722347Spst   as `static'.  Prevents generation of zillions of copies of unused
26822347Spst   static inline functions; instead, `inlines' are written out
26922347Spst   only when actually used.  Used in conjunction with -g.  Also
27092914Smarkm   does the right thing with #pragma interface.  */
27122347Spst
27222347Spstextern int flag_no_inline;
27322347Spst
27422347Spst/* Nonzero if we are only using compiler to check syntax errors.  */
27522347Spst
27692914Smarkmextern int flag_syntax_only;
27722347Spst
27822347Spst/* Nonzero means we should save auxiliary info into a .X file.  */
27922347Spst
28022347Spstextern int flag_gen_aux_info;
28122347Spst
28222347Spst/* Nonzero means make the text shared if supported.  */
28322347Spst
28422347Spstextern int flag_shared_data;
28592914Smarkm
28622347Spst/* flag_schedule_insns means schedule insns within basic blocks (before
28722347Spst   local_alloc).
28822347Spst   flag_schedule_insns_after_reload means schedule insns after
28922347Spst   global_alloc.  */
29022347Spst
29192914Smarkmextern int flag_schedule_insns;
29222347Spstextern int flag_schedule_insns_after_reload;
29322347Spst
29422347Spst/* Nonzero means put things in delayed-branch slots if supported. */
29522347Spst
29622347Spstextern int flag_delayed_branch;
29722347Spst
29822347Spst/* Nonzero means to run cleanups after CALL_EXPRs. */
29922347Spst
30022347Spstextern int flag_short_temps;
30122347Spst
30222347Spst/* Nonzero means pretend it is OK to examine bits of target floats,
30322347Spst   even if that isn't true.  The resulting code will have incorrect constants,
30492914Smarkm   but the same series of instructions that the native compiler would make.  */
30522347Spst
30692914Smarkmextern int flag_pretend_float;
30722347Spst
30822347Spst/* Nonzero means change certain warnings into errors.
30922347Spst   Usually these are warnings about failure to conform to some standard.  */
31092914Smarkm
31122347Spstextern int flag_pedantic_errors;
31222347Spst
31322347Spst/* Nonzero means generate position-independent code.
31492914Smarkm   This is not fully implemented yet.  */
31522347Spst
31629964Sacheextern int flag_pic;
31722347Spst
31829964Sache/* Nonzero means place uninitialized global data in the bss section.  */
31959118Skris
32092914Smarkmextern int flag_no_common;
32122347Spst
32222347Spst/* -finhibit-size-directive inhibits output of .size for ELF.
32392914Smarkm   This is used only for compiling crtstuff.c,
32422347Spst   and it may be extended to other effects
32522347Spst   needed for crtstuff.c on other systems.  */
32692914Smarkmextern int flag_inhibit_size_directive;
32722347Spst
32822347Spst/* -fverbose-asm causes extra commentary information to be produced in
32992914Smarkm   the generated assembly code (to make it more readable).  This option
33022347Spst   is generally only of use to those who actually need to read the
33122347Spst   generated assembly code (perhaps while debugging the compiler itself).  */
33222347Spst
33322347Spstextern int flag_verbose_asm;
33492914Smarkm
33522347Spst/* -fgnu-linker specifies use of the GNU linker for initializations.
33622347Spst   -fno-gnu-linker says that collect will be used.  */
33722347Spstextern int flag_gnu_linker;
33822347Spst
33922347Spst/* Tag all structures with __attribute__(packed) */
34022347Spstextern int flag_pack_struct;
34122347Spst
34222347Spst/* Nonzero means that -Wformat accepts certain non-ANSI formats.  */
34322347Spst
34422347Spstextern int flag_format_extensions;
34522347Spst
34622347Spst/* Other basic status info about current function.  */
347
348/* Nonzero means current function must be given a frame pointer.
349   Set in stmt.c if anything is allocated on the stack there.
350   Set in reload1.c if anything is allocated on the stack there.  */
351
352extern int frame_pointer_needed;
353
354/* Set nonzero if jump_optimize finds that control falls through
355   at the end of the function.  */
356
357extern int can_reach_end;
358
359/* Nonzero if function being compiled receives nonlocal gotos
360   from nested functions.  */
361
362extern int current_function_has_nonlocal_label;
363
364/* Nonzero if function being compiled has nonlocal gotos to parent
365   function.  */
366
367extern int current_function_has_nonlocal_goto;
368