1 /* Compilation switch flag type definitions for GCC.
2 Copyright (C) 1987-2025 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
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
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)
27 DINFO_TYPE_NONE
, /* No debug info. */
28 DINFO_TYPE_DWARF2
, /* Dwarf v2 debug info. */
29 DINFO_TYPE_VMS
, /* VMS debug info. */
30 DINFO_TYPE_CTF
, /* CTF debug info. */
31 DINFO_TYPE_BTF
, /* BTF debug info. */
32 DINFO_TYPE_CODEVIEW
, /* CodeView debug info. */
33 DINFO_TYPE_BTF_WITH_CORE
, /* BTF debug info with CO-RE relocations. */
34 DINFO_TYPE_MAX
= DINFO_TYPE_BTF_WITH_CORE
/* Marker only. */
38 /* Write DWARF2 debug info (using dwarf2out.cc). */
39 #define DWARF2_DEBUG (1U << DINFO_TYPE_DWARF2)
40 /* Write VMS debug info (using vmsdbgout.cc). */
41 #define VMS_DEBUG (1U << DINFO_TYPE_VMS)
42 /* Write CTF debug info (using ctfout.cc). */
43 #define CTF_DEBUG (1U << DINFO_TYPE_CTF)
44 /* Write BTF debug info (using btfout.cc). */
45 #define BTF_DEBUG (1U << DINFO_TYPE_BTF)
46 /* Write CodeView debug info (using dwarf2codeview.cc). */
47 #define CODEVIEW_DEBUG (1U << DINFO_TYPE_CODEVIEW)
48 /* Write BTF debug info for BPF CO-RE usecase (using btfout.cc). */
49 #define BTF_WITH_CORE_DEBUG (1U << DINFO_TYPE_BTF_WITH_CORE)
51 /* Note: Adding new definitions to handle -combination- of debug formats,
52 like VMS_AND_DWARF2_DEBUG is not recommended. This definition remains
53 here for historical reasons. */
54 /* Write VMS debug info (using vmsdbgout.cc) and DWARF v2 debug info (using
56 #define VMS_AND_DWARF2_DEBUG ((VMS_DEBUG | DWARF2_DEBUG))
58 enum debug_info_levels
60 DINFO_LEVEL_NONE
, /* Write no debugging info. */
61 DINFO_LEVEL_TERSE
, /* Write minimal info to support tracebacks only. */
62 DINFO_LEVEL_NORMAL
, /* Write info for all declarations (and line table). */
63 DINFO_LEVEL_VERBOSE
/* Write normal info plus #define/#undef info. */
66 /* CTF debug info levels.
67 CTF debug info levels are untied with DWARF debug info levels because CTF
68 may co-exist with DWARF. */
69 enum ctf_debug_info_levels
71 CTFINFO_LEVEL_NONE
= 0, /* Write no CTF debug info. */
72 CTFINFO_LEVEL_TERSE
= 1, /* Write CTF information to support tracebacks
73 only. Not Implemented. */
74 CTFINFO_LEVEL_NORMAL
= 2 /* Write CTF type information for all entities
75 (functions, data objects, variables etc.)
76 at file-scope or global-scope only. */
79 /* A major contribution to object and executable size is debug
80 information size. A major contribution to debug information
81 size is struct descriptions replicated in several object files.
82 The following function determines whether or not debug information
83 should be generated for a given struct. The indirect parameter
84 indicates that the struct is being handled indirectly, via
85 a pointer. See opts.cc for the implementation. */
89 DINFO_USAGE_DFN
, /* A struct definition. */
90 DINFO_USAGE_DIR_USE
, /* A direct use, such as the type of a variable. */
91 DINFO_USAGE_IND_USE
, /* An indirect use, such as through a pointer. */
92 DINFO_USAGE_NUM_ENUMS
/* The number of enumerators. */
95 /* A major contribution to object and executable size is debug
96 information size. A major contribution to debug information size
97 is struct descriptions replicated in several object files. The
98 following flags attempt to reduce this information. The basic
99 idea is to not emit struct debugging information in the current
100 compilation unit when that information will be generated by
101 another compilation unit.
103 Debug information for a struct defined in the current source
104 file should be generated in the object file. Likewise the
105 debug information for a struct defined in a header should be
106 generated in the object file of the corresponding source file.
107 Both of these case are handled when the base name of the file of
108 the struct definition matches the base name of the source file
109 of the current compilation unit. This matching emits minimal
110 struct debugging information.
112 The base file name matching rule above will fail to emit debug
113 information for structs defined in system headers. So a second
114 category of files includes system headers in addition to files
117 The remaining types of files are library headers and application
118 headers. We cannot currently distinguish these two types. */
120 enum debug_struct_file
122 DINFO_STRUCT_FILE_NONE
, /* Debug no structs. */
123 DINFO_STRUCT_FILE_BASE
, /* Debug structs defined in files with the
124 same base name as the compilation unit. */
125 DINFO_STRUCT_FILE_SYS
, /* Also debug structs defined in system
127 DINFO_STRUCT_FILE_ANY
/* Debug structs defined in all files. */
130 /* Balance between GNAT encodings and standard DWARF to emit. */
132 enum dwarf_gnat_encodings
134 DWARF_GNAT_ENCODINGS_ALL
= 0, /* Emit all GNAT encodings, then emit as
135 much standard DWARF as possible so it
136 does not conflict with GNAT
138 DWARF_GNAT_ENCODINGS_GDB
= 1, /* Emit as much standard DWARF as possible
139 as long as GDB handles them. Emit GNAT
140 encodings for the rest. */
141 DWARF_GNAT_ENCODINGS_MINIMAL
= 2 /* Emit all the standard DWARF we can.
142 Emit GNAT encodings for the rest. */
145 /* Enumerate Objective-c instance variable visibility settings. */
149 IVAR_VISIBILITY_PRIVATE
,
150 IVAR_VISIBILITY_PROTECTED
,
151 IVAR_VISIBILITY_PUBLIC
,
152 IVAR_VISIBILITY_PACKAGE
155 /* The stack reuse level. */
156 enum stack_reuse_level
163 /* Control Flow Redundancy hardening options for noreturn calls. */
173 /* The live patching level. */
174 enum live_patching_level
176 LIVE_PATCHING_NONE
= 0,
177 LIVE_PATCHING_INLINE_ONLY_STATIC
,
178 LIVE_PATCHING_INLINE_CLONE
181 /* The algorithm used for basic block reordering. */
182 enum reorder_blocks_algorithm
184 REORDER_BLOCKS_ALGORITHM_SIMPLE
,
185 REORDER_BLOCKS_ALGORITHM_STC
188 /* The algorithm used for the integrated register allocator (IRA). */
192 IRA_ALGORITHM_PRIORITY
195 /* The regions used for the integrated register allocator (IRA). */
203 /* The options for excess precision. */
204 enum excess_precision
206 EXCESS_PRECISION_DEFAULT
,
207 EXCESS_PRECISION_FAST
,
208 EXCESS_PRECISION_STANDARD
,
209 EXCESS_PRECISION_FLOAT16
212 /* The options for which values of FLT_EVAL_METHOD are permissible. */
213 enum permitted_flt_eval_methods
215 PERMITTED_FLT_EVAL_METHODS_DEFAULT
,
216 PERMITTED_FLT_EVAL_METHODS_TS_18661
,
217 PERMITTED_FLT_EVAL_METHODS_C11
220 /* Type of stack check.
222 Stack checking is designed to detect infinite recursion and stack
223 overflows for Ada programs. Furthermore stack checking tries to ensure
224 in that scenario that enough stack space is left to run a signal handler.
226 -fstack-check= does not prevent stack-clash style attacks. For that
227 you want -fstack-clash-protection. */
228 enum stack_check_type
230 /* Do not check the stack. */
233 /* Check the stack generically, i.e. assume no specific support
234 from the target configuration files. */
237 /* Check the stack and rely on the target configuration files to
238 check the static frame of functions, i.e. use the generic
239 mechanism only for dynamic stack allocations. */
240 STATIC_BUILTIN_STACK_CHECK
,
242 /* Check the stack and entirely rely on the target configuration
243 files, i.e. do not use the generic mechanism at all. */
244 FULL_BUILTIN_STACK_CHECK
247 /* Type of callgraph information. */
248 enum callgraph_info_type
250 /* No information. */
251 NO_CALLGRAPH_INFO
= 0,
253 /* Naked callgraph. */
254 CALLGRAPH_INFO_NAKED
= 1,
256 /* Callgraph decorated with stack usage information. */
257 CALLGRAPH_INFO_STACK_USAGE
= 2,
259 /* Callgraph decoration with dynamic allocation information. */
260 CALLGRAPH_INFO_DYNAMIC_ALLOC
= 4
263 /* Floating-point contraction mode. */
264 enum fp_contract_mode
{
270 /* Scalar storage order kind. */
271 enum scalar_storage_order_kind
{
277 /* Vectorizer cost-model. Except for DEFAULT, the values are ordered from
278 the most conservative to the least conservative. */
279 enum vect_cost_model
{
280 VECT_COST_MODEL_VERY_CHEAP
= -3,
281 VECT_COST_MODEL_CHEAP
= -2,
282 VECT_COST_MODEL_DYNAMIC
= -1,
283 VECT_COST_MODEL_UNLIMITED
= 0,
284 VECT_COST_MODEL_DEFAULT
= 1
287 /* Automatic variable initialization type. */
288 enum auto_init_type
{
289 AUTO_INIT_UNINITIALIZED
= 0,
290 AUTO_INIT_PATTERN
= 1,
294 /* Initialization of padding bits with zeros. */
295 enum zero_init_padding_bits_kind
{
296 ZERO_INIT_PADDING_BITS_STANDARD
= 0,
297 ZERO_INIT_PADDING_BITS_UNIONS
= 1,
298 ZERO_INIT_PADDING_BITS_ALL
= 2
301 /* Different instrumentation modes. */
303 /* AddressSanitizer. */
304 SANITIZE_ADDRESS
= 1UL << 0,
305 SANITIZE_USER_ADDRESS
= 1UL << 1,
306 SANITIZE_KERNEL_ADDRESS
= 1UL << 2,
307 /* ThreadSanitizer. */
308 SANITIZE_THREAD
= 1UL << 3,
310 SANITIZE_LEAK
= 1UL << 4,
311 /* UndefinedBehaviorSanitizer. */
312 SANITIZE_SHIFT_BASE
= 1UL << 5,
313 SANITIZE_SHIFT_EXPONENT
= 1UL << 6,
314 SANITIZE_DIVIDE
= 1UL << 7,
315 SANITIZE_UNREACHABLE
= 1UL << 8,
316 SANITIZE_VLA
= 1UL << 9,
317 SANITIZE_NULL
= 1UL << 10,
318 SANITIZE_RETURN
= 1UL << 11,
319 SANITIZE_SI_OVERFLOW
= 1UL << 12,
320 SANITIZE_BOOL
= 1UL << 13,
321 SANITIZE_ENUM
= 1UL << 14,
322 SANITIZE_FLOAT_DIVIDE
= 1UL << 15,
323 SANITIZE_FLOAT_CAST
= 1UL << 16,
324 SANITIZE_BOUNDS
= 1UL << 17,
325 SANITIZE_ALIGNMENT
= 1UL << 18,
326 SANITIZE_NONNULL_ATTRIBUTE
= 1UL << 19,
327 SANITIZE_RETURNS_NONNULL_ATTRIBUTE
= 1UL << 20,
328 SANITIZE_OBJECT_SIZE
= 1UL << 21,
329 SANITIZE_VPTR
= 1UL << 22,
330 SANITIZE_BOUNDS_STRICT
= 1UL << 23,
331 SANITIZE_POINTER_OVERFLOW
= 1UL << 24,
332 SANITIZE_BUILTIN
= 1UL << 25,
333 SANITIZE_POINTER_COMPARE
= 1UL << 26,
334 SANITIZE_POINTER_SUBTRACT
= 1UL << 27,
335 SANITIZE_HWADDRESS
= 1UL << 28,
336 SANITIZE_USER_HWADDRESS
= 1UL << 29,
337 SANITIZE_KERNEL_HWADDRESS
= 1UL << 30,
338 /* Shadow Call Stack. */
339 SANITIZE_SHADOW_CALL_STACK
= 1UL << 31,
340 SANITIZE_SHIFT
= SANITIZE_SHIFT_BASE
| SANITIZE_SHIFT_EXPONENT
,
341 SANITIZE_UNDEFINED
= SANITIZE_SHIFT
| SANITIZE_DIVIDE
| SANITIZE_UNREACHABLE
342 | SANITIZE_VLA
| SANITIZE_NULL
| SANITIZE_RETURN
343 | SANITIZE_SI_OVERFLOW
| SANITIZE_BOOL
| SANITIZE_ENUM
344 | SANITIZE_BOUNDS
| SANITIZE_ALIGNMENT
345 | SANITIZE_NONNULL_ATTRIBUTE
346 | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
347 | SANITIZE_OBJECT_SIZE
| SANITIZE_VPTR
348 | SANITIZE_POINTER_OVERFLOW
| SANITIZE_BUILTIN
,
349 SANITIZE_UNDEFINED_NONDEFAULT
= SANITIZE_FLOAT_DIVIDE
| SANITIZE_FLOAT_CAST
350 | SANITIZE_BOUNDS_STRICT
353 /* Different settings for zeroing subset of registers. */
354 namespace zero_regs_flags
{
355 const unsigned int UNSET
= 0;
356 const unsigned int SKIP
= 1UL << 0;
357 const unsigned int ONLY_USED
= 1UL << 1;
358 const unsigned int ONLY_GPR
= 1UL << 2;
359 const unsigned int ONLY_ARG
= 1UL << 3;
360 const unsigned int ENABLED
= 1UL << 4;
361 const unsigned int LEAFY_MODE
= 1UL << 5;
362 const unsigned int USED_GPR_ARG
= ENABLED
| ONLY_USED
| ONLY_GPR
| ONLY_ARG
;
363 const unsigned int USED_GPR
= ENABLED
| ONLY_USED
| ONLY_GPR
;
364 const unsigned int USED_ARG
= ENABLED
| ONLY_USED
| ONLY_ARG
;
365 const unsigned int USED
= ENABLED
| ONLY_USED
;
366 const unsigned int ALL_GPR_ARG
= ENABLED
| ONLY_GPR
| ONLY_ARG
;
367 const unsigned int ALL_GPR
= ENABLED
| ONLY_GPR
;
368 const unsigned int ALL_ARG
= ENABLED
| ONLY_ARG
;
369 const unsigned int ALL
= ENABLED
;
370 const unsigned int LEAFY_GPR_ARG
= ENABLED
| LEAFY_MODE
| ONLY_GPR
| ONLY_ARG
;
371 const unsigned int LEAFY_GPR
= ENABLED
| LEAFY_MODE
| ONLY_GPR
;
372 const unsigned int LEAFY_ARG
= ENABLED
| LEAFY_MODE
| ONLY_ARG
;
373 const unsigned int LEAFY
= ENABLED
| LEAFY_MODE
;
376 /* Settings of flag_incremental_link. */
377 enum incremental_link
{
378 INCREMENTAL_LINK_NONE
,
379 /* Do incremental linking and produce binary. */
380 INCREMENTAL_LINK_NOLTO
,
381 /* Do incremental linking and produce IL. */
385 /* Different trace modes. */
386 enum sanitize_coverage_code
{
388 SANITIZE_COV_TRACE_PC
= 1 << 0,
389 /* Trace Comparison. */
390 SANITIZE_COV_TRACE_CMP
= 1 << 1
393 /* flag_vtable_verify initialization levels. */
395 VTV_NO_PRIORITY
= 0, /* i.E. Do NOT do vtable verification. */
396 VTV_STANDARD_PRIORITY
= 1,
397 VTV_PREINIT_PRIORITY
= 2
400 /* flag_lto_partition initialization values. */
401 enum lto_partition_model
{
402 LTO_PARTITION_NONE
= 0,
403 LTO_PARTITION_ONE
= 1,
404 LTO_PARTITION_BALANCED
= 2,
405 LTO_PARTITION_1TO1
= 3,
406 LTO_PARTITION_MAX
= 4,
407 LTO_PARTITION_CACHE
= 5
410 /* flag_lto_linker_output initialization values. */
411 enum lto_linker_output
{
412 LTO_LINKER_OUTPUT_UNKNOWN
,
413 LTO_LINKER_OUTPUT_REL
,
414 LTO_LINKER_OUTPUT_NOLTOREL
,
415 LTO_LINKER_OUTPUT_DYN
,
416 LTO_LINKER_OUTPUT_PIE
,
417 LTO_LINKER_OUTPUT_EXEC
420 /* gfortran -finit-real= values. */
422 enum gfc_init_local_real
424 GFC_INIT_REAL_OFF
= 0,
429 GFC_INIT_REAL_NEG_INF
432 /* gfortran -fcoarray= values. */
436 GFC_FCOARRAY_NONE
= 0,
442 /* gfortran -fconvert= values; used for unformatted I/O.
443 Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
446 GFC_FLAG_CONVERT_NATIVE
= 0,
447 GFC_FLAG_CONVERT_SWAP
,
448 GFC_FLAG_CONVERT_BIG
,
449 GFC_FLAG_CONVERT_LITTLE
,
450 GFC_FLAG_CONVERT_R16_IEEE
= 4,
451 GFC_FLAG_CONVERT_R16_IEEE_SWAP
,
452 GFC_FLAG_CONVERT_R16_IEEE_BIG
,
453 GFC_FLAG_CONVERT_R16_IEEE_LITTLE
,
454 GFC_FLAG_CONVERT_R16_IBM
= 8,
455 GFC_FLAG_CONVERT_R16_IBM_SWAP
,
456 GFC_FLAG_CONVERT_R16_IBM_BIG
,
457 GFC_FLAG_CONVERT_R16_IBM_LITTLE
,
461 /* gfortran -finline-intrinsics= values;
462 We use two identical bits for each value, and initialize with alternated
463 bits, so that we can check whether a value has been set by checking whether
464 the two bits have identical value. */
466 #define GFC_INL_INTR_VAL(idx) (3 << (2 * idx))
467 #define GFC_INL_INTR_UNSET_VAL(val) (0x55555555 & (val))
469 enum gfc_inlineable_intrinsics
471 GFC_FLAG_INLINE_INTRINSIC_NONE
= 0,
472 GFC_FLAG_INLINE_INTRINSIC_MAXLOC
= GFC_INL_INTR_VAL (0),
473 GFC_FLAG_INLINE_INTRINSIC_MINLOC
= GFC_INL_INTR_VAL (1),
474 GFC_FLAG_INLINE_INTRINSIC_ALL
= GFC_FLAG_INLINE_INTRINSIC_MAXLOC
475 | GFC_FLAG_INLINE_INTRINSIC_MINLOC
,
477 GFC_FLAG_INLINE_INTRINSIC_NONE_UNSET
478 = GFC_INL_INTR_UNSET_VAL (GFC_FLAG_INLINE_INTRINSIC_NONE
),
479 GFC_FLAG_INLINE_INTRINSIC_MAXLOC_UNSET
480 = GFC_INL_INTR_UNSET_VAL (GFC_FLAG_INLINE_INTRINSIC_MAXLOC
),
481 GFC_FLAG_INLINE_INTRINSIC_MINLOC_UNSET
482 = GFC_INL_INTR_UNSET_VAL (GFC_FLAG_INLINE_INTRINSIC_MINLOC
),
483 GFC_FLAG_INLINE_INTRINSIC_ALL_UNSET
484 = GFC_INL_INTR_UNSET_VAL (GFC_FLAG_INLINE_INTRINSIC_ALL
)
487 #undef GFC_INL_INTR_UNSET_VAL
488 #undef GFC_INL_INTR_VAL
491 /* Inline String Operations functions. */
495 ILSOP_MEMSET
= 1 << 0,
496 ILSOP_MEMCPY
= 1 << 1,
497 ILSOP_MEMMOVE
= 1 << 2,
498 ILSOP_MEMCMP
= 1 << 3,
502 /* Control-Flow Protection values. */
503 enum cf_protection_level
508 CF_FULL
= CF_BRANCH
| CF_RETURN
,
513 /* Parloops schedule type. */
514 enum parloops_schedule_type
516 PARLOOPS_SCHEDULE_STATIC
= 0,
517 PARLOOPS_SCHEDULE_DYNAMIC
,
518 PARLOOPS_SCHEDULE_GUIDED
,
519 PARLOOPS_SCHEDULE_AUTO
,
520 PARLOOPS_SCHEDULE_RUNTIME
523 /* Ranger debug mode. */
526 RANGER_DEBUG_NONE
= 0,
527 RANGER_DEBUG_TRACE
= 1,
528 RANGER_DEBUG_CACHE
= 2,
529 RANGER_DEBUG_GORI
= 4,
530 RANGER_DEBUG_TRACE_GORI
= (RANGER_DEBUG_TRACE
| RANGER_DEBUG_GORI
),
531 RANGER_DEBUG_TRACE_CACHE
= (RANGER_DEBUG_TRACE
| RANGER_DEBUG_CACHE
),
532 RANGER_DEBUG_ALL
= (RANGER_DEBUG_GORI
| RANGER_DEBUG_CACHE
533 | RANGER_DEBUG_TRACE
)
536 /* Jump threader verbose dumps. */
539 THREADER_DEBUG_NONE
= 0,
540 THREADER_DEBUG_ALL
= 1
543 /* Modes of OpenACC 'kernels' constructs handling. */
546 OPENACC_KERNELS_DECOMPOSE
,
547 OPENACC_KERNELS_PARLOOPS
550 /* Modes of OpenACC privatization diagnostics. */
551 enum openacc_privatization
553 OPENACC_PRIVATIZATION_QUIET
,
554 OPENACC_PRIVATIZATION_NOISY
557 /* Targets for -fopenmp-target-simd-clone. */
558 enum omp_target_simd_clone_device_kind
560 OMP_TARGET_SIMD_CLONE_NONE
= 0,
561 OMP_TARGET_SIMD_CLONE_HOST
= 1,
562 OMP_TARGET_SIMD_CLONE_NOHOST
= 2,
563 OMP_TARGET_SIMD_CLONE_ANY
= 3
568 #endif /* ! GCC_FLAG_TYPES_H */