flags.h revision 18335
1169689Skan/* Compilation switch flag definitions for GNU CC. 2169689Skan Copyright (C) 1987, 1988, 1994, 1995 Free Software Foundation, Inc. 3169689Skan 4169689SkanThis file is part of GNU CC. 5169689Skan 6169689SkanGNU CC is free software; you can redistribute it and/or modify 7169689Skanit under the terms of the GNU General Public License as published by 8169689Skanthe Free Software Foundation; either version 2, or (at your option) 9169689Skanany later version. 10169689Skan 11169689SkanGNU CC is distributed in the hope that it will be useful, 12169689Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of 13169689SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14169689SkanGNU General Public License for more details. 15169689Skan 16169689SkanYou should have received a copy of the GNU General Public License 17169689Skanalong with GNU CC; see the file COPYING. If not, write to 18169689Skanthe Free Software Foundation, 59 Temple Place - Suite 330, 19169689SkanBoston, MA 02111-1307, USA. */ 20169689Skan 21169689Skan/* Name of the input .c file being compiled. */ 22169689Skanextern char *main_input_filename; 23169689Skan 24169689Skanenum debug_info_type 25169689Skan{ 26169689Skan NO_DEBUG, /* Write no debug info. */ 27169689Skan DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */ 28169689Skan SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */ 29169689Skan DWARF_DEBUG, /* Write Dwarf debug info (using dwarfout.c). */ 30169689Skan XCOFF_DEBUG /* Write IBM/Xcoff debug info (using dbxout.c). */ 31169689Skan}; 32169689Skan 33169689Skan/* Specify which kind of debugging info to generate. */ 34169689Skanextern enum debug_info_type write_symbols; 35169689Skan 36169689Skanenum debug_info_level 37169689Skan{ 38169689Skan DINFO_LEVEL_NONE, /* Write no debugging info. */ 39169689Skan DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */ 40169689Skan DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */ 41169689Skan DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */ 42169689Skan}; 43169689Skan 44169689Skan/* Specify how much debugging info to generate. */ 45169689Skanextern enum debug_info_level debug_info_level; 46169689Skan 47169689Skan/* Nonzero means use GNU-only extensions in the generated symbolic 48169689Skan debugging information. */ 49169689Skanextern int use_gnu_debug_info_extensions; 50169689Skan 51169689Skan/* Nonzero means do optimizations. -opt. */ 52169689Skan 53169689Skanextern int optimize; 54169689Skan 55169689Skan/* Nonzero means do stupid register allocation. -noreg. 56169689Skan Currently, this is 1 if `optimize' is 0. */ 57169689Skan 58169689Skanextern int obey_regdecls; 59169689Skan 60169689Skan/* Don't print functions as they are compiled and don't print 61169689Skan times taken by the various passes. -quiet. */ 62169689Skan 63169689Skanextern int quiet_flag; 64169689Skan 65169689Skan/* Don't print warning messages. -w. */ 66169689Skan 67169689Skanextern int inhibit_warnings; 68169689Skan 69169689Skan/* Do print extra warnings (such as for uninitialized variables). -W. */ 70169689Skan 71169689Skanextern int extra_warnings; 72169689Skan 73169689Skan/* Nonzero to warn about unused local variables. */ 74169689Skan 75169689Skanextern int warn_unused; 76169689Skan 77169689Skan/* Nonzero means warn if inline function is too large. */ 78169689Skan 79169689Skanextern int warn_inline; 80169689Skan 81169689Skan/* Nonzero to warn about variables used before they are initialized. */ 82169689Skan 83169689Skanextern int warn_uninitialized; 84169689Skan 85169689Skan/* Nonzero means warn about all declarations which shadow others. */ 86169689Skan 87169689Skanextern int warn_shadow; 88169689Skan 89169689Skan/* Warn if a switch on an enum fails to have a case for every enum value. */ 90169689Skan 91169689Skanextern int warn_switch; 92169689Skan 93169689Skan/* Nonzero means warn about function definitions that default the return type 94169689Skan or that use a null return and have a return-type other than void. */ 95169689Skan 96169689Skanextern int warn_return_type; 97169689Skan 98169689Skan/* Nonzero means warn about pointer casts that increase the required 99169689Skan alignment of the target type (and might therefore lead to a crash 100169689Skan due to a misaligned access). */ 101169689Skan 102169689Skanextern int warn_cast_align; 103169689Skan 104169689Skan/* Nonzero means warn that dbx info for template class methods isn't fully 105169689Skan supported yet. */ 106169689Skan 107169689Skanextern int warn_template_debugging; 108169689Skan 109169689Skan/* Nonzero means warn about any identifiers that match in the first N 110169689Skan characters. The value N is in `id_clash_len'. */ 111169689Skan 112169689Skanextern int warn_id_clash; 113169689Skanextern unsigned id_clash_len; 114169689Skan 115169689Skan/* Nonzero means warn about any objects definitions whose size is larger 116169689Skan than N bytes. Also want about function definitions whose returned 117169689Skan values are larger than N bytes. The value N is in `larger_than_size'. */ 118169689Skan 119169689Skanextern int warn_larger_than; 120169689Skanextern unsigned larger_than_size; 121169689Skan 122169689Skan/* Warn if a function returns an aggregate, 123169689Skan since there are often incompatible calling conventions for doing this. */ 124169689Skan 125169689Skanextern int warn_aggregate_return; 126169689Skan 127169689Skan/* Nonzero if generating code to do profiling. */ 128169689Skan 129169689Skanextern int profile_flag; 130169689Skan 131169689Skan/* Nonzero if generating code to do profiling on the basis of basic blocks. */ 132169689Skan 133169689Skanextern int profile_block_flag; 134169689Skan 135169689Skan/* Nonzero for -pedantic switch: warn about anything 136169689Skan that standard C forbids. */ 137169689Skan 138169689Skanextern int pedantic; 139169689Skan 140169689Skan/* Temporarily suppress certain warnings. 141169689Skan This is set while reading code from a system header file. */ 142169689Skan 143169689Skanextern int in_system_header; 144169689Skan 145169689Skan/* Nonzero for -dp: annotate the assembly with a comment describing the 146169689Skan pattern and alternative used. */ 147169689Skan 148169689Skanextern int flag_print_asm_name; 149169689Skan 150169689Skan/* Now the symbols that are set with `-f' switches. */ 151169689Skan 152169689Skan/* Nonzero means `char' should be signed. */ 153169689Skan 154169689Skanextern int flag_signed_char; 155169689Skan 156169689Skan/* Nonzero means give an enum type only as many bytes as it needs. */ 157169689Skan 158169689Skanextern int flag_short_enums; 159169689Skan 160169689Skan/* Nonzero for -fcaller-saves: allocate values in regs that need to 161169689Skan be saved across function calls, if that produces overall better code. 162169689Skan Optional now, so people can test it. */ 163169689Skan 164169689Skanextern int flag_caller_saves; 165169689Skan 166169689Skan/* Nonzero for -fpcc-struct-return: return values the same way PCC does. */ 167169689Skan 168169689Skanextern int flag_pcc_struct_return; 169169689Skan 170169689Skan/* Nonzero for -fforce-mem: load memory value into a register 171169689Skan before arithmetic on it. This makes better cse but slower compilation. */ 172169689Skan 173169689Skanextern int flag_force_mem; 174169689Skan 175169689Skan/* Nonzero for -fforce-addr: load memory address into a register before 176169689Skan reference to memory. This makes better cse but slower compilation. */ 177169689Skan 178169689Skanextern int flag_force_addr; 179169689Skan 180169689Skan/* Nonzero for -fdefer-pop: don't pop args after each function call; 181169689Skan instead save them up to pop many calls' args with one insns. */ 182169689Skan 183169689Skanextern int flag_defer_pop; 184169689Skan 185169689Skan/* Nonzero for -ffloat-store: don't allocate floats and doubles 186169689Skan in extended-precision registers. */ 187169689Skan 188169689Skanextern int flag_float_store; 189169689Skan 190169689Skan/* Nonzero enables strength-reduction in loop.c. */ 191169689Skan 192169689Skanextern int flag_strength_reduce; 193169689Skan 194169689Skan/* Nonzero enables loop unrolling in unroll.c. Only loops for which the 195169689Skan number of iterations can be calculated at compile-time (UNROLL_COMPLETELY, 196169689Skan UNROLL_MODULO) or at run-time (preconditioned to be UNROLL_MODULO) are 197169689Skan unrolled. */ 198169689Skan 199169689Skanextern int flag_unroll_loops; 200169689Skan 201169689Skan/* Nonzero enables loop unrolling in unroll.c. All loops are unrolled. 202169689Skan This is generally not a win. */ 203169689Skan 204169689Skanextern int flag_unroll_all_loops; 205169689Skan 206169689Skan/* Nonzero for -fcse-follow-jumps: 207169689Skan have cse follow jumps to do a more extensive job. */ 208169689Skan 209169689Skanextern int flag_cse_follow_jumps; 210169689Skan 211169689Skan/* Nonzero for -fcse-skip-blocks: 212169689Skan have cse follow a branch around a block. */ 213169689Skan 214169689Skanextern int flag_cse_skip_blocks; 215169689Skan 216169689Skan/* Nonzero for -fexpensive-optimizations: 217169689Skan perform miscellaneous relatively-expensive optimizations. */ 218169689Skanextern int flag_expensive_optimizations; 219169689Skan 220169689Skan/* Nonzero for -fwritable-strings: 221169689Skan store string constants in data segment and don't uniquize them. */ 222169689Skan 223169689Skanextern int flag_writable_strings; 224169689Skan 225169689Skan/* Nonzero means don't put addresses of constant functions in registers. 226169689Skan Used for compiling the Unix kernel, where strange substitutions are 227169689Skan done on the assembly output. */ 228169689Skan 229169689Skanextern int flag_no_function_cse; 230169689Skan 231169689Skan/* Nonzero for -fomit-frame-pointer: 232169689Skan don't make a frame pointer in simple functions that don't require one. */ 233169689Skan 234169689Skanextern int flag_omit_frame_pointer; 235169689Skan 236169689Skan/* Nonzero to inhibit use of define_optimization peephole opts. */ 237169689Skan 238169689Skanextern int flag_no_peephole; 239169689Skan 240169689Skan/* Nonzero means all references through pointers are volatile. */ 241169689Skan 242169689Skanextern int flag_volatile; 243169689Skan 244169689Skan/* Nonzero means treat all global and extern variables as global. */ 245169689Skan 246169689Skanextern int flag_volatile_global; 247169689Skan 248169689Skan/* Nonzero allows GCC to violate some IEEE or ANSI rules regarding math 249169689Skan operations in the interest of optimization. For example it allows 250169689Skan GCC to assume arguments to sqrt are nonnegative numbers, allowing 251169689Skan faster code for sqrt to be generated. */ 252169689Skan 253169689Skanextern int flag_fast_math; 254169689Skan 255169689Skan/* Nonzero means make functions that look like good inline candidates 256169689Skan go inline. */ 257169689Skan 258169689Skanextern int flag_inline_functions; 259169689Skan 260169689Skan/* Nonzero for -fkeep-inline-functions: even if we make a function 261169689Skan go inline everywhere, keep its definition around for debugging 262169689Skan purposes. */ 263169689Skan 264169689Skanextern int flag_keep_inline_functions; 265169689Skan 266169689Skan/* Nonzero means that functions declared `inline' will be treated 267169689Skan as `static'. Prevents generation of zillions of copies of unused 268169689Skan static inline functions; instead, `inlines' are written out 269169689Skan only when actually used. Used in conjunction with -g. Also 270169689Skan does the right thing with #pragma interface. */ 271169689Skan 272169689Skanextern int flag_no_inline; 273169689Skan 274169689Skan/* Nonzero if we are only using compiler to check syntax errors. */ 275169689Skan 276169689Skanextern int flag_syntax_only; 277169689Skan 278169689Skan/* Nonzero means we should save auxiliary info into a .X file. */ 279169689Skan 280169689Skanextern int flag_gen_aux_info; 281169689Skan 282169689Skan/* Nonzero means make the text shared if supported. */ 283169689Skan 284169689Skanextern int flag_shared_data; 285169689Skan 286169689Skan/* flag_schedule_insns means schedule insns within basic blocks (before 287169689Skan local_alloc). 288169689Skan flag_schedule_insns_after_reload means schedule insns after 289169689Skan global_alloc. */ 290169689Skan 291169689Skanextern int flag_schedule_insns; 292169689Skanextern int flag_schedule_insns_after_reload; 293169689Skan 294169689Skan/* Nonzero means put things in delayed-branch slots if supported. */ 295169689Skan 296169689Skanextern int flag_delayed_branch; 297169689Skan 298169689Skan/* Nonzero means to run cleanups after CALL_EXPRs. */ 299169689Skan 300169689Skanextern int flag_short_temps; 301169689Skan 302169689Skan/* Nonzero means pretend it is OK to examine bits of target floats, 303169689Skan even if that isn't true. The resulting code will have incorrect constants, 304169689Skan but the same series of instructions that the native compiler would make. */ 305169689Skan 306169689Skanextern int flag_pretend_float; 307169689Skan 308169689Skan/* Nonzero means change certain warnings into errors. 309169689Skan Usually these are warnings about failure to conform to some standard. */ 310169689Skan 311169689Skanextern int flag_pedantic_errors; 312169689Skan 313169689Skan/* Nonzero means generate position-independent code. 314169689Skan This is not fully implemented yet. */ 315169689Skan 316169689Skanextern int flag_pic; 317169689Skan 318169689Skan/* Nonzero means place uninitialized global data in the bss section. */ 319169689Skan 320169689Skanextern int flag_no_common; 321169689Skan 322169689Skan/* -finhibit-size-directive inhibits output of .size for ELF. 323169689Skan This is used only for compiling crtstuff.c, 324169689Skan and it may be extended to other effects 325169689Skan needed for crtstuff.c on other systems. */ 326169689Skanextern int flag_inhibit_size_directive; 327169689Skan 328169689Skan/* -fverbose-asm causes extra commentary information to be produced in 329169689Skan the generated assembly code (to make it more readable). This option 330169689Skan is generally only of use to those who actually need to read the 331169689Skan generated assembly code (perhaps while debugging the compiler itself). */ 332169689Skan 333169689Skanextern int flag_verbose_asm; 334169689Skan 335169689Skan/* -fgnu-linker specifies use of the GNU linker for initializations. 336169689Skan -fno-gnu-linker says that collect will be used. */ 337169689Skanextern int flag_gnu_linker; 338169689Skan 339169689Skan/* Tag all structures with __attribute__(packed) */ 340169689Skanextern int flag_pack_struct; 341169689Skan 342169689Skan/* Other basic status info about current function. */ 343169689Skan 344169689Skan/* Nonzero means current function must be given a frame pointer. 345169689Skan Set in stmt.c if anything is allocated on the stack there. 346169689Skan Set in reload1.c if anything is allocated on the stack there. */ 347169689Skan 348169689Skanextern int frame_pointer_needed; 349169689Skan 350169689Skan/* Set nonzero if jump_optimize finds that control falls through 351169689Skan at the end of the function. */ 352169689Skan 353169689Skanextern int can_reach_end; 354169689Skan 355169689Skan/* Nonzero if function being compiled receives nonlocal gotos 356169689Skan from nested functions. */ 357169689Skan 358169689Skanextern int current_function_has_nonlocal_label; 359169689Skan 360169689Skan/* Nonzero if function being compiled has nonlocal gotos to parent 361169689Skan function. */ 362169689Skan 363169689Skanextern int current_function_has_nonlocal_goto; 364169689Skan