using (inline) assembler code, special address spaces are needed.
@table @code
-@item __flash
@cindex @code{__flash} AVR Named Address Spaces
+@item __flash
The @code{__flash} qualifier locates data in the
@code{.progmem.data} section. Data is read using the @code{LPM}
instruction. Pointers to this address space are 16 bits wide.
-@item __flash1
-@itemx __flash2
-@itemx __flash3
-@itemx __flash4
-@itemx __flash5
@cindex @code{__flash1} AVR Named Address Spaces
@cindex @code{__flash2} AVR Named Address Spaces
@cindex @code{__flash3} AVR Named Address Spaces
@cindex @code{__flash4} AVR Named Address Spaces
@cindex @code{__flash5} AVR Named Address Spaces
+@item __flash1
+@itemx __flash2
+@itemx __flash3
+@itemx __flash4
+@itemx __flash5
These are 16-bit address spaces locating data in section
@code{.progmem@var{N}.data} where @var{N} refers to
address space @code{__flash@var{N}}.
The compiler sets the @code{RAMPZ} segment register appropriately
before reading data by means of the @code{ELPM} instruction.
-@item __memx
@cindex @code{__memx} AVR Named Address Spaces
+@item __memx
This is a 24-bit address space that linearizes flash and RAM:
If the high bit of the address is set, data is read from
RAM using the lower two bytes as RAM address.
to the @code{%fs} or @code{%gs} segments.
@table @code
-@item __seg_fs
-@itemx __seg_gs
@cindex @code{__seg_fs} x86 named address space
@cindex @code{__seg_gs} x86 named address space
+@item __seg_fs
+@itemx __seg_gs
The object is accessed with the respective segment override prefix.
The respective segment base must be set via some method specific to
a pointer argument. See the @code{nonnull} attribute for more information and
caveats.
-@item alias ("@var{target}")
@cindex @code{alias} function attribute
+@item alias ("@var{target}")
The @code{alias} attribute causes the declaration to be emitted as an alias
for another symbol, which must have been previously declared with the same
type, and for variables, also the same size and alignment. Declaring an alias
This attribute requires assembler and object file support,
and may not be available on all targets.
+@cindex @code{aligned} function attribute
@item aligned
@itemx aligned (@var{alignment})
-@cindex @code{aligned} function attribute
The @code{aligned} attribute specifies a minimum alignment for
the first instruction of the function, measured in bytes. When specified,
@var{alignment} must be an integer constant power of 2. Specifying no
The @code{aligned} attribute can also be used for variables and fields
(@pxref{Variable Attributes}.)
-@item alloc_align (@var{position})
@cindex @code{alloc_align} function attribute
+@item alloc_align (@var{position})
The @code{alloc_align} attribute may be applied to a function that
returns a pointer and takes at least one argument of an integer or
enumerated type.
declares that @code{my_memalign} returns memory with minimum alignment
given by parameter 1.
+@cindex @code{alloc_size} function attribute
@item alloc_size (@var{position})
@itemx alloc_size (@var{position-1}, @var{position-2})
-@cindex @code{alloc_size} function attribute
The @code{alloc_size} attribute may be applied to a function that
returns a pointer and takes at least one argument of an integer or
enumerated type.
the product of parameter 1 and 2 and that @code{my_realloc} returns memory
of the size given by parameter 2.
-@item always_inline
@cindex @code{always_inline} function attribute
+@item always_inline
Generally, functions are not inlined unless optimization is specified.
For functions declared inline, this attribute inlines the function
independent of any restrictions that otherwise apply to inlining.
or may not inline it depending on optimization level and a failure
to inline an indirect call may or may not be diagnosed.
-@item artificial
@cindex @code{artificial} function attribute
+@item artificial
This attribute is useful for small inline wrappers that if possible
should appear during debugging as a unit. Depending on the debug
info format it either means marking the function as artificial
or using the caller location for all instructions within the inlined
body.
+@cindex @code{assume_aligned} function attribute
@item assume_aligned (@var{alignment})
@itemx assume_aligned (@var{alignment}, @var{offset})
-@cindex @code{assume_aligned} function attribute
The @code{assume_aligned} attribute may be applied to a function that
returns a pointer. It indicates that the returned pointer is aligned
on a boundary given by @var{alignment}. If the attribute has two
that @code{my_alloc2} returns a pointer whose value modulo 32 is equal
to 8.
-@item cold
@cindex @code{cold} function attribute
+@item cold
The @code{cold} attribute on functions is used to inform the compiler that
the function is unlikely to be executed. The function is optimized for
size rather than speed and on many targets it is placed into a special
When profile feedback is available, via @option{-fprofile-use}, cold functions
are automatically detected and this attribute is ignored.
-@item const
@cindex @code{const} function attribute
@cindex functions that have no side effects
+@item const
Calls to functions whose return value is not affected by changes to
the observable state of the program and that have no observable effects
on such state other than to return a value may lend themselves to
in C++, reference arguments. Likewise, a function that calls a non-const
function usually must not be const itself.
+@cindex @code{constructor} function attribute
+@cindex @code{destructor} function attribute
@item constructor
@itemx destructor
@itemx constructor (@var{priority})
@itemx destructor (@var{priority})
-@cindex @code{constructor} function attribute
-@cindex @code{destructor} function attribute
The @code{constructor} attribute causes the function to be called
automatically before execution enters @code{main ()}. Similarly, the
@code{destructor} attribute causes the function to be called
attributes on targets where the feature is not supported is rejected with
an error.
+@cindex @code{copy} function attribute
@item copy
@itemx copy (@var{function})
-@cindex @code{copy} function attribute
The @code{copy} attribute applies the set of attributes with which
@var{function} has been declared to the declaration of the function
to which the attribute is applied. The attribute is designed for
StrongAlias (allocate, alloc);
@end smallexample
+@cindex @code{deprecated} function attribute
@item deprecated
@itemx deprecated (@var{msg})
-@cindex @code{deprecated} function attribute
The @code{deprecated} attribute results in a warning if the function
is used anywhere in the source file. This is useful when identifying
functions that are expected to be removed in a future version of a
The message attached to the attribute is affected by the setting of
the @option{-fmessage-length} option.
+@cindex @code{unavailable} function attribute
@item unavailable
@itemx unavailable (@var{msg})
-@cindex @code{unavailable} function attribute
The @code{unavailable} attribute results in an error if the function
is used anywhere in the source file. This is useful when identifying
functions that have been removed from a particular variation of an
The @code{unavailable} attribute can also be used for variables and
types (@pxref{Variable Attributes}, @pxref{Type Attributes}.)
-@item error ("@var{message}")
-@itemx warning ("@var{message}")
@cindex @code{error} function attribute
@cindex @code{warning} function attribute
+@item error ("@var{message}")
+@itemx warning ("@var{message}")
If the @code{error} or @code{warning} attribute
is used on a function declaration and a call to such a function
is not eliminated through dead code elimination or other optimizations,
earlier and with exact location of the call even in presence of inline
functions or when not emitting debugging information.
-@item externally_visible
@cindex @code{externally_visible} function attribute
+@item externally_visible
This attribute, attached to a global variable or function, nullifies
the effect of the @option{-fwhole-program} command-line option, so the
object remains visible outside the current compilation unit.
For other linkers that cannot generate resolution file,
explicit @code{externally_visible} attributes are still necessary.
+@cindex @code{fd_arg} function attribute
@item fd_arg
@itemx fd_arg (@var{N})
-@cindex @code{fd_arg} function attribute
The @code{fd_arg} attribute may be applied to a function that takes an open
file descriptor at referenced argument @var{N}.
which a function with this attribute is called with a file descriptor that has
not been checked for validity.
+@cindex @code{fd_arg_read} function attribute
@item fd_arg_read
@itemx fd_arg_read (@var{N})
-@cindex @code{fd_arg_read} function attribute
The @code{fd_arg_read} is identical to @code{fd_arg}, but with the additional
requirement that it might read from the file descriptor, and thus, the file
descriptor must not have been opened as write-only.
diagnostic if it detects a code path in which a function with this
attribute is called on a file descriptor opened with @code{O_WRONLY}.
+@cindex @code{fd_arg_write} function attribute
@item fd_arg_write
@itemx fd_arg_write (@var{N})
-@cindex @code{fd_arg_write} function attribute
The @code{fd_arg_write} is identical to @code{fd_arg_read} except that the
analyzer may emit a @option{-Wanalyzer-access-mode-mismatch} diagnostic if
it detects a code path in which a function with this attribute is called on a
file descriptor opened with @code{O_RDONLY}.
-@item flatten
@cindex @code{flatten} function attribute
+@item flatten
Generally, inlining into a function is limited. For a function marked with
this attribute, every call inside this function is inlined, if possible.
Functions declared with attribute @code{noinline} and similar are not
inlined. Whether the function itself is considered for inlining depends
on its size and the current inlining parameters.
-@item format (@var{archetype}, @var{string-index}, @var{first-to-check})
@cindex @code{format} function attribute
@cindex functions with @code{printf}, @code{scanf}, @code{strftime} or @code{strfmon} style arguments
@opindex Wformat
+@item format (@var{archetype}, @var{string-index}, @var{first-to-check})
The @code{format} attribute specifies that a function takes @code{printf},
@code{scanf}, @code{strftime} or @code{strfmon} style arguments that
should be type-checked against a format string. For example, the
@xref{Target Format Checks,,Format Checks Specific to Particular
Target Machines}.
-@item format_arg (@var{string-index})
@cindex @code{format_arg} function attribute
@opindex Wformat-nonliteral
+@item format_arg (@var{string-index})
The @code{format_arg} attribute specifies that a function takes one or
more format strings for a @code{printf}, @code{scanf}, @code{strftime} or
@code{strfmon} style function and modifies it (for example, to translate
@xref{Target Format Checks,,Format Checks Specific to Particular
Target Machines}.
-@item gnu_inline
@cindex @code{gnu_inline} function attribute
+@item gnu_inline
This attribute should be used with a function that is also declared
with the @code{inline} keyword. It directs GCC to treat the function
as if it were defined in gnu90 mode even when compiling in C99 or
but it still requires the @code{inline} keyword to enable its special
behavior.
-@item hot
@cindex @code{hot} function attribute
+@item hot
The @code{hot} attribute on a function is used to inform the compiler that
the function is a hot spot of the compiled program. The function is
optimized more aggressively and on many targets it is placed into a special
When profile feedback is available, via @option{-fprofile-use}, hot functions
are automatically detected and this attribute is ignored.
-@item ifunc ("@var{resolver}")
@cindex @code{ifunc} function attribute
@cindex indirect functions
@cindex functions that are dynamically resolved
+@item ifunc ("@var{resolver}")
The @code{ifunc} attribute is used to mark a function as an indirect
function using the STT_GNU_IFUNC symbol type extension to the ELF
standard. This allows the resolution of the symbol value to be
functions. The exact syntax and behavior are target-specific;
refer to the following subsections for details.
-@item leaf
@cindex @code{leaf} function attribute
+@item leaf
Calls to external functions with this attribute must return to the
current compilation unit only by return or by exception handling. In
particular, a leaf function is not allowed to invoke callback functions
this reason the attribute is not allowed on types to annotate indirect
calls.
+@cindex @code{malloc} function attribute
+@cindex functions that behave like malloc
@item malloc
@item malloc (@var{deallocator})
@item malloc (@var{deallocator}, @var{ptr-index})
-@cindex @code{malloc} function attribute
-@cindex functions that behave like malloc
Attribute @code{malloc} indicates that a function is @code{malloc}-like,
i.e., that the pointer @var{P} returned by the function cannot alias any
other pointer valid when the function returns, and moreover no
a @option{-Wanalyzer-possible-null-argument} diagnostic for code paths
in which the deallocator is called with NULL.
-@item no_icf
@cindex @code{no_icf} function attribute
+@item no_icf
This function attribute prevents a functions from being merged with another
semantically equivalent function.
-@item no_instrument_function
@cindex @code{no_instrument_function} function attribute
@opindex finstrument-functions
@opindex p
@opindex pg
+@item no_instrument_function
If any of @option{-finstrument-functions}, @option{-p}, or @option{-pg} are
given, profiling function calls are
generated at entry and exit of most user-compiled functions.
Functions with this attribute are not so instrumented.
-@item no_profile_instrument_function
@cindex @code{no_profile_instrument_function} function attribute
+@item no_profile_instrument_function
The @code{no_profile_instrument_function} attribute on functions is used
to inform the compiler that it should not process any profile feedback based
optimization code instrumentation.
-@item no_reorder
@cindex @code{no_reorder} function attribute
+@item no_reorder
Do not reorder functions or variables marked @code{no_reorder}
against each other or top level assembler statements the executable.
The actual order in the program will depend on the linker command
as the @option{-fno-toplevel-reorder} option, but only applies to the
marked symbols.
-@item no_sanitize ("@var{sanitize_option}")
@cindex @code{no_sanitize} function attribute
+@item no_sanitize ("@var{sanitize_option}")
The @code{no_sanitize} attribute on functions is used
to inform the compiler that it should not do sanitization of any option
mentioned in @var{sanitize_option}. A list of values acceptable by
g () @{ /* @r{Do something.} */; @}
@end smallexample
+@cindex @code{no_sanitize_address} function attribute
@item no_sanitize_address
@itemx no_address_safety_analysis
-@cindex @code{no_sanitize_address} function attribute
The @code{no_sanitize_address} attribute on functions is used
to inform the compiler that it should not instrument memory accesses
in the function when compiling with the @option{-fsanitize=address} option.
@code{no_sanitize_address} attribute, new code should use
@code{no_sanitize_address}.
-@item no_sanitize_thread
@cindex @code{no_sanitize_thread} function attribute
+@item no_sanitize_thread
The @code{no_sanitize_thread} attribute on functions is used
to inform the compiler that it should not instrument memory accesses
in the function when compiling with the @option{-fsanitize=thread} option.
-@item no_sanitize_undefined
@cindex @code{no_sanitize_undefined} function attribute
+@item no_sanitize_undefined
The @code{no_sanitize_undefined} attribute on functions is used
to inform the compiler that it should not check for undefined behavior
in the function when compiling with the @option{-fsanitize=undefined} option.
-@item no_sanitize_coverage
@cindex @code{no_sanitize_coverage} function attribute
+@item no_sanitize_coverage
The @code{no_sanitize_coverage} attribute on functions is used
to inform the compiler that it should not do coverage-guided
fuzzing code instrumentation (@option{-fsanitize-coverage}).
-@item no_split_stack
@cindex @code{no_split_stack} function attribute
@opindex fsplit-stack
+@item no_split_stack
If @option{-fsplit-stack} is given, functions have a small
prologue which decides whether to split the stack. Functions with the
@code{no_split_stack} attribute do not have that prologue, and thus
may run with only a small amount of stack space available.
-@item no_stack_limit
@cindex @code{no_stack_limit} function attribute
+@item no_stack_limit
This attribute locally overrides the @option{-fstack-limit-register}
and @option{-fstack-limit-symbol} command-line options; it has the effect
of disabling stack limit checking in the function it applies to.
-@item noclone
@cindex @code{noclone} function attribute
+@item noclone
This function attribute prevents a function from being considered for
cloning---a mechanism that produces specialized copies of functions
and which is (currently) performed by interprocedural constant
propagation.
-@item noinline
@cindex @code{noinline} function attribute
+@item noinline
This function attribute prevents a function from being considered for
inlining.
@c Don't enumerate the optimizations by name here; we try to be
(@pxref{Extended Asm}) in the called function, to serve as a special
side effect.
-@item noipa
@cindex @code{noipa} function attribute
+@item noipa
Disable interprocedural optimizations between the function with this
attribute and its callers, as if the body of the function is not available
when optimizing callers and the callers are unavailable when optimizing
them individually. This attribute is supported mainly for the purpose
of testing the compiler.
-@item nonnull
-@itemx nonnull (@var{arg-index}, @dots{})
@cindex @code{nonnull} function attribute
@cindex functions with non-null pointer arguments
+@item nonnull
+@itemx nonnull (@var{arg-index}, @dots{})
The @code{nonnull} attribute may be applied to a function that takes at
least one argument of a pointer type. It indicates that the referenced
arguments must be non-null pointers. For instance, the declaration:
__attribute__((nonnull));
@end smallexample
-@item noplt
@cindex @code{noplt} function attribute
+@item noplt
The @code{noplt} attribute is the counterpart to option @option{-fno-plt}.
Calls to functions marked with this attribute in position-independent code
do not use the PLT.
In position-dependent code, a few targets also convert calls to
functions that are marked to not use the PLT to use the GOT instead.
-@item noreturn
@cindex @code{noreturn} function attribute
@cindex functions that never return
+@item noreturn
A few standard library functions, such as @code{abort} and @code{exit},
cannot return. GCC knows this automatically. Some programs define
their own functions that never return. You can declare them
It does not make sense for a @code{noreturn} function to have a return
type other than @code{void}.
-@item nothrow
@cindex @code{nothrow} function attribute
+@item nothrow
The @code{nothrow} attribute is used to inform the compiler that a
function cannot throw an exception. For example, most functions in
the standard C library can be guaranteed not to throw an exception
with the notable exceptions of @code{qsort} and @code{bsearch} that
take function pointer arguments.
+@cindex @code{optimize} function attribute
@item optimize (@var{level}, @dots{})
@item optimize (@var{string}, @dots{})
-@cindex @code{optimize} function attribute
The @code{optimize} attribute is used to specify that a function is to
be compiled with different optimization options than specified on the
command line. The optimize attribute arguments of a function behave
The @code{optimize} attribute should be used for debugging purposes only.
It is not suitable in production code.
-@item patchable_function_entry
@cindex @code{patchable_function_entry} function attribute
@cindex extra NOP instructions at the function entry point
+@item patchable_function_entry
In case the target's text segment can be made writable at run time by
any means, padding the function entry with a number of NOPs can be
used to provide a universal tool for instrumentation.
framework with the attribute @code{patchable_function_entry (0)}
to prevent recursion.
-@item pure
@cindex @code{pure} function attribute
@cindex functions that have no side effects
+@item pure
Calls to functions that have no observable effects on the state of
the program other than to return a value may lend themselves to optimizations
effects it does not make sense for such a function to return @code{void}.
Declaring such a function is diagnosed.
-@item returns_nonnull
@cindex @code{returns_nonnull} function attribute
+@item returns_nonnull
The @code{returns_nonnull} attribute specifies that the function
return value should be a non-null pointer. For instance, the declaration:
lets the compiler optimize callers based on the knowledge
that the return value will never be null.
-@item returns_twice
@cindex @code{returns_twice} function attribute
@cindex functions that return more than once
+@item returns_twice
The @code{returns_twice} attribute tells the compiler that a function may
return more than one time. The compiler ensures that all registers
are dead before calling such a function and emits a warning about
The @code{longjmp}-like counterpart of such function, if any, might need
to be marked with the @code{noreturn} attribute.
-@item section ("@var{section-name}")
@cindex @code{section} function attribute
@cindex functions in arbitrary sections
+@item section ("@var{section-name}")
Normally, the compiler places the code it generates in the @code{text} section.
Sometimes, however, you need additional sections, or you need certain
particular functions to appear in special sections. The @code{section}
If you need to map the entire contents of a module to a particular
section, consider using the facilities of the linker instead.
+@cindex @code{sentinel} function attribute
@item sentinel
@itemx sentinel (@var{position})
-@cindex @code{sentinel} function attribute
This function attribute indicates that an argument in a call to the function
is expected to be an explicit @code{NULL}. The attribute is only valid on
variadic functions. By default, the sentinel is expected to be the last
The warnings for missing or incorrect sentinels are enabled with
@option{-Wformat}.
+@cindex @code{simd} function attribute
@item simd
@itemx simd("@var{mask}")
-@cindex @code{simd} function attribute
This attribute enables creation of one or more function versions that
can process multiple arguments using SIMD instructions from a
single invocation. Specifying this attribute allows compiler to
present on a declaration and the @option{-fopenmp} or @option{-fopenmp-simd}
switch is specified, then the attribute is ignored.
-@item stack_protect
@cindex @code{stack_protect} function attribute
+@item stack_protect
This attribute adds stack protection code to the function if
flags @option{-fstack-protector}, @option{-fstack-protector-strong}
or @option{-fstack-protector-explicit} are set.
-@item no_stack_protector
@cindex @code{no_stack_protector} function attribute
+@item no_stack_protector
This attribute prevents stack protection code for the function.
-@item target (@var{string}, @dots{})
@cindex @code{target} function attribute
+@item target (@var{string}, @dots{})
Multiple target back ends implement the @code{target} attribute
to specify that a function is to
be compiled with different target options than specified on the
@ref{Nios II Function Attributes}, and @ref{S/390 Function Attributes}
for details.
-@item symver ("@var{name2}@@@var{nodename}")
@cindex @code{symver} function attribute
+@item symver ("@var{name2}@@@var{nodename}")
On ELF targets this attribute creates a symbol version. The @var{name2} part
of the parameter is the actual name of the symbol by which it will be
externally referenced. The @code{nodename} portion should be the name of a
@code{"@var{name2}@@@var{nodename}"} was used) the version will be also used
to resolve @var{name2} by the linker.
-@item tainted_args
@cindex @code{tainted_args} function attribute
+@item tainted_args
The @code{tainted_args} attribute is used to specify that a function is called
in a way that requires sanitization of its arguments, such as a system
call in an operating system kernel. Such a function can be considered part
@option{-Wanalyzer-tainted-offset},
and @option{-Wanalyzer-tainted-size}.
-@item target_clones (@var{options})
@cindex @code{target_clones} function attribute
+@item target_clones (@var{options})
The @code{target_clones} attribute is used to specify that a function
be cloned into multiple versions compiled with different target options
than specified on the command line. The supported options and restrictions
If you want to enforce such behaviour,
we recommend declaring the calling function with the @code{flatten} attribute?
-@item unused
@cindex @code{unused} function attribute
+@item unused
This attribute, attached to a function, means that the function is meant
to be possibly unused. GCC does not produce a warning for this
function.
-@item used
@cindex @code{used} function attribute
+@item used
This attribute, attached to a function, means that code must be emitted
for the function even if it appears that the function is not referenced.
This is useful, for example, when the function is referenced only in
attribute also means that the function is instantiated if the
class itself is instantiated.
-@item retain
@cindex @code{retain} function attribute
+@item retain
For ELF targets that support the GNU or FreeBSD OSABIs, this attribute
will save the function from linker garbage collection. To support
this behavior, functions that have not been placed in specific sections
This additional functionality requires Binutils version 2.36 or later.
-@item visibility ("@var{visibility_type}")
@cindex @code{visibility} function attribute
+@item visibility ("@var{visibility_type}")
This attribute affects the linkage of the declaration to which it is attached.
It can be applied to variables (@pxref{Common Variable Attributes}) and types
(@pxref{Common Type Attributes}) as well as functions.
If both the template and enclosing class have explicit visibility, the
visibility from the template is used.
-@item warn_unused_result
@cindex @code{warn_unused_result} function attribute
+@item warn_unused_result
The @code{warn_unused_result} attribute causes a warning to be emitted
if a caller of the function with this attribute does not use its
return value. This is useful for functions where not checking
@noindent
results in warning on line 5.
-@item weak
@cindex @code{weak} function attribute
+@item weak
The @code{weak} attribute causes a declaration of an external symbol
to be emitted as a weak symbol rather than a global. This is primarily
useful in defining library functions that can be overridden in user code,
the weak symbol. Weak symbols are supported for ELF targets, and also
for a.out targets when using the GNU assembler and linker.
+@cindex @code{weakref} function attribute
@item weakref
@itemx weakref ("@var{target}")
-@cindex @code{weakref} function attribute
The @code{weakref} attribute marks a declaration as a weak reference.
Without arguments, it should be accompanied by an @code{alias} attribute
naming the target symbol. Alternatively, @var{target} may be given as
A declaration to which @code{weakref} is attached and that is associated
with a named @code{target} must be @code{static}.
-@item zero_call_used_regs ("@var{choice}")
@cindex @code{zero_call_used_regs} function attribute
+@item zero_call_used_regs ("@var{choice}")
The @code{zero_call_used_regs} attribute causes the compiler to zero
a subset of all call-used registers@footnote{A ``call-used'' register
per-function basis.
@table @code
-@item general-regs-only
@cindex @code{general-regs-only} function attribute, AArch64
+@item general-regs-only
Indicates that no floating-point or Advanced SIMD registers should be
used when generating code for this function. If the function explicitly
uses floating-point code, then the compiler gives an error. This is
the same behavior as that of the command-line option
@option{-mgeneral-regs-only}.
-@item fix-cortex-a53-835769
@cindex @code{fix-cortex-a53-835769} function attribute, AArch64
+@item fix-cortex-a53-835769
Indicates that the workaround for the Cortex-A53 erratum 835769 should be
applied to this function. To explicitly disable the workaround for this
function specify the negated form: @code{no-fix-cortex-a53-835769}.
This corresponds to the behavior of the command line options
@option{-mfix-cortex-a53-835769} and @option{-mno-fix-cortex-a53-835769}.
-@item cmodel=
@cindex @code{cmodel=} function attribute, AArch64
+@item cmodel=
Indicates that code should be generated for a particular code model for
this function. The behavior and permissible arguments are the same as
for the command line option @option{-mcmodel=}.
+@cindex @code{strict-align} function attribute, AArch64
@item strict-align
@itemx no-strict-align
-@cindex @code{strict-align} function attribute, AArch64
@code{strict-align} indicates that the compiler should not assume that unaligned
memory references are handled by the system. To allow the compiler to assume
that aligned memory references are handled by the system, the inverse attribute
@code{no-strict-align} can be specified. The behavior is same as for the
command-line option @option{-mstrict-align} and @option{-mno-strict-align}.
-@item omit-leaf-frame-pointer
@cindex @code{omit-leaf-frame-pointer} function attribute, AArch64
+@item omit-leaf-frame-pointer
Indicates that the frame pointer should be omitted for a leaf function call.
To keep the frame pointer, the inverse attribute
@code{no-omit-leaf-frame-pointer} can be specified. These attributes have
the same behavior as the command-line options @option{-momit-leaf-frame-pointer}
and @option{-mno-omit-leaf-frame-pointer}.
-@item tls-dialect=
@cindex @code{tls-dialect=} function attribute, AArch64
+@item tls-dialect=
Specifies the TLS dialect to use for this function. The behavior and
permissible arguments are the same as for the command-line option
@option{-mtls-dialect=}.
-@item arch=
@cindex @code{arch=} function attribute, AArch64
+@item arch=
Specifies the architecture version and architectural extensions to use
for this function. The behavior and permissible arguments are the same as
for the @option{-march=} command-line option.
-@item tune=
@cindex @code{tune=} function attribute, AArch64
+@item tune=
Specifies the core for which to tune the performance of this function.
The behavior and permissible arguments are the same as for the @option{-mtune=}
command-line option.
-@item cpu=
@cindex @code{cpu=} function attribute, AArch64
+@item cpu=
Specifies the core for which to tune the performance of this function and also
whose architectural features to use. The behavior and valid arguments are the
same as for the @option{-mcpu=} command-line option.
-@item sign-return-address
@cindex @code{sign-return-address} function attribute, AArch64
+@item sign-return-address
Select the function scope on which return address signing will be applied. The
behavior and permissible arguments are the same as for the command-line option
@option{-msign-return-address=}. The default value is @code{none}. This
attribute is deprecated. The @code{branch-protection} attribute should
be used instead.
-@item branch-protection
@cindex @code{branch-protection} function attribute, AArch64
+@item branch-protection
Select the function scope on which branch protection will be applied. The
behavior and permissible arguments are the same as for the command-line option
@option{-mbranch-protection=}. The default value is @code{none}.
-@item outline-atomics
@cindex @code{outline-atomics} function attribute, AArch64
+@item outline-atomics
Enable or disable calls to out-of-line helpers to implement atomic operations.
This corresponds to the behavior of the command line options
@option{-moutline-atomics} and @option{-mno-outline-atomics}.
These function attributes are supported by the AMD GCN back end:
@table @code
-@item amdgpu_hsa_kernel
@cindex @code{amdgpu_hsa_kernel} function attribute, AMD GCN
+@item amdgpu_hsa_kernel
This attribute indicates that the corresponding function should be compiled as
a kernel function, that is an entry point that can be invoked from the host
via the HSA runtime library. By default functions are only callable only from
These function attributes are supported by the ARC back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, ARC
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
@w{@code{ilink2}} for ARCv1 architecture, and @w{@code{ilink}} and
@w{@code{firq}} for ARCv2 architecture.
-@item long_call
-@itemx medium_call
-@itemx short_call
@cindex @code{long_call} function attribute, ARC
@cindex @code{medium_call} function attribute, ARC
@cindex @code{short_call} function attribute, ARC
@cindex indirect calls, ARC
+@item long_call
+@itemx medium_call
+@itemx short_call
These attributes specify how a particular function is called.
These attributes override the
@option{-mlong-calls} and @option{-mmedium-calls} (@pxref{ARC Options})
branch-and-link instruction, which has a 21-bit offset from
the call site.
-@item jli_always
@cindex @code{jli_always} function attribute, ARC
+@item jli_always
Forces a particular function to be called using @code{jli}
instruction. The @code{jli} instruction makes use of a table stored
into @code{.jlitab} section, which holds the location of the functions
which are addressed using this instruction.
-@item jli_fixed
@cindex @code{jli_fixed} function attribute, ARC
+@item jli_fixed
Identical like the above one, but the location of the function in the
@code{jli} table is known and given as an attribute parameter.
-@item secure_call
@cindex @code{secure_call} function attribute, ARC
+@item secure_call
This attribute allows one to mark secure-code functions that are
callable from normal mode. The location of the secure call function
into the @code{sjli} table needs to be passed as argument.
-@item naked
@cindex @code{naked} function attribute, ARC
+@item naked
This attribute allows the compiler to construct the requisite function
declaration, while allowing the body of the function to be assembly
code. The specified function will not have prologue/epilogue
@table @code
-@item general-regs-only
@cindex @code{general-regs-only} function attribute, ARM
+@item general-regs-only
Indicates that no floating-point or Advanced SIMD registers should be
used when generating code for this function. If the function explicitly
uses floating-point code, then the compiler gives an error. This is
the same behavior as that of the command-line option
@option{-mgeneral-regs-only}.
-@item interrupt
@cindex @code{interrupt} function attribute, ARM
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
On ARMv7-M the interrupt type is ignored, and the attribute means the function
may be called with a word-aligned stack pointer.
-@item isr
@cindex @code{isr} function attribute, ARM
+@item isr
Use this attribute on ARM to write Interrupt Service Routines. This is an
alias to the @code{interrupt} attribute above.
-@item long_call
-@itemx short_call
@cindex @code{long_call} function attribute, ARM
@cindex @code{short_call} function attribute, ARM
@cindex indirect calls, ARM
+@item long_call
+@itemx short_call
These attributes specify how a particular function is called.
These attributes override the
@option{-mlong-calls} (@pxref{ARM Options})
the offset to the function from the call site into the @samp{BL}
instruction directly.
-@item naked
@cindex @code{naked} function attribute, ARM
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item pcs
@cindex @code{pcs} function attribute, ARM
+@item pcs
The @code{pcs} attribute can be used to control the calling convention
used for a function on ARM. The attribute takes an argument that specifies
Variadic functions always use the @code{"aapcs"} calling convention and
the compiler rejects attempts to specify an alternative.
-@item target (@var{options})
@cindex @code{target} function attribute
+@item target (@var{options})
As discussed in @ref{Common Function Attributes}, this attribute
allows specification of target-specific compilation options.
On ARM, the following options are allowed:
@table @samp
-@item thumb
@cindex @code{target("thumb")} function attribute, ARM
+@item thumb
Force code generation in the Thumb (T16/T32) ISA, depending on the
architecture level.
-@item arm
@cindex @code{target("arm")} function attribute, ARM
+@item arm
Force code generation in the ARM (A32) ISA.
Functions from different modes can be inlined in the caller's mode.
-@item fpu=
@cindex @code{target("fpu=")} function attribute, ARM
+@item fpu=
Specifies the fpu for which to tune the performance of this function.
The behavior and permissible arguments are the same as for the @option{-mfpu=}
command-line option.
-@item arch=
@cindex @code{arch=} function attribute, ARM
+@item arch=
Specifies the architecture version and architectural extensions to use
for this function. The behavior and permissible arguments are the same as
for the @option{-march=} command-line option.
These function attributes are supported by the AVR back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, AVR
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
@code{interrupt} are specified for the same function, @code{signal}
is silently ignored.
-@item naked
@cindex @code{naked} function attribute, AVR
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item no_gccisr
@cindex @code{no_gccisr} function attribute, AVR
+@item no_gccisr
Do not use @code{__gcc_isr} pseudo instructions in a function with
the @code{interrupt} or @code{signal} attribute aka. interrupt
service routine (ISR).
To disable @code{__gcc_isr} generation for the whole compilation unit,
there is option @option{-mno-gas-isr-prologues}, @pxref{AVR Options}.
-@item OS_main
-@itemx OS_task
@cindex @code{OS_main} function attribute, AVR
@cindex @code{OS_task} function attribute, AVR
+@item OS_main
+@itemx OS_task
On AVR, functions with the @code{OS_main} or @code{OS_task} attribute
do not save/restore any call-saved register in their prologue/epilogue.
as needed.
@end itemize
-@item signal
@cindex @code{signal} function attribute, AVR
+@item signal
Use this attribute on the AVR to indicate that the specified
function is an interrupt handler. The compiler generates function
entry and exit sequences suitable for use in an interrupt handler when this
@table @code
-@item exception_handler
@cindex @code{exception_handler} function attribute
@cindex exception handler functions, Blackfin
+@item exception_handler
Use this attribute on the Blackfin to indicate that the specified function
is an exception handler. The compiler generates function entry and
exit sequences suitable for use in an exception handler when this
attribute is present.
-@item interrupt_handler
@cindex @code{interrupt_handler} function attribute, Blackfin
+@item interrupt_handler
Use this attribute to
indicate that the specified function is an interrupt handler. The compiler
generates function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
-@item kspisusp
@cindex @code{kspisusp} function attribute, Blackfin
@cindex User stack pointer in interrupts on the Blackfin
+@item kspisusp
When used together with @code{interrupt_handler}, @code{exception_handler}
or @code{nmi_handler}, code is generated to load the stack pointer
from the USP register in the function prologue.
-@item l1_text
@cindex @code{l1_text} function attribute, Blackfin
+@item l1_text
This attribute specifies a function to be placed into L1 Instruction
SRAM@. The function is put into a specific section named @code{.l1.text}.
With @option{-mfdpic}, function calls with a such function as the callee
or caller uses inlined PLT.
-@item l2
@cindex @code{l2} function attribute, Blackfin
+@item l2
This attribute specifies a function to be placed into L2
SRAM. The function is put into a specific section named
@code{.l2.text}. With @option{-mfdpic}, callers of such functions use
an inlined PLT.
-@item longcall
-@itemx shortcall
@cindex indirect calls, Blackfin
@cindex @code{longcall} function attribute, Blackfin
@cindex @code{shortcall} function attribute, Blackfin
+@item longcall
+@itemx shortcall
The @code{longcall} attribute
indicates that the function might be far away from the call site and
require a different (more expensive) calling sequence. The
enough for the shorter calling sequence to be used. These attributes
override the @option{-mlongcall} switch.
-@item nesting
@cindex @code{nesting} function attribute, Blackfin
@cindex Allow nesting in an interrupt handler on the Blackfin processor
+@item nesting
Use this attribute together with @code{interrupt_handler},
@code{exception_handler} or @code{nmi_handler} to indicate that the function
entry code should enable nested interrupts or exceptions.
-@item nmi_handler
@cindex @code{nmi_handler} function attribute, Blackfin
@cindex NMI handler functions on the Blackfin processor
+@item nmi_handler
Use this attribute on the Blackfin to indicate that the specified function
is an NMI handler. The compiler generates function entry and
exit sequences suitable for use in an NMI handler when this
attribute is present.
-@item saveall
@cindex @code{saveall} function attribute, Blackfin
@cindex save all registers on the Blackfin
+@item saveall
Use this attribute to indicate that
all registers except the stack pointer should be saved in the prologue
regardless of whether they are used or not.
These function attributes are supported by the BPF back end:
@table @code
-@item kernel_helper
@cindex @code{kernel helper}, function attribute, BPF
+@item kernel_helper
use this attribute to indicate the specified function declaration is a
kernel helper. The helper function is passed as an argument to the
attribute. Example:
These function attributes are supported by the C-SKY back end:
@table @code
-@item interrupt
-@itemx isr
@cindex @code{interrupt} function attribute, C-SKY
@cindex @code{isr} function attribute, C-SKY
+@item interrupt
+@itemx isr
Use these attributes to indicate that the specified function
is an interrupt handler.
The compiler generates function entry and exit sequences suitable for
to enable support for the necessary interrupt stack instructions. They
are ignored with a warning otherwise. @xref{C-SKY Options}.
-@item naked
@cindex @code{naked} function attribute, C-SKY
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
These function attributes are supported by the Epiphany back end:
@table @code
-@item disinterrupt
@cindex @code{disinterrupt} function attribute, Epiphany
+@item disinterrupt
This attribute causes the compiler to emit
instructions to disable interrupts for the duration of the given
function.
-@item forwarder_section
@cindex @code{forwarder_section} function attribute, Epiphany
+@item forwarder_section
This attribute modifies the behavior of an interrupt handler.
The interrupt handler may be in external memory which cannot be
reached by a branch instruction, so generate a local memory trampoline
to transfer control. The single parameter identifies the section where
the trampoline is placed.
-@item interrupt
@cindex @code{interrupt} function attribute, Epiphany
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
external_dma_handler ();
@end smallexample
-@item long_call
-@itemx short_call
@cindex @code{long_call} function attribute, Epiphany
@cindex @code{short_call} function attribute, Epiphany
@cindex indirect calls, Epiphany
+@item long_call
+@itemx short_call
These attributes specify how a particular function is called.
These attributes override the
@option{-mlong-calls} (@pxref{Adapteva Epiphany Options})
These function attributes are available for H8/300 targets:
@table @code
-@item function_vector
@cindex @code{function_vector} function attribute, H8/300
+@item function_vector
Use this attribute on the H8/300, H8/300H, and H8S to indicate
that the specified function should be called through the function vector.
Calling a function through the function vector reduces code size; however,
and 64 entries on the H8/300H and H8S)
and shares space with the interrupt vector.
-@item interrupt_handler
@cindex @code{interrupt_handler} function attribute, H8/300
+@item interrupt_handler
Use this attribute on the H8/300, H8/300H, and H8S to
indicate that the specified function is an interrupt handler. The compiler
generates function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
-@item saveall
@cindex @code{saveall} function attribute, H8/300
@cindex save all registers on the H8/300, H8/300H, and H8S
+@item saveall
Use this attribute on the H8/300, H8/300H, and H8S to indicate that
all registers except the stack pointer should be saved in the prologue
regardless of whether they are used or not.
These function attributes are supported on IA-64 targets:
@table @code
-@item syscall_linkage
@cindex @code{syscall_linkage} function attribute, IA-64
+@item syscall_linkage
This attribute is used to modify the IA-64 calling convention by marking
all input registers as live at all function exits. This makes it possible
to restart a system call after an interrupt without having to save/restore
the input registers. This also prevents kernel data from leaking into
application code.
-@item version_id
@cindex @code{version_id} function attribute, IA-64
+@item version_id
This IA-64 HP-UX attribute, attached to a global variable or function, renames a
symbol to contain a version string, thus allowing for function level
versioning. HP-UX system header files may use function level versioning
These function attributes are supported by the M32C back end:
@table @code
-@item bank_switch
@cindex @code{bank_switch} function attribute, M32C
+@item bank_switch
When added to an interrupt handler with the M32C port, causes the
prologue and epilogue to use bank switching to preserve the registers
rather than saving them on the stack.
-@item fast_interrupt
@cindex @code{fast_interrupt} function attribute, M32C
+@item fast_interrupt
Use this attribute on the M32C port to indicate that the specified
function is a fast interrupt handler. This is just like the
@code{interrupt} attribute, except that @code{freit} is used to return
instead of @code{reit}.
-@item function_vector
@cindex @code{function_vector} function attribute, M16C/M32C
+@item function_vector
On M16C/M32C targets, the @code{function_vector} attribute declares a
special page subroutine call function. Use of this attribute reduces
the code size by 2 bytes for each call generated to the
This attribute is ignored for R8C target.
-@item interrupt
@cindex @code{interrupt} function attribute, M32C
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
These function attributes are supported by the M32R/D back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, M32R/D
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
when this attribute is present.
-@item model (@var{model-name})
@cindex @code{model} function attribute, M32R/D
@cindex function addressability on the M32R/D
+@item model (@var{model-name})
On the M32R/D, use this attribute to set the addressability of an
object, and of the code generated for a function. The identifier
These function attributes are supported by the m68k back end:
@table @code
-@item interrupt
-@itemx interrupt_handler
@cindex @code{interrupt} function attribute, m68k
@cindex @code{interrupt_handler} function attribute, m68k
+@item interrupt
+@itemx interrupt_handler
Use this attribute to
indicate that the specified function is an interrupt handler. The compiler
generates function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present. Either name may be used.
-@item interrupt_thread
@cindex @code{interrupt_thread} function attribute, fido
+@item interrupt_thread
Use this attribute on fido, a subarchitecture of the m68k, to indicate
that the specified function is an interrupt handler that is designed
to run as a thread. The compiler omits generate prologue/epilogue
These function attributes are supported by the MCORE back end:
@table @code
-@item naked
@cindex @code{naked} function attribute, MCORE
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
These function attributes are supported on MicroBlaze targets:
@table @code
-@item save_volatiles
@cindex @code{save_volatiles} function attribute, MicroBlaze
+@item save_volatiles
Use this attribute to indicate that the function is
an interrupt handler. All volatile registers (in addition to non-volatile
registers) are saved in the function prologue. If the function is a leaf
function, only volatiles used by the function are saved. A normal function
return is generated instead of a return from interrupt.
-@item break_handler
@cindex @code{break_handler} function attribute, MicroBlaze
@cindex break handler functions
+@item break_handler
Use this attribute to indicate that
the specified function is a break handler. The compiler generates function
entry and exit sequences suitable for use in an break handler when this
void f () __attribute__ ((break_handler));
@end smallexample
-@item interrupt_handler
-@itemx fast_interrupt
@cindex @code{interrupt_handler} function attribute, MicroBlaze
@cindex @code{fast_interrupt} function attribute, MicroBlaze
+@item interrupt_handler
+@itemx fast_interrupt
These attributes indicate that the specified function is an interrupt
handler. Use the @code{fast_interrupt} attribute to indicate handlers
used in low-latency interrupt mode, and @code{interrupt_handler} for
targets.
@table @code
-@item dllexport
@cindex @code{dllexport} function attribute
@cindex @code{__declspec(dllexport)}
+@item dllexport
On Microsoft Windows targets and Symbian OS targets the
@code{dllexport} attribute causes the compiler to provide a global
pointer to a pointer in a DLL, so that it can be referenced with the
@file{.def} file with an @code{EXPORTS} section or, with GNU ld, using
the @option{--export-all} linker flag.
-@item dllimport
@cindex @code{dllimport} function attribute
@cindex @code{__declspec(dllimport)}
+@item dllimport
On Microsoft Windows and Symbian OS targets, the @code{dllimport}
attribute causes the compiler to reference a function or variable via
a global pointer to a pointer that is set up by the DLL exporting the
These function attributes are supported by the MIPS back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, MIPS
+@item interrupt
Use this attribute to indicate that the specified function is an interrupt
handler. The compiler generates function entry and exit sequences suitable
for use in an interrupt handler when this attribute is present.
You can use the following attributes to modify the behavior
of an interrupt handler:
@table @code
-@item use_shadow_register_set
@cindex @code{use_shadow_register_set} function attribute, MIPS
+@item use_shadow_register_set
Assume that the handler uses a shadow register set, instead of
the main general-purpose registers. An optional argument @code{intstack} is
supported to indicate that the shadow register set contains a valid stack
pointer.
-@item keep_interrupts_masked
@cindex @code{keep_interrupts_masked} function attribute, MIPS
+@item keep_interrupts_masked
Keep interrupts masked for the whole function. Without this attribute,
GCC tries to reenable interrupts for as much of the function as it can.
-@item use_debug_exception_return
@cindex @code{use_debug_exception_return} function attribute, MIPS
+@item use_debug_exception_return
Return using the @code{deret} instruction. Interrupt handlers that don't
have this attribute return using @code{eret} instead.
@end table
void __attribute__ ((interrupt("vector=hw3"))) v9 ();
@end smallexample
-@item long_call
-@itemx short_call
-@itemx near
-@itemx far
@cindex indirect calls, MIPS
@cindex @code{long_call} function attribute, MIPS
@cindex @code{short_call} function attribute, MIPS
@cindex @code{near} function attribute, MIPS
@cindex @code{far} function attribute, MIPS
+@item long_call
+@itemx short_call
+@itemx near
+@itemx far
These attributes specify how a particular function is called on MIPS@.
The attributes override the @option{-mlong-calls} (@pxref{MIPS Options})
command-line switch. The @code{long_call} and @code{far} attributes are
effect; they specify that non-PIC calls should be made using the more
efficient @code{jal} instruction.
-@item mips16
-@itemx nomips16
@cindex @code{mips16} function attribute, MIPS
@cindex @code{nomips16} function attribute, MIPS
+@item mips16
+@itemx nomips16
On MIPS targets, you can use the @code{mips16} and @code{nomips16}
function attributes to locally select or turn off MIPS16 code generation.
may interact badly with some GCC extensions such as @code{__builtin_apply}
(@pxref{Constructing Calls}).
-@item micromips, MIPS
-@itemx nomicromips, MIPS
@cindex @code{micromips} function attribute
@cindex @code{nomicromips} function attribute
+@item micromips, MIPS
+@itemx nomicromips, MIPS
On MIPS targets, you can use the @code{micromips} and @code{nomicromips}
function attributes to locally select or turn off microMIPS code generation.
may interact badly with some GCC extensions such as @code{__builtin_apply}
(@pxref{Constructing Calls}).
-@item nocompression
@cindex @code{nocompression} function attribute, MIPS
+@item nocompression
On MIPS targets, you can use the @code{nocompression} function attribute
to locally turn off MIPS16 and microMIPS code generation. This attribute
overrides the @option{-mips16} and @option{-mmicromips} options on the
These function attributes are supported by the MSP430 back end:
@table @code
-@item critical
@cindex @code{critical} function attribute, MSP430
+@item critical
Critical functions disable interrupts upon entry and restore the
previous interrupt state upon exit. Critical functions cannot also
have the @code{naked}, @code{reentrant} or @code{interrupt} attributes.
on exit. The @code{critical} attribute is therefore redundant on
@code{interrupt} functions.
-@item interrupt
@cindex @code{interrupt} function attribute, MSP430
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
the names @code{watchdog} for vector 26, @code{nmi} for vector 30 and
@code{reset} for vector 31 are recognized.
-@item naked
@cindex @code{naked} function attribute, MSP430
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item reentrant
@cindex @code{reentrant} function attribute, MSP430
+@item reentrant
Reentrant functions disable interrupts upon entry and enable them
upon exit. Reentrant functions cannot also have the @code{naked}
or @code{critical} attributes. They can have the @code{interrupt}
attribute.
-@item wakeup
@cindex @code{wakeup} function attribute, MSP430
+@item wakeup
This attribute only applies to interrupt functions. It is silently
ignored if applied to a non-interrupt function. A wakeup interrupt
function will rouse the processor from any low-power state that it
might be in when the function exits.
-@item lower
-@itemx upper
-@itemx either
@cindex @code{lower} function attribute, MSP430
@cindex @code{upper} function attribute, MSP430
@cindex @code{either} function attribute, MSP430
+@item lower
+@itemx upper
+@itemx either
On the MSP430 target these attributes can be used to specify whether
the function or variable should be placed into low memory, high
memory, or the placement should be left to the linker to decide. The
These function attributes are supported by the NDS32 back end:
@table @code
-@item exception
@cindex @code{exception} function attribute
@cindex exception handler functions, NDS32
+@item exception
Use this attribute on the NDS32 target to indicate that the specified function
is an exception handler. The compiler will generate corresponding sections
for use in an exception handler.
-@item interrupt
@cindex @code{interrupt} function attribute, NDS32
+@item interrupt
On NDS32 target, this attribute indicates that the specified function
is an interrupt handler. The compiler generates corresponding sections
for use in an interrupt handler. You can use the following attributes
to modify the behavior:
@table @code
-@item nested
@cindex @code{nested} function attribute, NDS32
+@item nested
This interrupt service routine is interruptible.
-@item not_nested
@cindex @code{not_nested} function attribute, NDS32
+@item not_nested
This interrupt service routine is not interruptible.
-@item nested_ready
@cindex @code{nested_ready} function attribute, NDS32
+@item nested_ready
This interrupt service routine is interruptible after @code{PSW.GIE}
(global interrupt enable) is set. This allows interrupt service routine to
finish some short critical code before enabling interrupts.
-@item save_all
@cindex @code{save_all} function attribute, NDS32
+@item save_all
The system will help save all registers into stack before entering
interrupt handler.
-@item partial_save
@cindex @code{partial_save} function attribute, NDS32
+@item partial_save
The system will help save caller registers into stack before entering
interrupt handler.
@end table
-@item naked
@cindex @code{naked} function attribute, NDS32
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item reset
@cindex @code{reset} function attribute, NDS32
@cindex reset handler functions
+@item reset
Use this attribute on the NDS32 target to indicate that the specified function
is a reset handler. The compiler will generate corresponding sections
for use in a reset handler. You can use the following attributes
to provide extra exception handling:
@table @code
-@item nmi
@cindex @code{nmi} function attribute, NDS32
+@item nmi
Provide a user-defined function to handle NMI exception.
-@item warm
@cindex @code{warm} function attribute, NDS32
+@item warm
Provide a user-defined function to handle warm reset exception.
@end table
@end table
These function attributes are supported by the Nios II back end:
@table @code
-@item target (@var{options})
@cindex @code{target} function attribute
+@item target (@var{options})
As discussed in @ref{Common Function Attributes}, this attribute
allows specification of target-specific compilation options.
When compiling for Nios II, the following options are allowed:
@table @samp
-@item custom-@var{insn}=@var{N}
-@itemx no-custom-@var{insn}
@cindex @code{target("custom-@var{insn}=@var{N}")} function attribute, Nios II
@cindex @code{target("no-custom-@var{insn}")} function attribute, Nios II
+@item custom-@var{insn}=@var{N}
+@itemx no-custom-@var{insn}
Each @samp{custom-@var{insn}=@var{N}} attribute locally enables use of a
custom instruction with encoding @var{N} when generating code that uses
@var{insn}. Similarly, @samp{no-custom-@var{insn}} locally inhibits use of
command-line options, and support the same set of @var{insn} keywords.
@xref{Nios II Options}, for more information.
-@item custom-fpu-cfg=@var{name}
@cindex @code{target("custom-fpu-cfg=@var{name}")} function attribute, Nios II
+@item custom-fpu-cfg=@var{name}
This attribute corresponds to the @option{-mcustom-fpu-cfg=@var{name}}
command-line option, to select a predefined set of custom instructions
named @var{name}.
These function attributes are supported by the Nvidia PTX back end:
@table @code
-@item kernel
@cindex @code{kernel} attribute, Nvidia PTX
+@item kernel
This attribute indicates that the corresponding function should be compiled
as a kernel function, which can be invoked from the host via the CUDA RT
library.
These function attributes are supported by the PowerPC back end:
@table @code
-@item longcall
-@itemx shortcall
@cindex indirect calls, PowerPC
@cindex @code{longcall} function attribute, PowerPC
@cindex @code{shortcall} function attribute, PowerPC
+@item longcall
+@itemx shortcall
The @code{longcall} attribute
indicates that the function might be far away from the call site and
require a different (more expensive) calling sequence. The
@xref{RS/6000 and PowerPC Options}, for more information on whether long
calls are necessary.
-@item target (@var{options})
@cindex @code{target} function attribute
+@item target (@var{options})
As discussed in @ref{Common Function Attributes}, this attribute
allows specification of target-specific compilation options.
On the PowerPC, the following options are allowed:
@table @samp
+@cindex @code{target("altivec")} function attribute, PowerPC
@item altivec
@itemx no-altivec
-@cindex @code{target("altivec")} function attribute, PowerPC
Generate code that uses (does not use) AltiVec instructions. In
32-bit code, you cannot enable AltiVec instructions unless
@option{-mabi=altivec} is used on the command line.
+@cindex @code{target("cmpb")} function attribute, PowerPC
@item cmpb
@itemx no-cmpb
-@cindex @code{target("cmpb")} function attribute, PowerPC
Generate code that uses (does not use) the compare bytes instruction
implemented on the POWER6 processor and other processors that support
the PowerPC V2.05 architecture.
+@cindex @code{target("dlmzb")} function attribute, PowerPC
@item dlmzb
@itemx no-dlmzb
-@cindex @code{target("dlmzb")} function attribute, PowerPC
Generate code that uses (does not use) the string-search @samp{dlmzb}
instruction on the IBM 405, 440, 464 and 476 processors. This instruction is
generated by default when targeting those processors.
+@cindex @code{target("fprnd")} function attribute, PowerPC
@item fprnd
@itemx no-fprnd
-@cindex @code{target("fprnd")} function attribute, PowerPC
Generate code that uses (does not use) the FP round to integer
instructions implemented on the POWER5+ processor and other processors
that support the PowerPC V2.03 architecture.
+@cindex @code{target("hard-dfp")} function attribute, PowerPC
@item hard-dfp
@itemx no-hard-dfp
-@cindex @code{target("hard-dfp")} function attribute, PowerPC
Generate code that uses (does not use) the decimal floating-point
instructions implemented on some POWER processors.
+@cindex @code{target("isel")} function attribute, PowerPC
@item isel
@itemx no-isel
-@cindex @code{target("isel")} function attribute, PowerPC
Generate code that uses (does not use) ISEL instruction.
+@cindex @code{target("mfcrf")} function attribute, PowerPC
@item mfcrf
@itemx no-mfcrf
-@cindex @code{target("mfcrf")} function attribute, PowerPC
Generate code that uses (does not use) the move from condition
register field instruction implemented on the POWER4 processor and
other processors that support the PowerPC V2.01 architecture.
+@cindex @code{target("mulhw")} function attribute, PowerPC
@item mulhw
@itemx no-mulhw
-@cindex @code{target("mulhw")} function attribute, PowerPC
Generate code that uses (does not use) the half-word multiply and
multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
These instructions are generated by default when targeting those
processors.
+@cindex @code{target("multiple")} function attribute, PowerPC
@item multiple
@itemx no-multiple
-@cindex @code{target("multiple")} function attribute, PowerPC
Generate code that uses (does not use) the load multiple word
instructions and the store multiple word instructions.
+@cindex @code{target("update")} function attribute, PowerPC
@item update
@itemx no-update
-@cindex @code{target("update")} function attribute, PowerPC
Generate code that uses (does not use) the load or store instructions
that update the base register to the address of the calculated memory
location.
+@cindex @code{target("popcntb")} function attribute, PowerPC
@item popcntb
@itemx no-popcntb
-@cindex @code{target("popcntb")} function attribute, PowerPC
Generate code that uses (does not use) the popcount and double-precision
FP reciprocal estimate instruction implemented on the POWER5
processor and other processors that support the PowerPC V2.02
architecture.
+@cindex @code{target("popcntd")} function attribute, PowerPC
@item popcntd
@itemx no-popcntd
-@cindex @code{target("popcntd")} function attribute, PowerPC
Generate code that uses (does not use) the popcount instruction
implemented on the POWER7 processor and other processors that support
the PowerPC V2.06 architecture.
+@cindex @code{target("powerpc-gfxopt")} function attribute, PowerPC
@item powerpc-gfxopt
@itemx no-powerpc-gfxopt
-@cindex @code{target("powerpc-gfxopt")} function attribute, PowerPC
Generate code that uses (does not use) the optional PowerPC
architecture instructions in the Graphics group, including
floating-point select.
+@cindex @code{target("powerpc-gpopt")} function attribute, PowerPC
@item powerpc-gpopt
@itemx no-powerpc-gpopt
-@cindex @code{target("powerpc-gpopt")} function attribute, PowerPC
Generate code that uses (does not use) the optional PowerPC
architecture instructions in the General Purpose group, including
floating-point square root.
+@cindex @code{target("recip-precision")} function attribute, PowerPC
@item recip-precision
@itemx no-recip-precision
-@cindex @code{target("recip-precision")} function attribute, PowerPC
Assume (do not assume) that the reciprocal estimate instructions
provide higher-precision estimates than is mandated by the PowerPC
ABI.
+@cindex @code{target("string")} function attribute, PowerPC
@item string
@itemx no-string
-@cindex @code{target("string")} function attribute, PowerPC
Generate code that uses (does not use) the load string instructions
and the store string word instructions to save multiple registers and
do small block moves.
+@cindex @code{target("vsx")} function attribute, PowerPC
@item vsx
@itemx no-vsx
-@cindex @code{target("vsx")} function attribute, PowerPC
Generate code that uses (does not use) vector/scalar (VSX)
instructions, and also enable the use of built-in functions that allow
more direct access to the VSX instruction set. In 32-bit code, you
cannot enable VSX or AltiVec instructions unless
@option{-mabi=altivec} is used on the command line.
+@cindex @code{target("friz")} function attribute, PowerPC
@item friz
@itemx no-friz
-@cindex @code{target("friz")} function attribute, PowerPC
Generate (do not generate) the @code{friz} instruction when the
@option{-funsafe-math-optimizations} option is used to optimize
rounding a floating-point value to 64-bit integer and back to floating
point. The @code{friz} instruction does not return the same value if
the floating-point number is too large to fit in an integer.
+@cindex @code{target("avoid-indexed-addresses")} function attribute, PowerPC
@item avoid-indexed-addresses
@itemx no-avoid-indexed-addresses
-@cindex @code{target("avoid-indexed-addresses")} function attribute, PowerPC
Generate code that tries to avoid (not avoid) the use of indexed load
or store instructions.
+@cindex @code{target("paired")} function attribute, PowerPC
@item paired
@itemx no-paired
-@cindex @code{target("paired")} function attribute, PowerPC
Generate code that uses (does not use) the generation of PAIRED simd
instructions.
+@cindex @code{target("longcall")} function attribute, PowerPC
@item longcall
@itemx no-longcall
-@cindex @code{target("longcall")} function attribute, PowerPC
Generate code that assumes (does not assume) that all calls are far
away so that a longer more expensive calling sequence is required.
-@item cpu=@var{CPU}
@cindex @code{target("cpu=@var{CPU}")} function attribute, PowerPC
+@item cpu=@var{CPU}
Specify the architecture to generate code for when compiling the
function. If you select the @code{target("cpu=power7")} attribute when
generating 32-bit code, VSX and AltiVec instructions are not generated
unless you use the @option{-mabi=altivec} option on the command line.
-@item tune=@var{TUNE}
@cindex @code{target("tune=@var{TUNE}")} function attribute, PowerPC
+@item tune=@var{TUNE}
Specify the architecture to tune for when compiling the function. If
you do not specify the @code{target("tune=@var{TUNE}")} attribute and
you do specify the @code{target("cpu=@var{CPU}")} attribute,
These function attributes are supported by the RISC-V back end:
@table @code
-@item naked
@cindex @code{naked} function attribute, RISC-V
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item interrupt
@cindex @code{interrupt} function attribute, RISC-V
+@item interrupt
Use this attribute to indicate that the specified function is an interrupt
handler. The compiler generates function entry and exit sequences suitable
for use in an interrupt handler when this attribute is present.
These function attributes are supported by the RL78 back end:
@table @code
-@item interrupt
-@itemx brk_interrupt
@cindex @code{interrupt} function attribute, RL78
@cindex @code{brk_interrupt} function attribute, RL78
+@item interrupt
+@itemx brk_interrupt
These attributes indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
handlers intended to be used with the @code{BRK} opcode (i.e.@: those
that must end with @code{RETB} instead of @code{RETI}).
-@item naked
@cindex @code{naked} function attribute, RL78
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
These function attributes are supported by the RX back end:
@table @code
-@item fast_interrupt
@cindex @code{fast_interrupt} function attribute, RX
+@item fast_interrupt
Use this attribute on the RX port to indicate that the specified
function is a fast interrupt handler. This is just like the
@code{interrupt} attribute, except that @code{freit} is used to return
instead of @code{reit}.
-@item interrupt
@cindex @code{interrupt} function attribute, RX
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
txd1_handler ();
@end smallexample
-@item naked
@cindex @code{naked} function attribute, RX
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item vector
@cindex @code{vector} function attribute, RX
+@item vector
This RX attribute is similar to the @code{interrupt} attribute, including its
parameters, but does not make the function an interrupt-handler type
function (i.e.@: it retains the normal C function calling ABI). See the
These function attributes are supported on the S/390:
@table @code
-@item hotpatch (@var{halfwords-before-function-label},@var{halfwords-after-function-label})
@cindex @code{hotpatch} function attribute, S/390
+@item hotpatch (@var{halfwords-before-function-label},@var{halfwords-after-function-label})
On S/390 System z targets, you can use this function attribute to
make GCC generate a ``hot-patching'' function prologue. If the
If both arguments are zero, hotpatching is disabled.
-@item target (@var{options})
@cindex @code{target} function attribute
+@item target (@var{options})
As discussed in @ref{Common Function Attributes}, this attribute
allows specification of target-specific compilation options.
These function attributes are supported on the SH family of processors:
@table @code
-@item function_vector
@cindex @code{function_vector} function attribute, SH
@cindex calling functions through the function vector on SH2A
+@item function_vector
On SH2A targets, this attribute declares a function to be called using the
TBR relative addressing mode. The argument to this attribute is the entry
number of the same function in a vector table containing all the TBR
made to the same function, it saves 2 bytes of code per each of these
calls.
-@item interrupt_handler
@cindex @code{interrupt_handler} function attribute, SH
+@item interrupt_handler
Use this attribute to
indicate that the specified function is an interrupt handler. The compiler
generates function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.
-@item nosave_low_regs
@cindex @code{nosave_low_regs} function attribute, SH
+@item nosave_low_regs
Use this attribute on SH targets to indicate that an @code{interrupt_handler}
function should not save and restore registers R0..R7. This can be used on SH3*
and SH4* targets that have a second R0..R7 register bank for non-reentrant
interrupt handlers.
-@item renesas
@cindex @code{renesas} function attribute, SH
+@item renesas
On SH targets this attribute specifies that the function or struct follows the
Renesas ABI.
-@item resbank
@cindex @code{resbank} function attribute, SH
+@item resbank
On the SH2A target, this attribute enables the high-speed register
saving and restoration using a register bank for @code{interrupt_handler}
routines. Saving to the bank is performed automatically after the CPU
banks are stacked in first-in last-out (FILO) sequence. Restoration
from the bank is executed by issuing a RESBANK instruction.
-@item sp_switch
@cindex @code{sp_switch} function attribute, SH
+@item sp_switch
Use this attribute on the SH to indicate an @code{interrupt_handler}
function should switch to an alternate stack. It expects a string
argument that names a global variable holding the address of the
sp_switch ("alt_stack")));
@end smallexample
-@item trap_exit
@cindex @code{trap_exit} function attribute, SH
+@item trap_exit
Use this attribute on the SH for an @code{interrupt_handler} to return using
@code{trapa} instead of @code{rte}. This attribute expects an integer
argument specifying the trap number to be used.
-@item trapa_handler
@cindex @code{trapa_handler} function attribute, SH
+@item trapa_handler
On SH targets this function attribute is similar to @code{interrupt_handler}
but it does not save and restore all registers.
@end table
The V850 back end supports these function attributes:
@table @code
-@item interrupt
-@itemx interrupt_handler
@cindex @code{interrupt} function attribute, V850
@cindex @code{interrupt_handler} function attribute, V850
+@item interrupt
+@itemx interrupt_handler
Use these attributes to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
These function attributes are supported by the Visium back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, Visium
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
These function attributes are supported by the x86 back end:
@table @code
-@item cdecl
@cindex @code{cdecl} function attribute, x86-32
@cindex functions that pop the argument stack on x86-32
@opindex mrtd
+@item cdecl
On the x86-32 targets, the @code{cdecl} attribute causes the compiler to
assume that the calling function pops off the stack space used to
pass arguments. This is
useful to override the effects of the @option{-mrtd} switch.
-@item fastcall
@cindex @code{fastcall} function attribute, x86-32
@cindex functions that pop the argument stack on x86-32
+@item fastcall
On x86-32 targets, the @code{fastcall} attribute causes the compiler to
pass the first argument (if of integral type) in the register ECX and
the second argument (if of integral type) in the register EDX@. Subsequent
pops the arguments off the stack. If the number of arguments is variable all
arguments are pushed on the stack.
-@item thiscall
@cindex @code{thiscall} function attribute, x86-32
@cindex functions that pop the argument stack on x86-32
+@item thiscall
On x86-32 targets, the @code{thiscall} attribute causes the compiler to
pass the first argument (if of integral type) in the register ECX.
Subsequent and other typed arguments are passed on the stack. The called
As a GCC extension, this calling convention can be used for C functions
and for static member methods.
-@item ms_abi
-@itemx sysv_abi
@cindex @code{ms_abi} function attribute, x86
@cindex @code{sysv_abi} function attribute, x86
+@item ms_abi
+@itemx sysv_abi
On 32-bit and 64-bit x86 targets, you can use an ABI attribute
to indicate which calling convention should be used for a function. The
Note, the @code{ms_abi} attribute for Microsoft Windows 64-bit targets currently
requires the @option{-maccumulate-outgoing-args} option.
-@item callee_pop_aggregate_return (@var{number})
@cindex @code{callee_pop_aggregate_return} function attribute, x86
+@item callee_pop_aggregate_return (@var{number})
On x86-32 targets, you can use this attribute to control how
aggregates are returned in memory. If the caller is responsible for
the compiler assumes that the
caller pops the stack for hidden pointer.
-@item ms_hook_prologue
@cindex @code{ms_hook_prologue} function attribute, x86
+@item ms_hook_prologue
On 32-bit and 64-bit x86 targets, you can use
this function attribute to make GCC generate the ``hot-patching'' function
prologue used in Win32 API functions in Microsoft Windows XP Service Pack 2
and newer.
-@item naked
@cindex @code{naked} function attribute, x86
+@item naked
This attribute allows the compiler to construct the
requisite function declaration, while allowing the body of the
function to be assembly code. The specified function will not have
basic @code{asm} and C code may appear to work, they cannot be
depended upon to work reliably and are not supported.
-@item regparm (@var{number})
@cindex @code{regparm} function attribute, x86
@cindex functions that are passed arguments in registers on x86-32
+@item regparm (@var{number})
On x86-32 targets, the @code{regparm} attribute causes the compiler to
pass arguments number one to @var{number} if they are of integral type
in registers EAX, EDX, and ECX instead of on the stack. Functions that
disabled with the linker or the loader if desired, to avoid the
problem.)
-@item sseregparm
@cindex @code{sseregparm} function attribute, x86
+@item sseregparm
On x86-32 targets with SSE support, the @code{sseregparm} attribute
causes the compiler to pass up to 3 floating-point arguments in
SSE registers instead of on the stack. Functions that take a
variable number of arguments continue to pass all of their
floating-point arguments on the stack.
-@item force_align_arg_pointer
@cindex @code{force_align_arg_pointer} function attribute, x86
+@item force_align_arg_pointer
On x86 targets, the @code{force_align_arg_pointer} attribute may be
applied to individual function definitions, generating an alternate
prologue and epilogue that realigns the run-time stack if necessary.
This supports mixing legacy codes that run with a 4-byte aligned stack
with modern codes that keep a 16-byte stack for SSE compatibility.
-@item stdcall
@cindex @code{stdcall} function attribute, x86-32
@cindex functions that pop the argument stack on x86-32
+@item stdcall
On x86-32 targets, the @code{stdcall} attribute causes the compiler to
assume that the called function pops off the stack space used to
pass arguments, unless it takes a variable number of arguments.
-@item no_caller_saved_registers
@cindex @code{no_caller_saved_registers} function attribute, x86
+@item no_caller_saved_registers
Use this attribute to indicate that the specified function has no
caller-saved registers. That is, all registers are callee-saved. For
example, this attribute can be used for a function called from an
states, the GCC option @option{-mgeneral-regs-only} should be used to
compile functions with @code{no_caller_saved_registers} attribute.
-@item interrupt
@cindex @code{interrupt} function attribute, x86
+@item interrupt
Use this attribute to indicate that the specified function is an
interrupt handler or an exception handler (depending on parameters passed
to the function, explained further). The compiler generates function
code; you should use an interrupt handler in other cases. The system
will crash if the wrong kind of handler is used.
-@item target (@var{options})
@cindex @code{target} function attribute
+@item target (@var{options})
As discussed in @ref{Common Function Attributes}, this attribute
allows specification of target-specific compilation options.
On the x86, the following options are allowed:
@table @samp
+@cindex @code{target("3dnow")} function attribute, x86
@item 3dnow
@itemx no-3dnow
-@cindex @code{target("3dnow")} function attribute, x86
Enable/disable the generation of the 3DNow!@: instructions.
+@cindex @code{target("3dnowa")} function attribute, x86
@item 3dnowa
@itemx no-3dnowa
-@cindex @code{target("3dnowa")} function attribute, x86
Enable/disable the generation of the enhanced 3DNow!@: instructions.
+@cindex @code{target("abm")} function attribute, x86
@item abm
@itemx no-abm
-@cindex @code{target("abm")} function attribute, x86
Enable/disable the generation of the advanced bit instructions.
+@cindex @code{target("adx")} function attribute, x86
@item adx
@itemx no-adx
-@cindex @code{target("adx")} function attribute, x86
Enable/disable the generation of the ADX instructions.
+@cindex @code{target("aes")} function attribute, x86
@item aes
@itemx no-aes
-@cindex @code{target("aes")} function attribute, x86
Enable/disable the generation of the AES instructions.
+@cindex @code{target("avx")} function attribute, x86
@item avx
@itemx no-avx
-@cindex @code{target("avx")} function attribute, x86
Enable/disable the generation of the AVX instructions.
+@cindex @code{target("avx2")} function attribute, x86
@item avx2
@itemx no-avx2
-@cindex @code{target("avx2")} function attribute, x86
Enable/disable the generation of the AVX2 instructions.
+@cindex @code{target("avx5124fmaps")} function attribute, x86
@item avx5124fmaps
@itemx no-avx5124fmaps
-@cindex @code{target("avx5124fmaps")} function attribute, x86
Enable/disable the generation of the AVX5124FMAPS instructions.
+@cindex @code{target("avx5124vnniw")} function attribute, x86
@item avx5124vnniw
@itemx no-avx5124vnniw
-@cindex @code{target("avx5124vnniw")} function attribute, x86
Enable/disable the generation of the AVX5124VNNIW instructions.
+@cindex @code{target("avx512bitalg")} function attribute, x86
@item avx512bitalg
@itemx no-avx512bitalg
-@cindex @code{target("avx512bitalg")} function attribute, x86
Enable/disable the generation of the AVX512BITALG instructions.
+@cindex @code{target("avx512bw")} function attribute, x86
@item avx512bw
@itemx no-avx512bw
-@cindex @code{target("avx512bw")} function attribute, x86
Enable/disable the generation of the AVX512BW instructions.
+@cindex @code{target("avx512cd")} function attribute, x86
@item avx512cd
@itemx no-avx512cd
-@cindex @code{target("avx512cd")} function attribute, x86
Enable/disable the generation of the AVX512CD instructions.
+@cindex @code{target("avx512dq")} function attribute, x86
@item avx512dq
@itemx no-avx512dq
-@cindex @code{target("avx512dq")} function attribute, x86
Enable/disable the generation of the AVX512DQ instructions.
+@cindex @code{target("avx512er")} function attribute, x86
@item avx512er
@itemx no-avx512er
-@cindex @code{target("avx512er")} function attribute, x86
Enable/disable the generation of the AVX512ER instructions.
+@cindex @code{target("avx512f")} function attribute, x86
@item avx512f
@itemx no-avx512f
-@cindex @code{target("avx512f")} function attribute, x86
Enable/disable the generation of the AVX512F instructions.
+@cindex @code{target("avx512ifma")} function attribute, x86
@item avx512ifma
@itemx no-avx512ifma
-@cindex @code{target("avx512ifma")} function attribute, x86
Enable/disable the generation of the AVX512IFMA instructions.
+@cindex @code{target("avx512pf")} function attribute, x86
@item avx512pf
@itemx no-avx512pf
-@cindex @code{target("avx512pf")} function attribute, x86
Enable/disable the generation of the AVX512PF instructions.
+@cindex @code{target("avx512vbmi")} function attribute, x86
@item avx512vbmi
@itemx no-avx512vbmi
-@cindex @code{target("avx512vbmi")} function attribute, x86
Enable/disable the generation of the AVX512VBMI instructions.
+@cindex @code{target("avx512vbmi2")} function attribute, x86
@item avx512vbmi2
@itemx no-avx512vbmi2
-@cindex @code{target("avx512vbmi2")} function attribute, x86
Enable/disable the generation of the AVX512VBMI2 instructions.
+@cindex @code{target("avx512vl")} function attribute, x86
@item avx512vl
@itemx no-avx512vl
-@cindex @code{target("avx512vl")} function attribute, x86
Enable/disable the generation of the AVX512VL instructions.
+@cindex @code{target("avx512vnni")} function attribute, x86
@item avx512vnni
@itemx no-avx512vnni
-@cindex @code{target("avx512vnni")} function attribute, x86
Enable/disable the generation of the AVX512VNNI instructions.
+@cindex @code{target("avx512vpopcntdq")} function attribute, x86
@item avx512vpopcntdq
@itemx no-avx512vpopcntdq
-@cindex @code{target("avx512vpopcntdq")} function attribute, x86
Enable/disable the generation of the AVX512VPOPCNTDQ instructions.
+@cindex @code{target("bmi")} function attribute, x86
@item bmi
@itemx no-bmi
-@cindex @code{target("bmi")} function attribute, x86
Enable/disable the generation of the BMI instructions.
+@cindex @code{target("bmi2")} function attribute, x86
@item bmi2
@itemx no-bmi2
-@cindex @code{target("bmi2")} function attribute, x86
Enable/disable the generation of the BMI2 instructions.
+@cindex @code{target("cldemote")} function attribute, x86
@item cldemote
@itemx no-cldemote
-@cindex @code{target("cldemote")} function attribute, x86
Enable/disable the generation of the CLDEMOTE instructions.
+@cindex @code{target("clflushopt")} function attribute, x86
@item clflushopt
@itemx no-clflushopt
-@cindex @code{target("clflushopt")} function attribute, x86
Enable/disable the generation of the CLFLUSHOPT instructions.
+@cindex @code{target("clwb")} function attribute, x86
@item clwb
@itemx no-clwb
-@cindex @code{target("clwb")} function attribute, x86
Enable/disable the generation of the CLWB instructions.
+@cindex @code{target("clzero")} function attribute, x86
@item clzero
@itemx no-clzero
-@cindex @code{target("clzero")} function attribute, x86
Enable/disable the generation of the CLZERO instructions.
+@cindex @code{target("crc32")} function attribute, x86
@item crc32
@itemx no-crc32
-@cindex @code{target("crc32")} function attribute, x86
Enable/disable the generation of the CRC32 instructions.
+@cindex @code{target("cx16")} function attribute, x86
@item cx16
@itemx no-cx16
-@cindex @code{target("cx16")} function attribute, x86
Enable/disable the generation of the CMPXCHG16B instructions.
-@item default
@cindex @code{target("default")} function attribute, x86
+@item default
@xref{Function Multiversioning}, where it is used to specify the
default function version.
+@cindex @code{target("f16c")} function attribute, x86
@item f16c
@itemx no-f16c
-@cindex @code{target("f16c")} function attribute, x86
Enable/disable the generation of the F16C instructions.
+@cindex @code{target("fma")} function attribute, x86
@item fma
@itemx no-fma
-@cindex @code{target("fma")} function attribute, x86
Enable/disable the generation of the FMA instructions.
+@cindex @code{target("fma4")} function attribute, x86
@item fma4
@itemx no-fma4
-@cindex @code{target("fma4")} function attribute, x86
Enable/disable the generation of the FMA4 instructions.
+@cindex @code{target("fsgsbase")} function attribute, x86
@item fsgsbase
@itemx no-fsgsbase
-@cindex @code{target("fsgsbase")} function attribute, x86
Enable/disable the generation of the FSGSBASE instructions.
+@cindex @code{target("fxsr")} function attribute, x86
@item fxsr
@itemx no-fxsr
-@cindex @code{target("fxsr")} function attribute, x86
Enable/disable the generation of the FXSR instructions.
+@cindex @code{target("gfni")} function attribute, x86
@item gfni
@itemx no-gfni
-@cindex @code{target("gfni")} function attribute, x86
Enable/disable the generation of the GFNI instructions.
+@cindex @code{target("hle")} function attribute, x86
@item hle
@itemx no-hle
-@cindex @code{target("hle")} function attribute, x86
Enable/disable the generation of the HLE instruction prefixes.
+@cindex @code{target("lwp")} function attribute, x86
@item lwp
@itemx no-lwp
-@cindex @code{target("lwp")} function attribute, x86
Enable/disable the generation of the LWP instructions.
+@cindex @code{target("lzcnt")} function attribute, x86
@item lzcnt
@itemx no-lzcnt
-@cindex @code{target("lzcnt")} function attribute, x86
Enable/disable the generation of the LZCNT instructions.
+@cindex @code{target("mmx")} function attribute, x86
@item mmx
@itemx no-mmx
-@cindex @code{target("mmx")} function attribute, x86
Enable/disable the generation of the MMX instructions.
+@cindex @code{target("movbe")} function attribute, x86
@item movbe
@itemx no-movbe
-@cindex @code{target("movbe")} function attribute, x86
Enable/disable the generation of the MOVBE instructions.
+@cindex @code{target("movdir64b")} function attribute, x86
@item movdir64b
@itemx no-movdir64b
-@cindex @code{target("movdir64b")} function attribute, x86
Enable/disable the generation of the MOVDIR64B instructions.
+@cindex @code{target("movdiri")} function attribute, x86
@item movdiri
@itemx no-movdiri
-@cindex @code{target("movdiri")} function attribute, x86
Enable/disable the generation of the MOVDIRI instructions.
+@cindex @code{target("mwait")} function attribute, x86
@item mwait
@itemx no-mwait
-@cindex @code{target("mwait")} function attribute, x86
Enable/disable the generation of the MWAIT and MONITOR instructions.
+@cindex @code{target("mwaitx")} function attribute, x86
@item mwaitx
@itemx no-mwaitx
-@cindex @code{target("mwaitx")} function attribute, x86
Enable/disable the generation of the MWAITX instructions.
+@cindex @code{target("pclmul")} function attribute, x86
@item pclmul
@itemx no-pclmul
-@cindex @code{target("pclmul")} function attribute, x86
Enable/disable the generation of the PCLMUL instructions.
+@cindex @code{target("pconfig")} function attribute, x86
@item pconfig
@itemx no-pconfig
-@cindex @code{target("pconfig")} function attribute, x86
Enable/disable the generation of the PCONFIG instructions.
+@cindex @code{target("pku")} function attribute, x86
@item pku
@itemx no-pku
-@cindex @code{target("pku")} function attribute, x86
Enable/disable the generation of the PKU instructions.
+@cindex @code{target("popcnt")} function attribute, x86
@item popcnt
@itemx no-popcnt
-@cindex @code{target("popcnt")} function attribute, x86
Enable/disable the generation of the POPCNT instruction.
+@cindex @code{target("prefetchwt1")} function attribute, x86
@item prefetchwt1
@itemx no-prefetchwt1
-@cindex @code{target("prefetchwt1")} function attribute, x86
Enable/disable the generation of the PREFETCHWT1 instructions.
+@cindex @code{target("prfchw")} function attribute, x86
@item prfchw
@itemx no-prfchw
-@cindex @code{target("prfchw")} function attribute, x86
Enable/disable the generation of the PREFETCHW instruction.
+@cindex @code{target("ptwrite")} function attribute, x86
@item ptwrite
@itemx no-ptwrite
-@cindex @code{target("ptwrite")} function attribute, x86
Enable/disable the generation of the PTWRITE instructions.
+@cindex @code{target("rdpid")} function attribute, x86
@item rdpid
@itemx no-rdpid
-@cindex @code{target("rdpid")} function attribute, x86
Enable/disable the generation of the RDPID instructions.
+@cindex @code{target("rdrnd")} function attribute, x86
@item rdrnd
@itemx no-rdrnd
-@cindex @code{target("rdrnd")} function attribute, x86
Enable/disable the generation of the RDRND instructions.
+@cindex @code{target("rdseed")} function attribute, x86
@item rdseed
@itemx no-rdseed
-@cindex @code{target("rdseed")} function attribute, x86
Enable/disable the generation of the RDSEED instructions.
+@cindex @code{target("rtm")} function attribute, x86
@item rtm
@itemx no-rtm
-@cindex @code{target("rtm")} function attribute, x86
Enable/disable the generation of the RTM instructions.
+@cindex @code{target("sahf")} function attribute, x86
@item sahf
@itemx no-sahf
-@cindex @code{target("sahf")} function attribute, x86
Enable/disable the generation of the SAHF instructions.
+@cindex @code{target("sgx")} function attribute, x86
@item sgx
@itemx no-sgx
-@cindex @code{target("sgx")} function attribute, x86
Enable/disable the generation of the SGX instructions.
+@cindex @code{target("sha")} function attribute, x86
@item sha
@itemx no-sha
-@cindex @code{target("sha")} function attribute, x86
Enable/disable the generation of the SHA instructions.
+@cindex @code{target("shstk")} function attribute, x86
@item shstk
@itemx no-shstk
-@cindex @code{target("shstk")} function attribute, x86
Enable/disable the shadow stack built-in functions from CET.
+@cindex @code{target("sse")} function attribute, x86
@item sse
@itemx no-sse
-@cindex @code{target("sse")} function attribute, x86
Enable/disable the generation of the SSE instructions.
+@cindex @code{target("sse2")} function attribute, x86
@item sse2
@itemx no-sse2
-@cindex @code{target("sse2")} function attribute, x86
Enable/disable the generation of the SSE2 instructions.
+@cindex @code{target("sse3")} function attribute, x86
@item sse3
@itemx no-sse3
-@cindex @code{target("sse3")} function attribute, x86
Enable/disable the generation of the SSE3 instructions.
+@cindex @code{target("sse4")} function attribute, x86
@item sse4
@itemx no-sse4
-@cindex @code{target("sse4")} function attribute, x86
Enable/disable the generation of the SSE4 instructions (both SSE4.1
and SSE4.2).
+@cindex @code{target("sse4.1")} function attribute, x86
@item sse4.1
@itemx no-sse4.1
-@cindex @code{target("sse4.1")} function attribute, x86
Enable/disable the generation of the SSE4.1 instructions.
+@cindex @code{target("sse4.2")} function attribute, x86
@item sse4.2
@itemx no-sse4.2
-@cindex @code{target("sse4.2")} function attribute, x86
Enable/disable the generation of the SSE4.2 instructions.
+@cindex @code{target("sse4a")} function attribute, x86
@item sse4a
@itemx no-sse4a
-@cindex @code{target("sse4a")} function attribute, x86
Enable/disable the generation of the SSE4A instructions.
+@cindex @code{target("ssse3")} function attribute, x86
@item ssse3
@itemx no-ssse3
-@cindex @code{target("ssse3")} function attribute, x86
Enable/disable the generation of the SSSE3 instructions.
+@cindex @code{target("tbm")} function attribute, x86
@item tbm
@itemx no-tbm
-@cindex @code{target("tbm")} function attribute, x86
Enable/disable the generation of the TBM instructions.
+@cindex @code{target("vaes")} function attribute, x86
@item vaes
@itemx no-vaes
-@cindex @code{target("vaes")} function attribute, x86
Enable/disable the generation of the VAES instructions.
+@cindex @code{target("vpclmulqdq")} function attribute, x86
@item vpclmulqdq
@itemx no-vpclmulqdq
-@cindex @code{target("vpclmulqdq")} function attribute, x86
Enable/disable the generation of the VPCLMULQDQ instructions.
+@cindex @code{target("waitpkg")} function attribute, x86
@item waitpkg
@itemx no-waitpkg
-@cindex @code{target("waitpkg")} function attribute, x86
Enable/disable the generation of the WAITPKG instructions.
+@cindex @code{target("wbnoinvd")} function attribute, x86
@item wbnoinvd
@itemx no-wbnoinvd
-@cindex @code{target("wbnoinvd")} function attribute, x86
Enable/disable the generation of the WBNOINVD instructions.
+@cindex @code{target("xop")} function attribute, x86
@item xop
@itemx no-xop
-@cindex @code{target("xop")} function attribute, x86
Enable/disable the generation of the XOP instructions.
+@cindex @code{target("xsave")} function attribute, x86
@item xsave
@itemx no-xsave
-@cindex @code{target("xsave")} function attribute, x86
Enable/disable the generation of the XSAVE instructions.
+@cindex @code{target("xsavec")} function attribute, x86
@item xsavec
@itemx no-xsavec
-@cindex @code{target("xsavec")} function attribute, x86
Enable/disable the generation of the XSAVEC instructions.
+@cindex @code{target("xsaveopt")} function attribute, x86
@item xsaveopt
@itemx no-xsaveopt
-@cindex @code{target("xsaveopt")} function attribute, x86
Enable/disable the generation of the XSAVEOPT instructions.
+@cindex @code{target("xsaves")} function attribute, x86
@item xsaves
@itemx no-xsaves
-@cindex @code{target("xsaves")} function attribute, x86
Enable/disable the generation of the XSAVES instructions.
+@cindex @code{target("amx-tile")} function attribute, x86
@item amx-tile
@itemx no-amx-tile
-@cindex @code{target("amx-tile")} function attribute, x86
Enable/disable the generation of the AMX-TILE instructions.
+@cindex @code{target("amx-int8")} function attribute, x86
@item amx-int8
@itemx no-amx-int8
-@cindex @code{target("amx-int8")} function attribute, x86
Enable/disable the generation of the AMX-INT8 instructions.
+@cindex @code{target("amx-bf16")} function attribute, x86
@item amx-bf16
@itemx no-amx-bf16
-@cindex @code{target("amx-bf16")} function attribute, x86
Enable/disable the generation of the AMX-BF16 instructions.
+@cindex @code{target("uintr")} function attribute, x86
@item uintr
@itemx no-uintr
-@cindex @code{target("uintr")} function attribute, x86
Enable/disable the generation of the UINTR instructions.
+@cindex @code{target("hreset")} function attribute, x86
@item hreset
@itemx no-hreset
-@cindex @code{target("hreset")} function attribute, x86
Enable/disable the generation of the HRESET instruction.
+@cindex @code{target("kl")} function attribute, x86
@item kl
@itemx no-kl
-@cindex @code{target("kl")} function attribute, x86
Enable/disable the generation of the KEYLOCKER instructions.
+@cindex @code{target("widekl")} function attribute, x86
@item widekl
@itemx no-widekl
-@cindex @code{target("widekl")} function attribute, x86
Enable/disable the generation of the WIDEKL instructions.
+@cindex @code{target("avxvnni")} function attribute, x86
@item avxvnni
@itemx no-avxvnni
-@cindex @code{target("avxvnni")} function attribute, x86
Enable/disable the generation of the AVXVNNI instructions.
+@cindex @code{target("avxifma")} function attribute, x86
@item avxifma
@itemx no-avxifma
-@cindex @code{target("avxifma")} function attribute, x86
Enable/disable the generation of the AVXIFMA instructions.
+@cindex @code{target("avxvnniint8")} function attribute, x86
@item avxvnniint8
@itemx no-avxvnniint8
-@cindex @code{target("avxvnniint8")} function attribute, x86
Enable/disable the generation of the AVXVNNIINT8 instructions.
+@cindex @code{target("avxneconvert")} function attribute, x86
@item avxneconvert
@itemx no-avxneconvert
-@cindex @code{target("avxneconvert")} function attribute, x86
Enable/disable the generation of the AVXNECONVERT instructions.
+@cindex @code{target("cmpccxadd")} function attribute, x86
@item cmpccxadd
@itemx no-cmpccxadd
-@cindex @code{target("cmpccxadd")} function attribute, x86
Enable/disable the generation of the CMPccXADD instructions.
+@cindex @code{target("amx-fp16")} function attribute, x86
@item amx-fp16
@itemx no-amx-fp16
-@cindex @code{target("amx-fp16")} function attribute, x86
Enable/disable the generation of the AMX-FP16 instructions.
+@cindex @code{target("prefetchi")} function attribute, x86
@item prefetchi
@itemx no-prefetchi
-@cindex @code{target("prefetchi")} function attribute, x86
Enable/disable the generation of the PREFETCHI instructions.
+@cindex @code{target("raoint")} function attribute, x86
@item raoint
@itemx no-raoint
-@cindex @code{target("raoint")} function attribute, x86
Enable/disable the generation of the RAOINT instructions.
+@cindex @code{target("cld")} function attribute, x86
@item cld
@itemx no-cld
-@cindex @code{target("cld")} function attribute, x86
Enable/disable the generation of the CLD before string moves.
+@cindex @code{target("fancy-math-387")} function attribute, x86
@item fancy-math-387
@itemx no-fancy-math-387
-@cindex @code{target("fancy-math-387")} function attribute, x86
Enable/disable the generation of the @code{sin}, @code{cos}, and
@code{sqrt} instructions on the 387 floating-point unit.
+@cindex @code{target("ieee-fp")} function attribute, x86
@item ieee-fp
@itemx no-ieee-fp
-@cindex @code{target("ieee-fp")} function attribute, x86
Enable/disable the generation of floating point that depends on IEEE arithmetic.
+@cindex @code{target("inline-all-stringops")} function attribute, x86
@item inline-all-stringops
@itemx no-inline-all-stringops
-@cindex @code{target("inline-all-stringops")} function attribute, x86
Enable/disable inlining of string operations.
+@cindex @code{target("inline-stringops-dynamically")} function attribute, x86
@item inline-stringops-dynamically
@itemx no-inline-stringops-dynamically
-@cindex @code{target("inline-stringops-dynamically")} function attribute, x86
Enable/disable the generation of the inline code to do small string
operations and calling the library routines for large operations.
+@cindex @code{target("align-stringops")} function attribute, x86
@item align-stringops
@itemx no-align-stringops
-@cindex @code{target("align-stringops")} function attribute, x86
Do/do not align destination of inlined string operations.
+@cindex @code{target("recip")} function attribute, x86
@item recip
@itemx no-recip
-@cindex @code{target("recip")} function attribute, x86
Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS
instructions followed an additional Newton-Raphson step instead of
doing a floating-point division.
-@item general-regs-only
@cindex @code{target("general-regs-only")} function attribute, x86
+@item general-regs-only
Generate code which uses only the general registers.
-@item arch=@var{ARCH}
@cindex @code{target("arch=@var{ARCH}")} function attribute, x86
+@item arch=@var{ARCH}
Specify the architecture to generate code for in compiling the function.
-@item tune=@var{TUNE}
@cindex @code{target("tune=@var{TUNE}")} function attribute, x86
+@item tune=@var{TUNE}
Specify the architecture to tune for in compiling the function.
-@item fpmath=@var{FPMATH}
@cindex @code{target("fpmath=@var{FPMATH}")} function attribute, x86
+@item fpmath=@var{FPMATH}
Specify which floating-point unit to use. You must specify the
@code{target("fpmath=sse,387")} option as
@code{target("fpmath=sse+387")} because the comma would separate
different options.
-@item prefer-vector-width=@var{OPT}
@cindex @code{prefer-vector-width} function attribute, x86
+@item prefer-vector-width=@var{OPT}
On x86 targets, the @code{prefer-vector-width} attribute informs the
compiler to use @var{OPT}-bit vector width in instructions
instead of the default on the selected platform.
with @code{target("sse2")}, since @code{-msse3} implies @code{-msse2}.
@end table
-@item indirect_branch("@var{choice}")
@cindex @code{indirect_branch} function attribute, x86
+@item indirect_branch("@var{choice}")
On x86 targets, the @code{indirect_branch} attribute causes the compiler
to convert indirect call and jump with @var{choice}. @samp{keep}
keeps indirect call and jump unmodified. @samp{thunk} converts indirect
@samp{thunk-extern} converts indirect call and jump to external call
and return thunk provided in a separate object file.
-@item function_return("@var{choice}")
@cindex @code{function_return} function attribute, x86
+@item function_return("@var{choice}")
On x86 targets, the @code{function_return} attribute causes the compiler
to convert function return with @var{choice}. @samp{keep} keeps function
return unmodified. @samp{thunk} converts function return to call and
call and return thunk. @samp{thunk-extern} converts function return to
external call and return thunk provided in a separate object file.
-@item nocf_check
@cindex @code{nocf_check} function attribute
+@item nocf_check
The @code{nocf_check} attribute on a function is used to inform the
compiler that the function's prologue should not be instrumented when
compiled with the @option{-fcf-protection=branch} option. The
@}
@end smallexample
-@item cf_check
@cindex @code{cf_check} function attribute, x86
+@item cf_check
The @code{cf_check} attribute on a function is used to inform the
compiler that ENDBR instruction should be placed at the function
entry when @option{-fcf-protection=branch} is enabled.
-@item indirect_return
@cindex @code{indirect_return} function attribute, x86
+@item indirect_return
The @code{indirect_return} attribute can be applied to a function,
as well as variable or type of function pointer to inform the
compiler that the function may return via indirect branch.
-@item fentry_name("@var{name}")
@cindex @code{fentry_name} function attribute, x86
+@item fentry_name("@var{name}")
On x86 targets, the @code{fentry_name} attribute sets the function to
call on function entry when function instrumentation is enabled
with @option{-pg -mfentry}. When @var{name} is nop then a 5 byte
nop sequence is generated.
-@item fentry_section("@var{name}")
@cindex @code{fentry_section} function attribute, x86
+@item fentry_section("@var{name}")
On x86 targets, the @code{fentry_section} attribute sets the name
of the section to record function entry instrumentation calls in when
enabled with @option{-pg -mrecord-mcount}
-@item nodirect_extern_access
@cindex @code{nodirect_extern_access} function attribute
@opindex mno-direct-extern-access
+@item nodirect_extern_access
This attribute, attached to a global variable or function, is the
counterpart to option @option{-mno-direct-extern-access}.
These function attributes are supported by the Xstormy16 back end:
@table @code
-@item interrupt
@cindex @code{interrupt} function attribute, Xstormy16
+@item interrupt
Use this attribute to indicate
that the specified function is an interrupt handler. The compiler generates
function entry and exit sequences suitable for use in an interrupt handler
@table @code
-@item alias ("@var{target}")
@cindex @code{alias} variable attribute
+@item alias ("@var{target}")
The @code{alias} variable attribute causes the declaration to be emitted
as an alias for another symbol known as an @dfn{alias target}. Except
for top-level qualifiers the alias target must have the same type as
the strictness for the specific trailing array field is determined by the
attribute.
+@cindex @code{alloc_size} variable attribute
@item alloc_size (@var{position})
@itemx alloc_size (@var{position-1}, @var{position-2})
-@cindex @code{alloc_size} variable attribute
The @code{alloc_size} variable attribute may be applied to the declaration
of a pointer to a function that returns a pointer and takes at least one
argument of an integer type. It indicates that the returned pointer points
@code{malloc_ptr}, like the standard C function @code{malloc},
returns an object whose size is given by argument 1 to the function.
-@item cleanup (@var{cleanup_function})
@cindex @code{cleanup} variable attribute
+@item cleanup (@var{cleanup_function})
The @code{cleanup} attribute runs a function when the variable goes
out of scope. This attribute can only be applied to auto function
scope variables; it may not be applied to parameters or variables
It is undefined what happens if @var{cleanup_function} does not
return normally.
-@item common
-@itemx nocommon
@cindex @code{common} variable attribute
@cindex @code{nocommon} variable attribute
@opindex fcommon
@opindex fno-common
+@item common
+@itemx nocommon
The @code{common} attribute requests GCC to place a variable in
``common'' storage. The @code{nocommon} attribute requests the
opposite---to allocate space for it directly.
These attributes override the default chosen by the
@option{-fno-common} and @option{-fcommon} flags respectively.
+@cindex @code{copy} variable attribute
@item copy
@itemx copy (@var{variable})
-@cindex @code{copy} variable attribute
The @code{copy} attribute applies the set of attributes with which
@var{variable} has been declared to the declaration of the variable
to which the attribute is applied. The attribute is designed for
attribute is also not copied. @xref{Common Function Attributes}.
@xref{Common Type Attributes}.
+@cindex @code{deprecated} variable attribute
@item deprecated
@itemx deprecated (@var{msg})
-@cindex @code{deprecated} variable attribute
The @code{deprecated} attribute results in a warning if the variable
is used anywhere in the source file. This is useful when identifying
variables that are expected to be removed in a future version of a
The message attached to the attribute is affected by the setting of
the @option{-fmessage-length} option.
+@cindex @code{unavailable} variable attribute
@item unavailable
@itemx unavailable (@var{msg})
-@cindex @code{unavailable} variable attribute
The @code{unavailable} attribute indicates that the variable so marked
is not available, if it is used anywhere in the source file. It behaves
in the same manner as the @code{deprecated} attribute except that the
types (@pxref{Common Function Attributes},
@pxref{Common Type Attributes}).
-@item mode (@var{mode})
@cindex @code{mode} variable attribute
+@item mode (@var{mode})
This attribute specifies the data type for the declaration---whichever
type corresponds to the mode @var{mode}. This in effect lets you
request an integer or floating-point type according to its width.
@code{__word__} for the mode of a one-word integer, and @code{pointer}
or @code{__pointer__} for the mode used to represent pointers.
-@item nonstring
@cindex @code{nonstring} variable attribute
+@item nonstring
The @code{nonstring} variable attribute specifies that an object or member
declaration with type array of @code{char}, @code{signed char}, or
@code{unsigned char}, or pointer to such a type is intended to store
@}
@end smallexample
-@item packed
@cindex @code{packed} variable attribute
+@item packed
The @code{packed} attribute specifies that a structure member should have
the smallest possible alignment---one bit for a bit-field and one byte
otherwise, unless a larger value is specified with the @code{aligned}
structure layout. See the documentation of
@option{-Wpacked-bitfield-compat} for more information.
-@item section ("@var{section-name}")
@cindex @code{section} variable attribute
+@item section ("@var{section-name}")
Normally, the compiler places the objects it generates in sections like
@code{data} and @code{bss}. Sometimes, however, you need additional sections,
or you need certain particular variables to appear in special sections,
If you need to map the entire contents of a module to a particular
section, consider using the facilities of the linker instead.
-@item tls_model ("@var{tls_model}")
@cindex @code{tls_model} variable attribute
+@item tls_model ("@var{tls_model}")
The @code{tls_model} attribute sets thread-local storage model
(@pxref{Thread-Local}) of a particular @code{__thread} variable,
overriding @option{-ftls-model=} command-line switch on a per-variable
Not all targets support this attribute.
-@item unused
@cindex @code{unused} variable attribute
+@item unused
This attribute, attached to a variable or structure field, means that
the variable or field is meant to be possibly unused. GCC does not
produce a warning for this variable or field.
-@item used
@cindex @code{used} variable attribute
+@item used
This attribute, attached to a variable with static storage, means that
the variable must be emitted even if it appears that the variable is not
referenced.
attribute also means that the member is instantiated if the
class itself is instantiated.
-@item retain
@cindex @code{retain} variable attribute
+@item retain
For ELF targets that support the GNU or FreeBSD OSABIs, this attribute
will save the variable from linker garbage collection. To support
this behavior, variables that have not been placed in specific sections
This additional functionality requires Binutils version 2.36 or later.
-@item uninitialized
@cindex @code{uninitialized} variable attribute
+@item uninitialized
This attribute, attached to a variable with automatic storage, means that
the variable should not be automatically initialized by the compiler when
the option @code{-ftrivial-auto-var-init} presents.
This attribute has no effect when the option @code{-ftrivial-auto-var-init}
does not present.
-@item vector_size (@var{bytes})
@cindex @code{vector_size} variable attribute
+@item vector_size (@var{bytes})
This attribute specifies the vector size for the type of the declared
variable, measured in bytes. The type to which it applies is known as
the @dfn{base type}. The @var{bytes} argument must be a positive
is invalid even if the size of the structure is the same as the size of
the @code{int}.
-@item visibility ("@var{visibility_type}")
@cindex @code{visibility} variable attribute
+@item visibility ("@var{visibility_type}")
This attribute affects the linkage of the declaration to which it is attached.
The @code{visibility} attribute is described in
@ref{Common Function Attributes}.
-@item weak
@cindex @code{weak} variable attribute
+@item weak
The @code{weak} attribute is described in
@ref{Common Function Attributes}.
-@item noinit
@cindex @code{noinit} variable attribute
+@item noinit
Any data with the @code{noinit} attribute will not be initialized by
the C runtime startup code, or the program loader. Not initializing
data in this way can reduce program startup times.
script to place sections with the @code{.noinit} prefix in the right
location.
-@item persistent
@cindex @code{persistent} variable attribute
+@item persistent
Any data with the @code{persistent} attribute will not be initialized by
the C runtime startup code, but will be initialized by the program
loader. This enables the value of the variable to @samp{persist}
right location. Specifically, some type of non-volatile, writeable
memory is required.
-@item objc_nullability (@var{nullability kind}) @r{(Objective-C and Objective-C++ only)}
@cindex @code{objc_nullability} variable attribute
+@item objc_nullability (@var{nullability kind}) @r{(Objective-C and Objective-C++ only)}
This attribute applies to pointer variables only. It allows marking the
pointer with one of four possible values describing the conditions under
which the pointer might have a @code{nil} value. In most cases, the
@subsection ARC Variable Attributes
@table @code
-@item aux
@cindex @code{aux} variable attribute, ARC
+@item aux
The @code{aux} attribute is used to directly access the ARC's
auxiliary register space from C. The auxilirary register number is
given via attribute argument.
@subsection AVR Variable Attributes
@table @code
-@item progmem
@cindex @code{progmem} variable attribute, AVR
+@item progmem
The @code{progmem} attribute is used on the AVR to place read-only
data in the non-volatile program memory (flash). The @code{progmem}
attribute accomplishes this by putting respective variables into a
@end table
+@cindex @code{io} variable attribute, AVR
@item io
@itemx io (@var{addr})
-@cindex @code{io} variable attribute, AVR
Variables with the @code{io} attribute are used to address
memory-mapped peripherals in the io address range.
If an address is specified, the variable
extern volatile int porta __attribute__((io));
@end smallexample
+@cindex @code{io_low} variable attribute, AVR
@item io_low
@itemx io_low (@var{addr})
-@cindex @code{io_low} variable attribute, AVR
This is like the @code{io} attribute, but additionally it informs the
compiler that the object lies in the lower half of the I/O area,
allowing the use of @code{cbi}, @code{sbi}, @code{sbic} and @code{sbis}
instructions.
+@cindex @code{address} variable attribute, AVR
@item address
@itemx address (@var{addr})
-@cindex @code{address} variable attribute, AVR
Variables with the @code{address} attribute are used to address
memory-mapped peripherals that may lie outside the io address range.
volatile int porta __attribute__((address (0x600)));
@end smallexample
-@item absdata
@cindex @code{absdata} variable attribute, AVR
+@item absdata
Variables in static storage and with the @code{absdata} attribute can
be accessed by the @code{LDS} and @code{STS} instructions which take
absolute addresses.
Three attributes are currently defined for the Blackfin.
@table @code
-@item l1_data
-@itemx l1_data_A
-@itemx l1_data_B
@cindex @code{l1_data} variable attribute, Blackfin
@cindex @code{l1_data_A} variable attribute, Blackfin
@cindex @code{l1_data_B} variable attribute, Blackfin
+@item l1_data
+@itemx l1_data_A
+@itemx l1_data_B
Use these attributes on the Blackfin to place the variable into L1 Data SRAM.
Variables with @code{l1_data} attribute are put into the specific section
named @code{.l1.data}. Those with @code{l1_data_A} attribute are put into
the specific section named @code{.l1.data.A}. Those with @code{l1_data_B}
attribute are put into the specific section named @code{.l1.data.B}.
-@item l2
@cindex @code{l2} variable attribute, Blackfin
+@item l2
Use this attribute on the Blackfin to place the variable into L2 SRAM.
Variables with @code{l2} attribute are put into the specific section
named @code{.l2.data}.
These variable attributes are available for H8/300 targets:
@table @code
-@item eightbit_data
@cindex @code{eightbit_data} variable attribute, H8/300
@cindex eight-bit data on the H8/300, H8/300H, and H8S
+@item eightbit_data
Use this attribute on the H8/300, H8/300H, and H8S to indicate that the specified
variable should be placed into the eight-bit data section.
The compiler generates more efficient code for certain operations
You must use GAS and GLD from GNU binutils version 2.7 or later for
this attribute to work correctly.
-@item tiny_data
@cindex @code{tiny_data} variable attribute, H8/300
@cindex tiny data section on the H8/300H and H8S
+@item tiny_data
Use this attribute on the H8/300H and H8S to indicate that the specified
variable should be placed into the tiny data section.
The compiler generates more efficient code for loads and stores
The IA-64 back end supports the following variable attribute:
@table @code
-@item model (@var{model-name})
@cindex @code{model} variable attribute, IA-64
+@item model (@var{model-name})
On IA-64, use this attribute to set the addressability of an object.
At present, the only supported identifier for @var{model-name} is
One attribute is currently defined for the LoongArch.
@table @code
-@item model("@var{name}")
@cindex @code{model} variable attribute, LoongArch
+@item model("@var{name}")
Use this attribute on the LoongArch to use a different code model for
addressing this variable, than the code model specified by the global
@option{-mcmodel} option. This attribute is mostly useful if a
One attribute is currently defined for the M32R/D@.
@table @code
-@item model (@var{model-name})
@cindex @code{model-name} variable attribute, M32R/D
@cindex variable addressability on the M32R/D
+@item model (@var{model-name})
Use this attribute on the M32R/D to set the addressability of an object.
The identifier @var{model-name} is one of @code{small}, @code{medium},
or @code{large}, representing each of the code models.
attributes available on all x86 targets.
@table @code
-@item dllimport
-@itemx dllexport
@cindex @code{dllimport} variable attribute
@cindex @code{dllexport} variable attribute
+@item dllimport
+@itemx dllexport
The @code{dllimport} and @code{dllexport} attributes are described in
@ref{Microsoft Windows Function Attributes}.
-@item selectany
@cindex @code{selectany} variable attribute
+@item selectany
The @code{selectany} attribute causes an initialized global variable to
have link-once semantics. When multiple definitions of the variable are
encountered by the linker, the first is selected and the remainder are
@code{__attribute__ ((selectany))} for compatibility with other
compilers.
-@item shared
@cindex @code{shared} variable attribute
+@item shared
On Microsoft Windows, in addition to putting variable definitions in a named
section, the section can also be shared among all running copies of an
executable or DLL@. For example, this small program defines shared data
@subsection MSP430 Variable Attributes
@table @code
-@item upper
-@itemx either
@cindex @code{upper} variable attribute, MSP430
@cindex @code{either} variable attribute, MSP430
+@item upper
+@itemx either
These attributes are the same as the MSP430 function attributes of the
same name (@pxref{MSP430 Function Attributes}).
-@item lower
@cindex @code{lower} variable attribute, MSP430
+@item lower
This option behaves mostly the same as the MSP430 function attribute of the
same name (@pxref{MSP430 Function Attributes}), but it has some additional
functionality.
These variable attributes are supported by the Nvidia PTX back end:
@table @code
-@item shared
@cindex @code{shared} attribute, Nvidia PTX
+@item shared
Use this attribute to place a variable in the @code{.shared} memory space.
This memory space is private to each cooperative thread array; only threads
within one thread block refer to the same instance of the variable.
@table @code
-@item sda
@cindex @code{sda} variable attribute, V850
+@item sda
Use this attribute to explicitly place a variable in the small data area,
which can hold up to 64 kilobytes.
-@item tda
@cindex @code{tda} variable attribute, V850
+@item tda
Use this attribute to explicitly place a variable in the tiny data area,
which can hold up to 256 bytes in total.
-@item zda
@cindex @code{zda} variable attribute, V850
+@item zda
Use this attribute to explicitly place a variable in the first 32 kilobytes
of memory.
@end table
@code{ms_struct} and @code{gcc_struct}.
@table @code
-@item ms_struct
-@itemx gcc_struct
@cindex @code{ms_struct} variable attribute, x86
@cindex @code{gcc_struct} variable attribute, x86
+@item ms_struct
+@itemx gcc_struct
If @code{packed} is used on a structure, or if bit-fields are used,
it may be that the Microsoft ABI lays out the structure differently
@code{below100}.
@table @code
-@item below100
@cindex @code{below100} variable attribute, Xstormy16
+@item below100
If a variable has the @code{below100} attribute (@code{BELOW100} is
allowed also), GCC places the variable in the first 0x100 bytes of
This warning can be disabled by @option{-Wno-if-not-aligned}.
+@cindex @code{alloc_size} type attribute
@item alloc_size (@var{position})
@itemx alloc_size (@var{position-1}, @var{position-2})
-@cindex @code{alloc_size} type attribute
The @code{alloc_size} type attribute may be applied to the definition
of a type of a function that returns a pointer and takes at least one
argument of an integer type. It indicates that the returned pointer
@code{malloc_type}, like the standard C function @code{malloc},
returns an object whose size is given by argument 1 to the function.
+@cindex @code{copy} type attribute
@item copy
@itemx copy (@var{expression})
-@cindex @code{copy} type attribute
The @code{copy} attribute applies the set of attributes with which
the type of the @var{expression} has been declared to the declaration
of the type to which the attribute is applied. The attribute is
struct __attribute__ ((copy ( (struct A *)0)) B @{ /* @r{@dots{}} */ @};
@end smallexample
+@cindex @code{deprecated} type attribute
@item deprecated
@itemx deprecated (@var{msg})
-@cindex @code{deprecated} type attribute
The @code{deprecated} attribute results in a warning if the type
is used anywhere in the source file. This is useful when identifying
types that are expected to be removed in a future version of a program.
The message attached to the attribute is affected by the setting of
the @option{-fmessage-length} option.
+@cindex @code{unavailable} type attribute
@item unavailable
@itemx unavailable (@var{msg})
-@cindex @code{unavailable} type attribute
The @code{unavailable} attribute behaves in the same manner as the
@code{deprecated} one, but emits an error rather than a warning. It is
used to indicate that a (perhaps previously @code{deprecated}) type is
The @code{unavailable} attribute can also be used for functions and
variables (@pxref{Function Attributes}, @pxref{Variable Attributes}.)
-@item designated_init
@cindex @code{designated_init} type attribute
+@item designated_init
This attribute may only be applied to structure types. It indicates
that any initialization of an object of this type must use designated
initializers rather than positional initializers. The intent of this
GCC emits warnings based on this attribute by default; use
@option{-Wno-designated-init} to suppress them.
-@item may_alias
@cindex @code{may_alias} type attribute
+@item may_alias
Accesses through pointers to types with this attribute are not subject
to type-based alias analysis, but are instead assumed to be able to alias
any other type of objects.
@option{-fstrict-aliasing}, which is on by default at @option{-O2} or
above.
-@item mode (@var{mode})
@cindex @code{mode} type attribute
+@item mode (@var{mode})
This attribute specifies the data type for the declaration---whichever
type corresponds to the mode @var{mode}. This in effect lets you
request an integer or floating-point type according to its width.
@code{__word__} for the mode of a one-word integer, and @code{pointer}
or @code{__pointer__} for the mode used to represent pointers.
-@item packed
@cindex @code{packed} type attribute
+@item packed
This attribute, attached to a @code{struct}, @code{union}, or C++ @code{class}
type definition, specifies that each of its members (other than zero-width
bit-fields) is placed to minimize the memory required. This is equivalent
not on a @code{typedef} that does not also define the enumerated type,
structure, union, or class.
-@item scalar_storage_order ("@var{endianness}")
@cindex @code{scalar_storage_order} type attribute
+@item scalar_storage_order ("@var{endianness}")
When attached to a @code{union} or a @code{struct}, this attribute sets
the storage order, aka endianness, of the scalar fields of the type, as
well as the array fields whose component is scalar. The supported
through distinct types that assign a different storage order to it, then the
behavior is undefined.
-@item transparent_union
@cindex @code{transparent_union} type attribute
+@item transparent_union
This attribute, attached to a @code{union} type definition, indicates
that any function parameter having that union type causes calls to that
@}
@end smallexample
-@item unused
@cindex @code{unused} type attribute
+@item unused
When attached to a type (including a @code{union} or a @code{struct}),
this attribute means that variables of that type are meant to appear
possibly unused. GCC does not produce a warning for any variables of
not referenced, but contain constructors and destructors that have
nontrivial bookkeeping functions.
-@item vector_size (@var{bytes})
@cindex @code{vector_size} type attribute
+@item vector_size (@var{bytes})
This attribute specifies the vector size for the type, measured in bytes.
The type to which it applies is known as the @dfn{base type}. The @var{bytes}
argument must be a positive power-of-two multiple of the base type size. For
declares @code{get_flt_vec16} to be a function returning a 16-byte vector
with the base type @code{float}.
-@item visibility
@cindex @code{visibility} type attribute
+@item visibility
In C++, attribute visibility (@pxref{Function Attributes}) can also be
applied to class, struct, union and enum types. Unlike other type
attributes, the attribute must appear between the initial keyword and
Otherwise the two shared objects are unable to use the same
typeinfo node and exception handling will break.
-@item objc_root_class @r{(Objective-C and Objective-C++ only)}
@cindex @code{objc_root_class} type attribute
+@item objc_root_class @r{(Objective-C and Objective-C++ only)}
This attribute marks a class as being a root class, and thus allows
the compiler to elide any warnings about a missing superclass and to
make additional checks for mandatory methods as needed.
@table @code
-@item ms_struct
-@itemx gcc_struct
@cindex @code{ms_struct} type attribute, x86
@cindex @code{gcc_struct} type attribute, x86
+@item ms_struct
+@itemx gcc_struct
If @code{packed} is used on a structure, or if bit-fields are used
it may be that the Microsoft ABI packs them differently
@end smallexample
@table @code
-@item unused
@cindex @code{unused} label attribute
+@item unused
This feature is intended for program-generated code that may contain
unused labels, but which is compiled with @option{-Wall}. It is
not normally appropriate to use in it human-written code, though it
could be useful in cases where the code that jumps to the label is
contained within an @code{#ifdef} conditional.
-@item hot
@cindex @code{hot} label attribute
+@item hot
The @code{hot} attribute on a label is used to inform the compiler that
the path following the label is more likely than paths that are not so
annotated. This attribute is used in cases where @code{__builtin_expect}
cannot be used, for instance with computed goto or @code{asm goto}.
-@item cold
@cindex @code{cold} label attribute
+@item cold
The @code{cold} attribute on labels is used to inform the compiler that
the path following the label is unlikely to be executed. This attribute
is used in cases where @code{__builtin_expect} cannot be used, for instance
@end smallexample
@table @code
-@item deprecated
@cindex @code{deprecated} enumerator attribute
+@item deprecated
The @code{deprecated} attribute results in a warning if the enumerator
is used anywhere in the source file. This is useful when identifying
enumerators that are expected to be removed in a future version of a
information about why the enumerator is deprecated, or what they should
do instead. Note that the warnings only occurs for uses.
-@item unavailable
@cindex @code{unavailable} enumerator attribute
+@item unavailable
The @code{unavailable} attribute results in an error if the enumerator
is used anywhere in the source file. In other respects it behaves in the
same manner as the @code{deprecated} attribute.
(@pxref{Enumerator Attributes}), and for types (@pxref{Type Attributes}).
@table @code
-@item fallthrough
@cindex @code{fallthrough} statement attribute
+@item fallthrough
The @code{fallthrough} attribute with a null statement serves as a
fallthrough statement. It hints to the compiler that a statement
that falls through to another case label, or user-defined label
@}
@end smallexample
-@item assume
@cindex @code{assume} statement attribute
+@item assume
The @code{assume} attribute with a null statement serves as portable
assumption. It should have a single argument, a conditional expression,
which is not evaluated. If the argument would evaluate to true
aliases.
@table @code
-@item #pragma weak @var{symbol}
@cindex pragma, weak
+@item #pragma weak @var{symbol}
This pragma declares @var{symbol} to be weak, as if the declaration
had the attribute of the same name. The pragma may appear before
or after the declaration of @var{symbol}. It is not an error for
@table @gcctabopt
@opindex @code{ffree-form}
@opindex @code{ffixed-form}
-@item -ffree-form
-@itemx -ffixed-form
@cindex options, Fortran dialect
@cindex file format, free
@cindex file format, fixed
+@item -ffree-form
+@itemx -ffixed-form
Specify the layout used by the source file. The free form layout
was introduced in Fortran 90. Fixed form was traditionally used in
older Fortran programs. When neither option is specified, the source
following the final comma.
@opindex @code{fdollar-ok}
-@item -fdollar-ok
@cindex @code{$}
@cindex symbol names
@cindex character set
+@item -fdollar-ok
Allow @samp{$} as a valid non-first character in a symbol name. Symbols
that start with @samp{$} are rejected since it is unclear which rules to
apply to implicit typing as different vendors implement different rules.
Using @samp{$} in @code{IMPLICIT} statements is also rejected.
@opindex @code{backslash}
-@item -fbackslash
@cindex backslash
@cindex escape characters
+@item -fbackslash
Change the interpretation of backslashes in string literals from a single
backslash character to ``C-style'' escape characters. The following
combinations are expanded @code{\a}, @code{\b}, @code{\f}, @code{\n},
unexpanded.
@opindex @code{fmodule-private}
-@item -fmodule-private
@cindex module entities
@cindex private
+@item -fmodule-private
Set the default accessibility of module entities to @code{PRIVATE}.
Use-associated entities will not be accessible unless they are explicitly
declared as @code{PUBLIC}.
@opindex @code{ffixed-line-length-}@var{n}
-@item -ffixed-line-length-@var{n}
@cindex file format, fixed
+@item -ffixed-line-length-@var{n}
Set column after which characters are ignored in typical fixed-form
lines in the source file, and, unless @code{-fno-pad-source}, through which
spaces are assumed (as if padded to that length) after the ends of short
to them to fill out the line.
@opindex @code{ffree-line-length-}@var{n}
-@item -ffree-line-length-@var{n}
@cindex file format, free
+@item -ffree-line-length-@var{n}
Set column after which characters are ignored in typical free-form
lines in the source file. The default value is 132.
@var{n} may be @samp{none}, meaning that the entire line is meaningful.
functionality.
@opindex @code{fopenacc}
-@item -fopenacc
@cindex OpenACC
+@item -fopenacc
Enable the OpenACC extensions. This includes OpenACC @code{!$acc}
directives in free form and @code{c$acc}, @code{*$acc} and
@code{!$acc} directives in fixed form, @code{!$} conditional
OpenACC runtime library to be linked in.
@opindex @code{fopenmp}
-@item -fopenmp
@cindex OpenMP
+@item -fopenmp
Enable the OpenMP extensions. This includes OpenMP @code{!$omp} directives
in free form
and @code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form,
@opindex @code{freal-8-real-4}
@opindex @code{freal-8-real-10}
@opindex @code{freal-8-real-16}
+@cindex options, real kind type promotion
@item -freal-4-real-8
@itemx -freal-4-real-10
@itemx -freal-4-real-16
@itemx -freal-8-real-4
@itemx -freal-8-real-10
@itemx -freal-8-real-16
-@cindex options, real kind type promotion
Promote all @code{REAL(KIND=M)} entities to @code{REAL(KIND=N)} entities.
If @code{REAL(KIND=N)} is unavailable, then an error will be issued.
The @code{-freal-4-} flags also affect the default real kind and the
@table @gcctabopt
@opindex @code{cpp}
@opindex @code{fpp}
-@item -cpp
-@itemx -nocpp
@cindex preprocessor, enable
@cindex preprocessor, disable
+@item -cpp
+@itemx -nocpp
Enable preprocessing. The preprocessor is automatically invoked if
the file extension is @file{.fpp}, @file{.FPP}, @file{.F}, @file{.FOR},
@file{.FTN}, @file{.F90}, @file{.F95}, @file{.F03} or @file{.F08}. Use
options.
@opindex @code{dM}
-@item -dM
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dM
Instead of the normal output, generate a list of @code{'#define'}
directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way
will show all the predefined macros.
@opindex @code{dD}
-@item -dD
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dD
Like @option{-dM} except in two respects: it does not include the
predefined macros, and it outputs both the @code{#define} directives
and the result of preprocessing. Both kinds of output go to the
standard output file.
@opindex @code{dN}
-@item -dN
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dN
Like @option{-dD}, but emit only the macro names, not their expansions.
@opindex @code{dU}
-@item -dU
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dU
Like @option{dD} except that only macros that are expanded, or whose
definedness is tested in preprocessor directives, are output; the
output is delayed until the use or test of the macro; and @code{'#undef'}
directives are also output for macros tested but undefined at the time.
@opindex @code{dI}
-@item -dI
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dI
Output @code{'#include'} directives in addition to the result
of preprocessing.
@opindex @code{fworking-directory}
-@item -fworking-directory
@cindex preprocessor, working directory
+@item -fworking-directory
Enable generation of linemarkers in the preprocessor output that will
let the compiler know the current working directory at the time of
preprocessing. When this option is enabled, the preprocessor will emit,
directives are emitted whatsoever.
@opindex @code{idirafter @var{dir}}
-@item -idirafter @var{dir}
@cindex preprocessing, include path
+@item -idirafter @var{dir}
Search @var{dir} for include files, but do it after all directories
specified with @option{-I} and the standard system directories have
been exhausted. @var{dir} is treated as a system include directory.
the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
@opindex @code{imultilib @var{dir}}
-@item -imultilib @var{dir}
@cindex preprocessing, include path
+@item -imultilib @var{dir}
Use @var{dir} as a subdirectory of the directory containing target-specific
C++ headers.
@opindex @code{iprefix @var{prefix}}
-@item -iprefix @var{prefix}
@cindex preprocessing, include path
+@item -iprefix @var{prefix}
Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
options. If the @var{prefix} represents a directory, you should include
the final @code{'/'}.
@opindex @code{isysroot @var{dir}}
-@item -isysroot @var{dir}
@cindex preprocessing, include path
+@item -isysroot @var{dir}
This option is like the @option{--sysroot} option, but applies only to
header files. See the @option{--sysroot} option for more information.
@opindex @code{iquote @var{dir}}
-@item -iquote @var{dir}
@cindex preprocessing, include path
+@item -iquote @var{dir}
Search @var{dir} only for header files requested with @code{#include "file"};
they are not searched for @code{#include <file>}, before all directories
specified by @option{-I} and before the standard system directories. If
sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
@opindex @code{isystem @var{dir}}
-@item -isystem @var{dir}
@cindex preprocessing, include path
+@item -isystem @var{dir}
Search @var{dir} for header files, after all directories specified by
@option{-I} but before the standard system directories. Mark it as a
system directory, so that it gets the same special treatment as is
The standard predefined macros remain defined.
@opindex @code{A@var{predicate}=@var{answer}}
-@item -A@var{predicate}=@var{answer}
@cindex preprocessing, assertion
+@item -A@var{predicate}=@var{answer}
Make an assertion with the predicate @var{predicate} and answer @var{answer}.
This form is preferred to the older form -A predicate(answer), which is still
supported, because it does not use shell special characters.
@opindex @code{A-@var{predicate}=@var{answer}}
-@item -A-@var{predicate}=@var{answer}
@cindex preprocessing, assertion
+@item -A-@var{predicate}=@var{answer}
Cancel an assertion with the predicate @var{predicate} and answer @var{answer}.
@opindex @code{C}
-@item -C
@cindex preprocessing, keep comments
+@item -C
Do not discard comments. All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive.
does not yet recognize Fortran-style comments.
@opindex @code{CC}
-@item -CC
@cindex preprocessing, keep comments
+@item -CC
Do not discard comments, including during macro expansion. This is like
@option{-C}, except that comments contained within macros are also passed
through to the output file where the macro is expanded.
preprocessor does not yet recognize Fortran-style comments.
@opindex @code{D@var{name}}
-@item -D@var{name}
@cindex preprocessing, define macros
+@item -D@var{name}
Predefine name as a macro, with definition @code{1}.
@opindex @code{D@var{name}=@var{definition}}
-@item -D@var{name}=@var{definition}
@cindex preprocessing, define macros
+@item -D@var{name}=@var{definition}
The contents of @var{definition} are tokenized and processed as if they
appeared during translation phase three in a @code{'#define'} directive.
In particular, the definition will be truncated by embedded newline
stack it is.
@opindex @code{P}
-@item -P
@cindex preprocessing, no linemarkers
+@item -P
Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that
is not C code, and will be sent to a program which might be confused
by the linemarkers.
@opindex @code{U@var{name}}
-@item -U@var{name}
@cindex preprocessing, undefine macros
+@item -U@var{name}
Cancel any previous definition of @var{name}, either built in or provided
with a @option{-D} option.
@end table
@table @gcctabopt
@opindex @code{fmax-errors=}@var{n}
-@item -fmax-errors=@var{n}
@cindex errors, limiting
+@item -fmax-errors=@var{n}
Limits the maximum number of error messages to @var{n}, at which point
GNU Fortran bails out rather than attempting to continue processing the
source code. If @var{n} is 0, there is no limit on the number of error
messages produced.
@opindex @code{fsyntax-only}
-@item -fsyntax-only
@cindex syntax checking
+@item -fsyntax-only
Check the code for syntax errors, but do not actually compile it. This
will generate module files for each module present in the code, but no
other output file.
warnings.
@opindex @code{Wall}
-@item -Wall
@cindex all warnings
@cindex warnings, all
+@item -Wall
Enables commonly used warning options pertaining to usage that
we recommend avoiding and that we believe are easy to avoid.
This currently includes @option{-Waliasing}, @option{-Wampersand},
and @option{-Wundefined-do-loop}.
@opindex @code{Waliasing}
-@item -Waliasing
@cindex aliasing
@cindex warnings, aliasing
+@item -Waliasing
Warn about possible aliasing of dummy arguments. Specifically, it warns
if the same actual argument is associated with a dummy argument with
@code{INTENT(IN)} and a dummy argument with @code{INTENT(OUT)} in a call
@end smallexample
@opindex @code{Wampersand}
-@item -Wampersand
@cindex warnings, ampersand
@cindex @code{&}
+@item -Wampersand
Warn about missing ampersand in continued character constants. The
warning is given with @option{-Wampersand}, @option{-pedantic},
@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and
initiated the continuation.
@opindex @code{Warray-temporaries}
-@item -Warray-temporaries
@cindex warnings, array temporaries
+@item -Warray-temporaries
Warn about array temporaries generated by the compiler. The information
generated by this warning is sometimes useful in optimization, in order to
avoid such temporaries.
@opindex @code{Wc-binding-type}
-@item -Wc-binding-type
@cindex warning, C binding type
+@item -Wc-binding-type
Warn if the a variable might not be C interoperable. In particular, warn if
the variable has been declared using an intrinsic type with default kind
instead of using a kind parameter defined for C interoperability in the
@option{-Wall}.
@opindex @code{Wcharacter-truncation}
-@item -Wcharacter-truncation
@cindex warnings, character truncation
+@item -Wcharacter-truncation
Warn when a character assignment will truncate the assigned string.
@opindex @code{Wline-truncation}
-@item -Wline-truncation
@cindex warnings, line truncation
+@item -Wline-truncation
Warn when a source code line will be truncated. This option is
implied by @option{-Wall}. For free-form source code, the default is
@option{-Werror=line-truncation} such that truncations are reported as
error.
@opindex @code{Wconversion}
-@item -Wconversion
@cindex warnings, conversion
@cindex conversion
+@item -Wconversion
Warn about implicit conversions that are likely to change the value of
the expression after conversion. Implied by @option{-Wall}.
@opindex @code{Wconversion-extra}
-@item -Wconversion-extra
@cindex warnings, conversion
@cindex conversion
+@item -Wconversion-extra
Warn about implicit conversions between different types and kinds. This
option does @emph{not} imply @option{-Wconversion}.
@opindex @code{Wextra}
-@item -Wextra
@cindex extra warnings
@cindex warnings, extra
+@item -Wextra
Enables some warning options for usages of language features which
may be problematic. This currently includes @option{-Wcompare-reals},
@option{-Wunused-parameter} and @option{-Wdo-subscript}.
@opindex @code{Wfrontend-loop-interchange}
-@item -Wfrontend-loop-interchange
@cindex warnings, loop interchange
@cindex loop interchange, warning
+@item -Wfrontend-loop-interchange
Warn when using @option{-ffrontend-loop-interchange} for performing loop
interchanges.
@opindex @code{Wimplicit-interface}
-@item -Wimplicit-interface
@cindex warnings, implicit interface
+@item -Wimplicit-interface
Warn if a procedure is called without an explicit interface.
Note this only checks that an explicit interface is present. It does not
check that the declared interfaces are consistent across program units.
@opindex @code{Wimplicit-procedure}
-@item -Wimplicit-procedure
@cindex warnings, implicit procedure
+@item -Wimplicit-procedure
Warn if a procedure is called that has neither an explicit interface
nor has been declared as @code{EXTERNAL}.
@opindex @code{Winteger-division}
-@item -Winteger-division
@cindex warnings, integer division
@cindex warnings, division of integers
+@item -Winteger-division
Warn if a constant integer division truncates its result.
As an example, 3/5 evaluates to 0.
@opindex @code{Wintrinsics-std}
-@item -Wintrinsics-std
@cindex warnings, non-standard intrinsics
@cindex warnings, intrinsics of other standards
+@item -Wintrinsics-std
Warn if @command{gfortran} finds a procedure named like an intrinsic not
available in the currently selected standard (with @option{-std}) and treats
it as @code{EXTERNAL} procedure because of this. @option{-fall-intrinsics} can
regardless of the selected standard.
@opindex @code{Woverwrite-recursive}
-@item -Wno-overwrite-recursive
@cindex warnings, overwrite recursive
+@item -Wno-overwrite-recursive
Do not warn when @option{-fno-automatic} is used with @option{-frecursive}. Recursion
will be broken if the relevant local variables do not have the attribute
@code{AUTOMATIC} explicitly declared. This option can be used to suppress the warning
@option{-Werror}.
@opindex @code{Wreal-q-constant}
-@item -Wreal-q-constant
@cindex warnings, @code{q} exponent-letter
+@item -Wreal-q-constant
Produce a warning if a real-literal-constant contains a @code{q}
exponent-letter.
@opindex @code{Wsurprising}
-@item -Wsurprising
@cindex warnings, suspicious code
+@item -Wsurprising
Produce a warning when ``suspicious'' code constructs are encountered.
While technically legal these usually indicate that an error has been made.
@end itemize
@opindex @code{Wtabs}
-@item -Wtabs
@cindex warnings, tabs
@cindex tabulators
+@item -Wtabs
By default, tabs are accepted as whitespace, but tabs are not members
of the Fortran Character Set. For continuation lines, a tab followed
by a digit between 1 and 9 is supported. @option{-Wtabs} will cause a
@option{-Wall}.
@opindex @code{Wundefined-do-loop}
-@item -Wundefined-do-loop
@cindex warnings, undefined do loop
+@item -Wundefined-do-loop
Warn if a DO loop with step either 1 or -1 yields an underflow or an overflow
during iteration of an induction variable of the loop.
This option is implied by @option{-Wall}.
@opindex @code{Wunderflow}
-@item -Wunderflow
@cindex warnings, underflow
@cindex underflow
+@item -Wunderflow
Produce a warning when numerical constant expressions are
encountered, which yield an UNDERFLOW during compilation. Enabled by default.
@opindex @code{Wintrinsic-shadow}
-@item -Wintrinsic-shadow
@cindex warnings, intrinsic
@cindex intrinsic
+@item -Wintrinsic-shadow
Warn if a user-defined procedure or module procedure has the same name as an
intrinsic; in this case, an explicit interface or @code{EXTERNAL} or
@code{INTRINSIC} declaration might be needed to get calls later resolved to
the desired intrinsic/procedure. This option is implied by @option{-Wall}.
@opindex @code{Wuse-without-only}
-@item -Wuse-without-only
@cindex warnings, use statements
@cindex intrinsic
+@item -Wuse-without-only
Warn if a @code{USE} statement has no @code{ONLY} qualifier and
thus implicitly imports all public entities of the used module.
@opindex @code{Wunused-dummy-argument}
-@item -Wunused-dummy-argument
@cindex warnings, unused dummy argument
@cindex unused dummy argument
@cindex dummy argument, unused
+@item -Wunused-dummy-argument
Warn about unused dummy arguments. This option is implied by @option{-Wall}.
@opindex @code{Wunused-parameter}
-@item -Wunused-parameter
@cindex warnings, unused parameter
@cindex unused parameter
+@item -Wunused-parameter
Contrary to @command{gcc}'s meaning of @option{-Wunused-parameter},
@command{gfortran}'s implementation of this option does not warn
about unused dummy arguments (see @option{-Wunused-dummy-argument}),
@option{-Wall} is used.
@opindex @code{Walign-commons}
-@item -Walign-commons
@cindex warnings, alignment of @code{COMMON} blocks
@cindex alignment of @code{COMMON} blocks
+@item -Walign-commons
By default, @command{gfortran} warns about any occasion of variables being
padded for proper alignment inside a @code{COMMON} block. This warning can be turned
off via @option{-Wno-align-commons}. See also @option{-falign-commons}.
@opindex @code{Wfunction-elimination}
-@item -Wfunction-elimination
@cindex function elimination
@cindex warnings, function elimination
+@item -Wfunction-elimination
Warn if any calls to impure functions are eliminated by the optimizations
enabled by the @option{-ffrontend-optimize} option.
This option is implied by @option{-Wextra}.
@opindex @code{Wrealloc-lhs}
-@item -Wrealloc-lhs
@cindex Reallocate the LHS in assignments, notification
+@item -Wrealloc-lhs
Warn when the compiler might insert code to for allocation or reallocation of
an allocatable array variable of intrinsic type in intrinsic assignments. In
hot loops, the Fortran 2003 reallocation feature may reduce the performance.
This option is implied by @option{-Wextra}.
@opindex @code{Werror}
-@item -Werror
@cindex warnings, to errors
+@item -Werror
Turns all warnings into errors.
@end table
By default, a summary for all exceptions but @samp{inexact} is shown.
@opindex @code{fno-backtrace}
-@item -fno-backtrace
@cindex backtrace
@cindex trace
+@item -fno-backtrace
When a serious runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error,
floating-point exception, and the other POSIX signals that have the
@table @gcctabopt
@opindex @code{I}@var{dir}
-@item -I@var{dir}
@cindex directory, search paths for inclusion
@cindex inclusion, directory search paths for
@cindex search paths, for included files
@cindex paths, search
@cindex module search path
+@item -I@var{dir}
These affect interpretation of the @code{INCLUDE} directive
(as well as of the @code{#include} directive of the @command{cpp}
preprocessor).
@opindex @code{J}@var{dir}
@opindex @code{M}@var{dir}
-@item -J@var{dir}
@cindex paths, search
@cindex module search path
+@item -J@var{dir}
This option specifies where to put @file{.mod} files for compiled modules.
It is also added to the list of directories to searched by an @code{USE}
statement.
The default is the current directory.
@opindex @code{fintrinsic-modules-path} @var{dir}
-@item -fintrinsic-modules-path @var{dir}
@cindex paths, search
@cindex module search path
+@item -fintrinsic-modules-path @var{dir}
This option specifies the location of pre-compiled intrinsic modules, if
they are not in the default location expected by the compiler.
@end table
@table @gcctabopt
@opindex @code{fno-automatic}
-@item -fno-automatic
@cindex @code{SAVE} statement
@cindex statement, @code{SAVE}
+@item -fno-automatic
Treat each program unit (except those marked as RECURSIVE) as if the
@code{SAVE} statement were specified for every local variable and array
referenced in it. Does not affect common blocks. (Some Fortran compilers
silently ignored unless the @option{-pedantic} option is added.
@opindex ff2c
-@item -ff2c
@cindex calling convention
@cindex @command{f2c} calling convention
@cindex @command{g77} calling convention
@cindex libf2c calling convention
+@item -ff2c
Generate code designed to be compatible with code generated
by @command{g77} and @command{f2c}.
the library implementations use the @option{-fno-f2c} calling conventions.
@opindex @code{fno-underscoring}
-@item -fno-underscoring
@cindex underscore
@cindex symbol names, underscores
@cindex transforming symbol names
@cindex symbol names, transforming
+@item -fno-underscoring
Do not transform names of entities specified in the Fortran
source file by appending underscores to them.
interfaces.
@opindex @code{fsecond-underscore}
-@item -fsecond-underscore
@cindex underscore
@cindex symbol names, underscores
@cindex transforming symbol names
@cindex @command{f2c} calling convention
@cindex @command{g77} calling convention
@cindex libf2c calling convention
+@item -fsecond-underscore
By default, GNU Fortran appends an underscore to external
names. If this option is used GNU Fortran appends two
underscores to names with underscores and one underscore to external names
by use of the @option{-ff2c} option.
@opindex @code{fcoarray}
-@item -fcoarray=@var{<keyword>}
@cindex coarrays
+@item -fcoarray=@var{<keyword>}
@table @asis
@item @samp{none}
@opindex @code{fcheck}
-@item -fcheck=@var{<keyword>}
@cindex array, bounds checking
@cindex bit intrinsics checking
@cindex bounds checking
@cindex checking subscripts
@cindex run-time checking
@cindex checking array temporaries
+@item -fcheck=@var{<keyword>}
Enable the generation of run-time checks; the argument shall be
a comma-delimited list of the following keywords. Prefixing a check with
@option{-fmax-stack-var-size} is specified.
@opindex @code{fpack-derived}
-@item -fpack-derived
@cindex structure packing
+@item -fpack-derived
This option tells GNU Fortran to pack derived type members as closely as
possible. Code compiled with this option is likely to be incompatible
with code compiled without this option, and may execute slower.
@opindex @code{frepack-arrays}
-@item -frepack-arrays
@cindex repacking arrays
+@item -frepack-arrays
In some circumstances GNU Fortran may pass assumed shape array
sections via a descriptor describing a noncontiguous area of memory.
This option adds code to the function prologue to repack the data into
for the affected local variables.
@opindex @code{falign-commons}
-@item -falign-commons
@cindex alignment of @code{COMMON} blocks
+@item -falign-commons
By default, @command{gfortran} enforces proper alignment of all variables in a
@code{COMMON} block by padding them as needed. On certain platforms this is mandatory,
on others it increases performance. If a @code{COMMON} block is not declared with
objects from largest to smallest.
@opindex @code{fno-protect-parens}
-@item -fno-protect-parens
@cindex re-association of parenthesized expressions
+@item -fno-protect-parens
By default the parentheses in expression are honored for all optimization
levels such that the compiler does not do any re-association. Using
@option{-fno-protect-parens} allows the compiler to reorder @code{REAL} and
@option{-Ofast} is given.
@opindex @code{frealloc-lhs}
-@item -frealloc-lhs
@cindex Reallocate the LHS in assignments
+@item -frealloc-lhs
An allocatable left-hand side of an intrinsic assignment is automatically
(re)allocated if it is either unallocated or has a different shape. The
option is enabled by default except when @option{-std=f95} is given. See
also @option{-Wrealloc-lhs}.
@opindex @code{faggressive-function-elimination}
-@item -faggressive-function-elimination
@cindex Elimination of functions with identical argument lists
+@item -faggressive-function-elimination
Functions with identical argument lists are eliminated within
statements, regardless of whether these functions are marked
@code{PURE} or not. For example, in
if @option{-ffrontend-optimize} is in effect.
@opindex @code{frontend-optimize}
-@item -ffrontend-optimize
@cindex Front-end optimization
+@item -ffrontend-optimize
This option performs front-end optimization, based on manipulating
parts the Fortran parse tree. Enabled by default by any @option{-O} option
except @option{-O0} and @option{-Og}. Optimizations enabled by this option
It can be deselected by specifying @option{-fno-frontend-optimize}.
@opindex @code{frontend-loop-interchange}
-@item -ffrontend-loop-interchange
@cindex loop interchange, Fortran
+@item -ffrontend-loop-interchange
Attempt to interchange loops in the Fortran front end where
profitable. Enabled by default by any @option{-O} option.
At the moment, this option only affects @code{FORALL} and
@table @asis
@opindex @code{c-prototypes}
-@item -fc-prototypes
@cindex Generating C prototypes from Fortran BIND(C) enteties
+@item -fc-prototypes
This option will generate C prototypes from @code{BIND(C)} variable
declarations, types and procedure interfaces and writes them to
standard output. @code{ENUM} is not yet supported.
then uses @code{#include "foo.h"}.
@opindex @code{c-prototypes-external}
-@item -fc-prototypes-external
@cindex Generating C prototypes from external procedures
+@item -fc-prototypes-external
This option will generate C prototypes from external functions and
subroutines and write them to standard output. This may be useful for
making sure that C bindings to Fortran code are correct. This option