00001 /* Compilation switch flag definitions for GCC. 00002 Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 00003 2003, 2004, 2005, 2006, 2007 00004 Free Software Foundation, Inc. 00005 00006 This file is part of GCC. 00007 00008 GCC is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU General Public License as published by the Free 00010 Software Foundation; either version 2, or (at your option) any later 00011 version. 00012 00013 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00014 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with GCC; see the file COPYING. If not, write to the Free 00020 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 00021 02110-1301, USA. */ 00022 00023 #ifndef GCC_FLAGS_H 00024 #define GCC_FLAGS_H 00025 00026 #include "options.h" 00027 00028 enum debug_info_type 00029 { 00030 NO_DEBUG, /* Write no debug info. */ 00031 DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */ 00032 SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */ 00033 DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */ 00034 XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */ 00035 VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */ 00036 VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c). 00037 and DWARF v2 debug info (using dwarf2out.c). */ 00038 }; 00039 00040 /* Specify which kind of debugging info to generate. */ 00041 extern enum debug_info_type write_symbols; 00042 00043 /* Names of debug_info_type, for error messages. */ 00044 extern const char *const debug_type_names[]; 00045 00046 enum debug_info_level 00047 { 00048 DINFO_LEVEL_NONE, /* Write no debugging info. */ 00049 DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */ 00050 DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */ 00051 DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */ 00052 }; 00053 00054 /* Specify how much debugging info to generate. */ 00055 extern enum debug_info_level debug_info_level; 00056 00057 /* Nonzero means use GNU-only extensions in the generated symbolic 00058 debugging information. */ 00059 extern bool use_gnu_debug_info_extensions; 00060 00061 /* Enumerate visibility settings. This is deliberately ordered from most 00062 to least visibility. */ 00063 #ifndef SYMBOL_VISIBILITY_DEFINED 00064 #define SYMBOL_VISIBILITY_DEFINED 00065 enum symbol_visibility 00066 { 00067 VISIBILITY_DEFAULT, 00068 VISIBILITY_PROTECTED, 00069 VISIBILITY_HIDDEN, 00070 VISIBILITY_INTERNAL 00071 }; 00072 #endif 00073 00074 /* The default visibility for all symbols (unless overridden). */ 00075 extern enum symbol_visibility default_visibility; 00076 00077 struct visibility_flags 00078 { 00079 unsigned inpragma : 1; /* True when in #pragma GCC visibility. */ 00080 unsigned inlines_hidden : 1; /* True when -finlineshidden in effect. */ 00081 }; 00082 00083 /* Global visibility options. */ 00084 extern struct visibility_flags visibility_options; 00085 00086 /* Nonzero means do optimizations. -opt. */ 00087 00088 extern int optimize; 00089 00090 /* Nonzero means optimize for size. -Os. */ 00091 00092 extern int optimize_size; 00093 00094 /* Do print extra warnings (such as for uninitialized variables). 00095 -W/-Wextra. */ 00096 00097 extern bool extra_warnings; 00098 00099 #ifdef TARG_SL 00100 /* Supporting long long type. -mlong-long */ 00101 00102 extern bool Long_Long_Support; 00103 00104 /* Supporting float point emulation. -msoft-float */ 00105 00106 extern bool Float_Point_Support; 00107 #endif 00108 00109 /* Nonzero to warn about unused variables, functions et.al. Use 00110 set_Wunused() to update the -Wunused-* flags that correspond to the 00111 -Wunused option. */ 00112 00113 extern void set_Wunused (int setting); 00114 00115 /* Nonzero means warn about any objects definitions whose size is larger 00116 than N bytes. Also want about function definitions whose returned 00117 values are larger than N bytes. The value N is in `larger_than_size'. */ 00118 00119 extern bool warn_larger_than; 00120 extern HOST_WIDE_INT larger_than_size; 00121 00122 /* Nonzero means warn about constructs which might not be strict 00123 aliasing safe. */ 00124 00125 extern int warn_strict_aliasing; 00126 00127 /* Nonzero means warn about optimizations which rely on undefined 00128 signed overflow. */ 00129 00130 extern int warn_strict_overflow; 00131 00132 /* Temporarily suppress certain warnings. 00133 This is set while reading code from a system header file. */ 00134 00135 extern int in_system_header; 00136 00137 /* Nonzero for -dp: annotate the assembly with a comment describing the 00138 pattern and alternative used. */ 00139 00140 extern int flag_print_asm_name; 00141 00142 /* Now the symbols that are set with `-f' switches. */ 00143 00144 /* Nonzero means `char' should be signed. */ 00145 00146 extern int flag_signed_char; 00147 00148 /* Nonzero means give an enum type only as many bytes as it needs. A value 00149 of 2 means it has not yet been initialized. */ 00150 00151 extern int flag_short_enums; 00152 00153 /* Nonzero for -fpcc-struct-return: return values the same way PCC does. */ 00154 00155 extern int flag_pcc_struct_return; 00156 00157 /* 0 means straightforward implementation of complex divide acceptable. 00158 1 means wide ranges of inputs must work for complex divide. 00159 2 means C99-like requirements for complex multiply and divide. */ 00160 00161 extern int flag_complex_method; 00162 00163 /* Nonzero means that we don't want inlining by virtue of -fno-inline, 00164 not just because the tree inliner turned us off. */ 00165 00166 extern int flag_really_no_inline; 00167 00168 /* Nonzero if we are only using compiler to check syntax errors. */ 00169 00170 extern int rtl_dump_and_exit; 00171 00172 /* Nonzero means we should save auxiliary info into a .X file. */ 00173 00174 extern int flag_gen_aux_info; 00175 00176 /* Nonzero means suppress output of instruction numbers and line number 00177 notes in debugging dumps. */ 00178 00179 extern int flag_dump_unnumbered; 00180 00181 /* Nonzero means change certain warnings into errors. 00182 Usually these are warnings about failure to conform to some standard. */ 00183 00184 extern int flag_pedantic_errors; 00185 00186 /* Nonzero if we are compiling code for a shared library, zero for 00187 executable. */ 00188 00189 extern int flag_shlib; 00190 00191 /* -dA causes debug information to be produced in 00192 the generated assembly code (to make it more readable). This option 00193 is generally only of use to those who actually need to read the 00194 generated assembly code (perhaps while debugging the compiler itself). 00195 Currently, this switch is only used by dwarfout.c; however, it is intended 00196 to be a catchall for printing debug information in the assembler file. */ 00197 00198 extern int flag_debug_asm; 00199 00200 /* Generate code for GNU or NeXT Objective-C runtime environment. */ 00201 00202 extern int flag_next_runtime; 00203 00204 extern int flag_dump_rtl_in_asm; 00205 00206 /* If one, renumber instruction UIDs to reduce the number of 00207 unused UIDs if there are a lot of instructions. If greater than 00208 one, unconditionally renumber instruction UIDs. */ 00209 extern int flag_renumber_insns; 00210 00211 /* Other basic status info about current function. */ 00212 00213 /* Nonzero means current function must be given a frame pointer. 00214 Set in stmt.c if anything is allocated on the stack there. 00215 Set in reload1.c if anything is allocated on the stack there. */ 00216 00217 extern int frame_pointer_needed; 00218 00219 /* Nonzero if subexpressions must be evaluated from left-to-right. */ 00220 extern int flag_evaluation_order; 00221 00222 /* Value of the -G xx switch, and whether it was passed or not. */ 00223 extern unsigned HOST_WIDE_INT g_switch_value; 00224 extern bool g_switch_set; 00225 00226 /* Values of the -falign-* flags: how much to align labels in code. 00227 0 means `use default', 1 means `don't align'. 00228 For each variable, there is an _log variant which is the power 00229 of two not less than the variable, for .align output. */ 00230 00231 extern int align_loops_log; 00232 extern int align_loops_max_skip; 00233 extern int align_jumps_log; 00234 extern int align_jumps_max_skip; 00235 extern int align_labels_log; 00236 extern int align_labels_max_skip; 00237 extern int align_functions_log; 00238 00239 /* Like align_functions_log above, but used by front-ends to force the 00240 minimum function alignment. Zero means no alignment is forced. */ 00241 extern int force_align_functions_log; 00242 00243 /* Nonzero if we dump in VCG format, not plain text. */ 00244 extern int dump_for_graph; 00245 00246 /* Selection of the graph form. */ 00247 enum graph_dump_types 00248 { 00249 no_graph = 0, 00250 vcg 00251 }; 00252 extern enum graph_dump_types graph_dump_format; 00253 00254 /* Nonzero means to collect statistics which might be expensive 00255 and to print them when we are done. */ 00256 extern int flag_detailed_statistics; 00257 00258 /* Nonzero means that we defer emitting functions until they are actually 00259 used. */ 00260 extern int flag_remove_unreachable_functions; 00261 00262 /* Nonzero if we should track variables. */ 00263 extern int flag_var_tracking; 00264 00265 /* True if flag_speculative_prefetching was set by user. Used to suppress 00266 warning message in case flag was set by -fprofile-{generate,use}. */ 00267 extern bool flag_speculative_prefetching_set; 00268 00269 /* A string that's used when a random name is required. NULL means 00270 to make it really random. */ 00271 00272 extern const char *flag_random_seed; 00273 00274 /* Returns TRUE if generated code should match ABI version N or 00275 greater is in use. */ 00276 00277 #define abi_version_at_least(N) \ 00278 (flag_abi_version == 0 || flag_abi_version >= (N)) 00279 00280 /* True if the given mode has a NaN representation and the treatment of 00281 NaN operands is important. Certain optimizations, such as folding 00282 x * 0 into 0, are not correct for NaN operands, and are normally 00283 disabled for modes with NaNs. The user can ask for them to be 00284 done anyway using the -funsafe-math-optimizations switch. */ 00285 #define HONOR_NANS(MODE) \ 00286 (MODE_HAS_NANS (MODE) && !flag_finite_math_only) 00287 00288 /* Like HONOR_NANs, but true if we honor signaling NaNs (or sNaNs). */ 00289 #define HONOR_SNANS(MODE) (flag_signaling_nans && HONOR_NANS (MODE)) 00290 00291 /* As for HONOR_NANS, but true if the mode can represent infinity and 00292 the treatment of infinite values is important. */ 00293 #define HONOR_INFINITIES(MODE) \ 00294 (MODE_HAS_INFINITIES (MODE) && !flag_finite_math_only) 00295 00296 /* Like HONOR_NANS, but true if the given mode distinguishes between 00297 positive and negative zero, and the sign of zero is important. */ 00298 #define HONOR_SIGNED_ZEROS(MODE) \ 00299 (MODE_HAS_SIGNED_ZEROS (MODE) && !flag_unsafe_math_optimizations) 00300 00301 /* Like HONOR_NANS, but true if given mode supports sign-dependent rounding, 00302 and the rounding mode is important. */ 00303 #define HONOR_SIGN_DEPENDENT_ROUNDING(MODE) \ 00304 (MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE) && flag_rounding_math) 00305 00306 /* True if overflow wraps around for the given integral type. That 00307 is, TYPE_MAX + 1 == TYPE_MIN. */ 00308 #define TYPE_OVERFLOW_WRAPS(TYPE) \ 00309 (TYPE_UNSIGNED (TYPE) || flag_wrapv) 00310 00311 /* True if overflow is undefined for the given integral type. We may 00312 optimize on the assumption that values in the type never overflow. 00313 00314 IMPORTANT NOTE: Any optimization based on TYPE_OVERFLOW_UNDEFINED 00315 must issue a warning based on warn_strict_overflow. In some cases 00316 it will be appropriate to issue the warning immediately, and in 00317 other cases it will be appropriate to simply set a flag and let the 00318 caller decide whether a warning is appropriate or not. */ 00319 #define TYPE_OVERFLOW_UNDEFINED(TYPE) \ 00320 (!TYPE_UNSIGNED (TYPE) && !flag_wrapv && !flag_trapv && flag_strict_overflow) 00321 00322 /* True if overflow for the given integral type should issue a 00323 trap. */ 00324 #define TYPE_OVERFLOW_TRAPS(TYPE) \ 00325 (!TYPE_UNSIGNED (TYPE) && flag_trapv) 00326 00327 /* Names for the different levels of -Wstrict-overflow=N. The numeric 00328 values here correspond to N. */ 00329 00330 enum warn_strict_overflow_code 00331 { 00332 /* Overflow warning that should be issued with -Wall: a questionable 00333 construct that is easy to avoid even when using macros. Example: 00334 folding (x + CONSTANT > x) to 1. */ 00335 WARN_STRICT_OVERFLOW_ALL = 1, 00336 /* Overflow warning about folding a comparison to a constant because 00337 of undefined signed overflow, other than cases covered by 00338 WARN_STRICT_OVERFLOW_ALL. Example: folding (abs (x) >= 0) to 1 00339 (this is false when x == INT_MIN). */ 00340 WARN_STRICT_OVERFLOW_CONDITIONAL = 2, 00341 /* Overflow warning about changes to comparisons other than folding 00342 them to a constant. Example: folding (x + 1 > 1) to (x > 0). */ 00343 WARN_STRICT_OVERFLOW_COMPARISON = 3, 00344 /* Overflow warnings not covered by the above cases. Example: 00345 folding ((x * 10) / 5) to (x * 2). */ 00346 WARN_STRICT_OVERFLOW_MISC = 4, 00347 /* Overflow warnings about reducing magnitude of constants in 00348 comparison. Example: folding (x + 2 > y) to (x + 1 >= y). */ 00349 WARN_STRICT_OVERFLOW_MAGNITUDE = 5 00350 }; 00351 00352 /* Whether to emit an overflow warning whose code is C. */ 00353 #define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c)) 00354 00355 #endif /* ! GCC_FLAGS_H */
1.5.6