Fix oversight in handling of reverse SSO in SRA pass
[official-gcc.git] / gcc / flag-types.h
blobe39673f6716aad0367633116617fb55f45ef0cac
1 /* Compilation switch flag type definitions for GCC.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_FLAG_TYPES_H
21 #define GCC_FLAG_TYPES_H
23 #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
25 enum debug_info_type
27 DINFO_TYPE_NONE = 0, /* No debug info. */
28 DINFO_TYPE_DBX = 1, /* BSD .stabs for DBX. */
29 DINFO_TYPE_DWARF2 = 2, /* Dwarf v2 debug info. */
30 DINFO_TYPE_XCOFF = 3, /* IBM/Xcoff debug info. */
31 DINFO_TYPE_VMS = 4, /* VMS debug info. */
32 DINFO_TYPE_CTF = 5, /* CTF debug info. */
33 DINFO_TYPE_BTF = 6, /* BTF debug info. */
34 DINFO_TYPE_MAX = DINFO_TYPE_BTF /* Marker only. */
37 #define NO_DEBUG (0U)
38 /* Write DBX debug info (using dbxout.c). */
39 #define DBX_DEBUG (1U << DINFO_TYPE_DBX)
40 /* Write DWARF2 debug info (using dwarf2out.c). */
41 #define DWARF2_DEBUG (1U << DINFO_TYPE_DWARF2)
42 /* Write IBM/XCOFF debug info (using dbxout.c). */
43 #define XCOFF_DEBUG (1U << DINFO_TYPE_XCOFF)
44 /* Write VMS debug info (using vmsdbgout.c). */
45 #define VMS_DEBUG (1U << DINFO_TYPE_VMS)
46 /* Write CTF debug info (using ctfout.c). */
47 #define CTF_DEBUG (1U << DINFO_TYPE_CTF)
48 /* Write BTF debug info (using btfout.c). */
49 #define BTF_DEBUG (1U << DINFO_TYPE_BTF)
50 /* Note: Adding new definitions to handle -combination- of debug formats,
51 like VMS_AND_DWARF2_DEBUG is not recommended. This definition remains
52 here for historical reasons. */
53 /* Write VMS debug info (using vmsdbgout.c) and DWARF v2 debug info (using
54 dwarf2out.c). */
55 #define VMS_AND_DWARF2_DEBUG ((VMS_DEBUG | DWARF2_DEBUG))
57 enum debug_info_levels
59 DINFO_LEVEL_NONE, /* Write no debugging info. */
60 DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */
61 DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */
62 DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */
65 /* CTF debug info levels.
66 CTF debug info levels are untied with DWARF debug info levels because CTF
67 may co-exist with DWARF. */
68 enum ctf_debug_info_levels
70 CTFINFO_LEVEL_NONE = 0, /* Write no CTF debug info. */
71 CTFINFO_LEVEL_TERSE = 1, /* Write CTF information to support tracebacks
72 only. Not Implemented. */
73 CTFINFO_LEVEL_NORMAL = 2 /* Write CTF type information for all entities
74 (functions, data objects, variables etc.)
75 at file-scope or global-scope only. */
78 /* A major contribution to object and executable size is debug
79 information size. A major contribution to debug information
80 size is struct descriptions replicated in several object files.
81 The following function determines whether or not debug information
82 should be generated for a given struct. The indirect parameter
83 indicates that the struct is being handled indirectly, via
84 a pointer. See opts.c for the implementation. */
86 enum debug_info_usage
88 DINFO_USAGE_DFN, /* A struct definition. */
89 DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
90 DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
91 DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
94 /* A major contribution to object and executable size is debug
95 information size. A major contribution to debug information size
96 is struct descriptions replicated in several object files. The
97 following flags attempt to reduce this information. The basic
98 idea is to not emit struct debugging information in the current
99 compilation unit when that information will be generated by
100 another compilation unit.
102 Debug information for a struct defined in the current source
103 file should be generated in the object file. Likewise the
104 debug information for a struct defined in a header should be
105 generated in the object file of the corresponding source file.
106 Both of these case are handled when the base name of the file of
107 the struct definition matches the base name of the source file
108 of the current compilation unit. This matching emits minimal
109 struct debugging information.
111 The base file name matching rule above will fail to emit debug
112 information for structs defined in system headers. So a second
113 category of files includes system headers in addition to files
114 with matching bases.
116 The remaining types of files are library headers and application
117 headers. We cannot currently distinguish these two types. */
119 enum debug_struct_file
121 DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
122 DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
123 same base name as the compilation unit. */
124 DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
125 header files. */
126 DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
129 /* Balance between GNAT encodings and standard DWARF to emit. */
131 enum dwarf_gnat_encodings
133 DWARF_GNAT_ENCODINGS_ALL = 0, /* Emit all GNAT encodings, then emit as
134 much standard DWARF as possible so it
135 does not conflict with GNAT
136 encodings. */
137 DWARF_GNAT_ENCODINGS_GDB = 1, /* Emit as much standard DWARF as possible
138 as long as GDB handles them. Emit GNAT
139 encodings for the rest. */
140 DWARF_GNAT_ENCODINGS_MINIMAL = 2 /* Emit all the standard DWARF we can.
141 Emit GNAT encodings for the rest. */
144 /* Enumerate Objective-c instance variable visibility settings. */
146 enum ivar_visibility
148 IVAR_VISIBILITY_PRIVATE,
149 IVAR_VISIBILITY_PROTECTED,
150 IVAR_VISIBILITY_PUBLIC,
151 IVAR_VISIBILITY_PACKAGE
154 /* The stack reuse level. */
155 enum stack_reuse_level
157 SR_NONE,
158 SR_NAMED_VARS,
159 SR_ALL
162 /* The live patching level. */
163 enum live_patching_level
165 LIVE_PATCHING_NONE = 0,
166 LIVE_PATCHING_INLINE_ONLY_STATIC,
167 LIVE_PATCHING_INLINE_CLONE
170 /* The algorithm used for basic block reordering. */
171 enum reorder_blocks_algorithm
173 REORDER_BLOCKS_ALGORITHM_SIMPLE,
174 REORDER_BLOCKS_ALGORITHM_STC
177 /* The algorithm used for the integrated register allocator (IRA). */
178 enum ira_algorithm
180 IRA_ALGORITHM_CB,
181 IRA_ALGORITHM_PRIORITY
184 /* The regions used for the integrated register allocator (IRA). */
185 enum ira_region
187 IRA_REGION_ONE,
188 IRA_REGION_ALL,
189 IRA_REGION_MIXED,
190 /* This value means that there were no options -fira-region on the
191 command line and that we should choose a value depending on the
192 used -O option. */
193 IRA_REGION_AUTODETECT
196 /* The options for excess precision. */
197 enum excess_precision
199 EXCESS_PRECISION_DEFAULT,
200 EXCESS_PRECISION_FAST,
201 EXCESS_PRECISION_STANDARD
204 /* The options for which values of FLT_EVAL_METHOD are permissible. */
205 enum permitted_flt_eval_methods
207 PERMITTED_FLT_EVAL_METHODS_DEFAULT,
208 PERMITTED_FLT_EVAL_METHODS_TS_18661,
209 PERMITTED_FLT_EVAL_METHODS_C11
212 /* Type of stack check.
214 Stack checking is designed to detect infinite recursion and stack
215 overflows for Ada programs. Furthermore stack checking tries to ensure
216 in that scenario that enough stack space is left to run a signal handler.
218 -fstack-check= does not prevent stack-clash style attacks. For that
219 you want -fstack-clash-protection. */
220 enum stack_check_type
222 /* Do not check the stack. */
223 NO_STACK_CHECK = 0,
225 /* Check the stack generically, i.e. assume no specific support
226 from the target configuration files. */
227 GENERIC_STACK_CHECK,
229 /* Check the stack and rely on the target configuration files to
230 check the static frame of functions, i.e. use the generic
231 mechanism only for dynamic stack allocations. */
232 STATIC_BUILTIN_STACK_CHECK,
234 /* Check the stack and entirely rely on the target configuration
235 files, i.e. do not use the generic mechanism at all. */
236 FULL_BUILTIN_STACK_CHECK
239 /* Type of callgraph information. */
240 enum callgraph_info_type
242 /* No information. */
243 NO_CALLGRAPH_INFO = 0,
245 /* Naked callgraph. */
246 CALLGRAPH_INFO_NAKED = 1,
248 /* Callgraph decorated with stack usage information. */
249 CALLGRAPH_INFO_STACK_USAGE = 2,
251 /* Callgraph decoration with dynamic allocation information. */
252 CALLGRAPH_INFO_DYNAMIC_ALLOC = 4
255 /* Floating-point contraction mode. */
256 enum fp_contract_mode {
257 FP_CONTRACT_OFF = 0,
258 FP_CONTRACT_ON = 1,
259 FP_CONTRACT_FAST = 2
262 /* Scalar storage order kind. */
263 enum scalar_storage_order_kind {
264 SSO_NATIVE = 0,
265 SSO_BIG_ENDIAN,
266 SSO_LITTLE_ENDIAN
269 /* Vectorizer cost-model. Except for DEFAULT, the values are ordered from
270 the most conservative to the least conservative. */
271 enum vect_cost_model {
272 VECT_COST_MODEL_VERY_CHEAP = -3,
273 VECT_COST_MODEL_CHEAP = -2,
274 VECT_COST_MODEL_DYNAMIC = -1,
275 VECT_COST_MODEL_UNLIMITED = 0,
276 VECT_COST_MODEL_DEFAULT = 1
279 /* Different instrumentation modes. */
280 enum sanitize_code {
281 /* AddressSanitizer. */
282 SANITIZE_ADDRESS = 1UL << 0,
283 SANITIZE_USER_ADDRESS = 1UL << 1,
284 SANITIZE_KERNEL_ADDRESS = 1UL << 2,
285 /* ThreadSanitizer. */
286 SANITIZE_THREAD = 1UL << 3,
287 /* LeakSanitizer. */
288 SANITIZE_LEAK = 1UL << 4,
289 /* UndefinedBehaviorSanitizer. */
290 SANITIZE_SHIFT_BASE = 1UL << 5,
291 SANITIZE_SHIFT_EXPONENT = 1UL << 6,
292 SANITIZE_DIVIDE = 1UL << 7,
293 SANITIZE_UNREACHABLE = 1UL << 8,
294 SANITIZE_VLA = 1UL << 9,
295 SANITIZE_NULL = 1UL << 10,
296 SANITIZE_RETURN = 1UL << 11,
297 SANITIZE_SI_OVERFLOW = 1UL << 12,
298 SANITIZE_BOOL = 1UL << 13,
299 SANITIZE_ENUM = 1UL << 14,
300 SANITIZE_FLOAT_DIVIDE = 1UL << 15,
301 SANITIZE_FLOAT_CAST = 1UL << 16,
302 SANITIZE_BOUNDS = 1UL << 17,
303 SANITIZE_ALIGNMENT = 1UL << 18,
304 SANITIZE_NONNULL_ATTRIBUTE = 1UL << 19,
305 SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 20,
306 SANITIZE_OBJECT_SIZE = 1UL << 21,
307 SANITIZE_VPTR = 1UL << 22,
308 SANITIZE_BOUNDS_STRICT = 1UL << 23,
309 SANITIZE_POINTER_OVERFLOW = 1UL << 24,
310 SANITIZE_BUILTIN = 1UL << 25,
311 SANITIZE_POINTER_COMPARE = 1UL << 26,
312 SANITIZE_POINTER_SUBTRACT = 1UL << 27,
313 SANITIZE_HWADDRESS = 1UL << 28,
314 SANITIZE_USER_HWADDRESS = 1UL << 29,
315 SANITIZE_KERNEL_HWADDRESS = 1UL << 30,
316 SANITIZE_SHIFT = SANITIZE_SHIFT_BASE | SANITIZE_SHIFT_EXPONENT,
317 SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
318 | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
319 | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
320 | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
321 | SANITIZE_NONNULL_ATTRIBUTE
322 | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
323 | SANITIZE_OBJECT_SIZE | SANITIZE_VPTR
324 | SANITIZE_POINTER_OVERFLOW | SANITIZE_BUILTIN,
325 SANITIZE_UNDEFINED_NONDEFAULT = SANITIZE_FLOAT_DIVIDE | SANITIZE_FLOAT_CAST
326 | SANITIZE_BOUNDS_STRICT
329 /* Different settings for zeroing subset of registers. */
330 namespace zero_regs_flags {
331 const unsigned int UNSET = 0;
332 const unsigned int SKIP = 1UL << 0;
333 const unsigned int ONLY_USED = 1UL << 1;
334 const unsigned int ONLY_GPR = 1UL << 2;
335 const unsigned int ONLY_ARG = 1UL << 3;
336 const unsigned int ENABLED = 1UL << 4;
337 const unsigned int USED_GPR_ARG = ENABLED | ONLY_USED | ONLY_GPR | ONLY_ARG;
338 const unsigned int USED_GPR = ENABLED | ONLY_USED | ONLY_GPR;
339 const unsigned int USED_ARG = ENABLED | ONLY_USED | ONLY_ARG;
340 const unsigned int USED = ENABLED | ONLY_USED;
341 const unsigned int ALL_GPR_ARG = ENABLED | ONLY_GPR | ONLY_ARG;
342 const unsigned int ALL_GPR = ENABLED | ONLY_GPR;
343 const unsigned int ALL_ARG = ENABLED | ONLY_ARG;
344 const unsigned int ALL = ENABLED;
347 /* Settings of flag_incremental_link. */
348 enum incremental_link {
349 INCREMENTAL_LINK_NONE,
350 /* Do incremental linking and produce binary. */
351 INCREMENTAL_LINK_NOLTO,
352 /* Do incremental linking and produce IL. */
353 INCREMENTAL_LINK_LTO
356 /* Different trace modes. */
357 enum sanitize_coverage_code {
358 /* Trace PC. */
359 SANITIZE_COV_TRACE_PC = 1 << 0,
360 /* Trace Comparison. */
361 SANITIZE_COV_TRACE_CMP = 1 << 1
364 /* flag_vtable_verify initialization levels. */
365 enum vtv_priority {
366 VTV_NO_PRIORITY = 0, /* i.E. Do NOT do vtable verification. */
367 VTV_STANDARD_PRIORITY = 1,
368 VTV_PREINIT_PRIORITY = 2
371 /* flag_lto_partition initialization values. */
372 enum lto_partition_model {
373 LTO_PARTITION_NONE = 0,
374 LTO_PARTITION_ONE = 1,
375 LTO_PARTITION_BALANCED = 2,
376 LTO_PARTITION_1TO1 = 3,
377 LTO_PARTITION_MAX = 4
380 /* flag_lto_linker_output initialization values. */
381 enum lto_linker_output {
382 LTO_LINKER_OUTPUT_UNKNOWN,
383 LTO_LINKER_OUTPUT_REL,
384 LTO_LINKER_OUTPUT_NOLTOREL,
385 LTO_LINKER_OUTPUT_DYN,
386 LTO_LINKER_OUTPUT_PIE,
387 LTO_LINKER_OUTPUT_EXEC
390 /* gfortran -finit-real= values. */
392 enum gfc_init_local_real
394 GFC_INIT_REAL_OFF = 0,
395 GFC_INIT_REAL_ZERO,
396 GFC_INIT_REAL_NAN,
397 GFC_INIT_REAL_SNAN,
398 GFC_INIT_REAL_INF,
399 GFC_INIT_REAL_NEG_INF
402 /* gfortran -fcoarray= values. */
404 enum gfc_fcoarray
406 GFC_FCOARRAY_NONE = 0,
407 GFC_FCOARRAY_SINGLE,
408 GFC_FCOARRAY_LIB
412 /* gfortran -fconvert= values; used for unformatted I/O.
413 Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
414 enum gfc_convert
416 GFC_FLAG_CONVERT_NATIVE = 0,
417 GFC_FLAG_CONVERT_SWAP,
418 GFC_FLAG_CONVERT_BIG,
419 GFC_FLAG_CONVERT_LITTLE
423 /* Control-Flow Protection values. */
424 enum cf_protection_level
426 CF_NONE = 0,
427 CF_BRANCH = 1 << 0,
428 CF_RETURN = 1 << 1,
429 CF_FULL = CF_BRANCH | CF_RETURN,
430 CF_SET = 1 << 2,
431 CF_CHECK = 1 << 3
434 /* Parloops schedule type. */
435 enum parloops_schedule_type
437 PARLOOPS_SCHEDULE_STATIC = 0,
438 PARLOOPS_SCHEDULE_DYNAMIC,
439 PARLOOPS_SCHEDULE_GUIDED,
440 PARLOOPS_SCHEDULE_AUTO,
441 PARLOOPS_SCHEDULE_RUNTIME
444 /* EVRP mode. */
445 enum evrp_mode
447 EVRP_MODE_EVRP_FIRST = 0,
448 EVRP_MODE_EVRP_ONLY = 1,
449 EVRP_MODE_RVRP_ONLY = 2,
450 EVRP_MODE_RVRP_FIRST = 3,
451 EVRP_MODE_TRACE = 4,
452 EVRP_MODE_DEBUG = 8 | EVRP_MODE_TRACE,
453 EVRP_MODE_RVRP_TRACE = EVRP_MODE_RVRP_ONLY | EVRP_MODE_TRACE,
454 EVRP_MODE_RVRP_DEBUG = EVRP_MODE_RVRP_ONLY | EVRP_MODE_DEBUG
457 /* Backwards threader mode. */
458 enum threader_mode
460 THREADER_MODE_LEGACY = 0,
461 THREADER_MODE_RANGER = 1
464 /* Modes of OpenACC 'kernels' constructs handling. */
465 enum openacc_kernels
467 OPENACC_KERNELS_DECOMPOSE,
468 OPENACC_KERNELS_PARLOOPS
471 /* Modes of OpenACC privatization diagnostics. */
472 enum openacc_privatization
474 OPENACC_PRIVATIZATION_QUIET,
475 OPENACC_PRIVATIZATION_NOISY
478 #endif
480 #endif /* ! GCC_FLAG_TYPES_H */