From patchwork Thu Jul 6 13:25:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 785173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x3JQv3wkwz9s7B for ; Thu, 6 Jul 2017 23:25:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ikBXN+mq"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=QPl8i3oS2R7gcD3gxV4lb94E39YyCsklKkUbBKze9PD 3PZZauJ0l7uRRYiGswlw1Cfz6pXCkkTHl3q5vHJCJSPju1OI1sXPg0oGs2THM9z6 Z2UCloaxHl2XaB9AWN/iZh48TKd0xgLnQQ/XPKmSmAz4aGijc7zEP4cZqM0Yh/Vg = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=mSjeTgIrSCvgRCEAaSXLDPnI0RQ=; b=ikBXN+mqQFv4tYXJr sxdY5FWKptWO2mw89KNo9xAy6jl6jt7AQzOUhYVEb4CT/r/iIWC275d2LJXstEU0 RbUzdugZuPzW2JeV1vxVZRr5U2OMvxAmphWcnOY4xBJMqwxNbIPi6faIYgb5qzNF yc9PtQjhbE7LQcoHWfNVymjQ4U= Received: (qmail 121192 invoked by alias); 6 Jul 2017 13:25:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 121109 invoked by uid 89); 6 Jul 2017 13:25:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Moreover, loaders, porta, retained X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Jul 2017 13:25:24 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC4134E03F for ; Thu, 6 Jul 2017 13:25:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DC4134E03F Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=berrange@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DC4134E03F Received: from redhat.com (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 439C17E906 for ; Thu, 6 Jul 2017 13:25:21 +0000 (UTC) Date: Thu, 6 Jul 2017 14:25:18 +0100 From: "Daniel P. Berrange" To: gcc-patches@gcc.gnu.org Subject: [PATCH] gcc/doc: list what version each attribute was introduced in Message-ID: <20170706132518.GO3988@redhat.com> Reply-To: "Daniel P. Berrange" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.0 (2017-02-23) X-IsSubscribed: yes There are several hundred named attribute keys that have been introduced over many GCC releases. Applications typically need to be compilable with multiple GCC versions, so it is important for developers to know when GCC introduced support for each attribute. This augments the texi docs that list attribute keys with a note of what version introduced the feature. The version information was obtained through archaeology of the GCC source repository release tags, back to gcc-4_0_0-release. For attributes added in 4.0.0 or later, an explicit version will be noted. Any attribute that predates 4.0.0 will simply note that it has existed prior to 4.0.0. It is thought there is little need to go further back in time than 4.0.0 since few, if any, apps will still be using such old compiler versions. Where a named attribute can be used in many contexts (ie the 'visibility' attribute can be used for both functions or variables), it was assumed that the attribute was supported in all use contexts at the same time. Future patches that add new attributes to GCC should be required to follow this new practice, by documenting the version. Signed-off-by: Daniel P. Berrange --- gcc/ChangeLog | 6 + gcc/doc/extend.texi | 614 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 620 insertions(+) NB, I have not signed any FSF individual copyright assignment agreement, as this patch is submitted under Red Hat copyright ownership diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2acf140..d693787 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-06 Daniel P. Berrange + + * doc/extend.texi (Function Attributes, Type Attributes) + Label Attributes, Enumerator Attributes, C++ Attributes): Add + version information for each listed attribute. + 2017-07-06 Christophe Lyon * doc/sourcebuild.texi (Test Directives, Variants of diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 03ba8fc..7df85b0 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2354,6 +2354,8 @@ is not defined in the same translation unit. This attribute requires assembler and object file support, and may not be available on all targets. +Introduced before 4.0.0 + @item aligned (@var{alignment}) @cindex @code{aligned} function attribute This attribute specifies a minimum alignment for the function, @@ -2375,6 +2377,8 @@ further information. The @code{aligned} attribute can also be used for variables and fields (@pxref{Variable Attributes}.) +Introduced before 4.0.0 + @item alloc_align @cindex @code{alloc_align} function attribute The @code{alloc_align} attribute is used to tell the compiler that the @@ -2396,6 +2400,8 @@ void* my_memalign(size_t, size_t) __attribute__((alloc_align(1))) declares that @code{my_memalign} returns memory with minimum alignment given by parameter 1. +Introduced in 4.9.0 + @item alloc_size @cindex @code{alloc_size} function attribute The @code{alloc_size} attribute is used to tell the compiler that the @@ -2421,6 +2427,8 @@ declares that @code{my_calloc} returns memory of the size given by the product of parameter 1 and 2 and that @code{my_realloc} returns memory of the size given by parameter 2. +Introduced in 4.9.0 + @item always_inline @cindex @code{always_inline} function attribute Generally, functions are not inlined unless optimization is specified. @@ -2431,6 +2439,8 @@ Note that if such a function is called indirectly the compiler may or may not inline it depending on optimization level and a failure to inline an indirect call may or may not be diagnosed. +Introduced before 4.0.0 + @item artificial @cindex @code{artificial} function attribute This attribute is useful for small inline wrappers that if possible @@ -2439,6 +2449,8 @@ info format it either means marking the function as artificial or using the caller location for all instructions within the inlined body. +Introduced in 4.3.0 + @item assume_aligned @cindex @code{assume_aligned} function attribute The @code{assume_aligned} attribute is used to tell the compiler that the @@ -2458,12 +2470,16 @@ declares that @code{my_alloc1} returns 16-byte aligned pointer and that @code{my_alloc2} returns a pointer whose value modulo 32 is equal to 8. +Introduced in 4.9.0 + @item bnd_instrument @cindex @code{bnd_instrument} function attribute The @code{bnd_instrument} attribute on functions is used to inform the compiler that the function should be instrumented when compiled with the @option{-fchkp-instrument-marked-only} option. +Introduced in 5.1.0 + @item bnd_legacy @cindex @code{bnd_legacy} function attribute @cindex Pointer Bounds Checker attributes @@ -2471,6 +2487,8 @@ The @code{bnd_legacy} attribute on functions is used to inform the compiler that the function should not be instrumented when compiled with the @option{-fcheck-pointer-bounds} option. +Introduced in 5.1.0 + @item cold @cindex @code{cold} function attribute The @code{cold} attribute on functions is used to inform the compiler that @@ -2486,6 +2504,8 @@ of hot functions that do call marked functions in rare occasions. When profile feedback is available, via @option{-fprofile-use}, cold functions are automatically detected and this attribute is ignored. +Introduced in 4.3.0 + @item const @cindex @code{const} function attribute @cindex functions that have no side effects @@ -2501,6 +2521,8 @@ function that calls a non-@code{const} function usually must not be @code{const}. It does not make sense for a @code{const} function to return @code{void}. +Introduced before 4.0.0 + @item constructor @itemx destructor @itemx constructor (@var{priority}) @@ -2529,6 +2551,8 @@ decorated with attribute @code{constructor} are invoked is unspecified. In mixed declarations, attribute @code{init_priority} can be used to impose a specific ordering. +Introduced before 4.0.0 + @item deprecated @itemx deprecated (@var{msg}) @cindex @code{deprecated} function attribute @@ -2554,6 +2578,8 @@ present. The @code{deprecated} attribute can also be used for variables and types (@pxref{Variable Attributes}, @pxref{Type Attributes}.) +Introduced before 4.0.0 + @item error ("@var{message}") @itemx warning ("@var{message}") @cindex @code{error} function attribute @@ -2574,6 +2600,8 @@ when using these attributes the problem is diagnosed earlier and with exact location of the call even in presence of inline functions or when not emitting debugging information. +Introduced in 4.3.0 + @item externally_visible @cindex @code{externally_visible} function attribute This attribute, attached to a global variable or function, nullifies @@ -2589,6 +2617,8 @@ produced by @command{gold}. For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary. +Introduced in 4.1.0 + @item flatten @cindex @code{flatten} function attribute Generally, inlining into a function is limited. For a function marked with @@ -2596,6 +2626,8 @@ this attribute, every call inside this function is inlined, if possible. Whether the function itself is considered for inlining depends on its size and the current inlining parameters. +Introduced in 4.1.0 + @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 @@ -2673,6 +2705,8 @@ The target may also provide additional types of format checks. @xref{Target Format Checks,,Format Checks Specific to Particular Target Machines}. +Introduced before 4.0.0 + @item format_arg (@var{string-index}) @cindex @code{format_arg} function attribute @opindex Wformat-nonliteral @@ -2726,6 +2760,8 @@ The target may also allow additional types in @code{format-arg} attributes. @xref{Target Format Checks,,Format Checks Specific to Particular Target Machines}. +Introduced before 4.0.0 + @item gnu_inline @cindex @code{gnu_inline} function attribute This attribute should be used with a function that is also declared @@ -2764,6 +2800,8 @@ In C++, this attribute does not depend on @code{extern} in any way, but it still requires the @code{inline} keyword to enable its special behavior. +Introduced in 4.2.0 + @item hot @cindex @code{hot} function attribute The @code{hot} attribute on a function is used to inform the compiler that @@ -2775,6 +2813,8 @@ improving locality. When profile feedback is available, via @option{-fprofile-use}, hot functions are automatically detected and this attribute is ignored. +Introduced in 4.3.0 + @item ifunc ("@var{resolver}") @cindex @code{ifunc} function attribute @cindex indirect functions @@ -2824,6 +2864,8 @@ void *memcpy (void *, const void *, size_t) Indirect functions cannot be weak. Binutils version 2.20.1 or higher and GNU C Library version 2.11.1 are required to use this feature. +Introduced in 4.6.0 + @item interrupt @itemx interrupt_handler Many GCC back ends support attributes to indicate that a function is @@ -2869,6 +2911,8 @@ units into one, for example, by using the link-time optimization. For this reason the attribute is not allowed on types to annotate indirect calls. +Introduced in 4.6.0 + @item malloc @cindex @code{malloc} function attribute @cindex functions that behave like malloc @@ -2883,11 +2927,15 @@ a pointer to uninitialized or zeroed-out storage. However, functions like @code{realloc} do not have this property, as they can return a pointer to storage containing pointers. +Introduced before 4.0.0 + @item no_icf @cindex @code{no_icf} function attribute This function attribute prevents a functions from being merged with another semantically equivalent function. +Introduced in 5.1.0 + @item no_instrument_function @cindex @code{no_instrument_function} function attribute @opindex finstrument-functions @@ -2895,12 +2943,16 @@ If @option{-finstrument-functions} is given, profiling function calls are generated at entry and exit of most user-compiled functions. Functions with this attribute are not so instrumented. +Introduced before 4.0.0 + @item no_profile_instrument_function @cindex @code{no_profile_instrument_function} function attribute 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. +Introduced in 7.1.0 + @item no_reorder @cindex @code{no_reorder} function attribute Do not reorder functions or variables marked @code{no_reorder} @@ -2911,6 +2963,8 @@ This has a similar effect as the @option{-fno-toplevel-reorder} option, but only applies to the marked symbols. +Introduced in 5.1.0 + @item no_sanitize ("@var{sanitize_option}") @cindex @code{no_sanitize} function attribute The @code{no_sanitize} attribute on functions is used @@ -2923,6 +2977,8 @@ void __attribute__ ((no_sanitize ("alignment", "object-size"))) f () @{ /* @r{Do something.} */; @} @end smallexample +Introduced in 8.1.0 + @item no_sanitize_address @itemx no_address_safety_analysis @cindex @code{no_sanitize_address} function attribute @@ -2933,18 +2989,24 @@ The @code{no_address_safety_analysis} is a deprecated alias of the @code{no_sanitize_address} attribute, new code should use @code{no_sanitize_address}. +Introduced in 4.8.0 + @item no_sanitize_thread @cindex @code{no_sanitize_thread} function attribute 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. +Introduced in 5.1.0 + @item no_sanitize_undefined @cindex @code{no_sanitize_undefined} function attribute 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. +Introduced in 4.9.0 + @item no_split_stack @cindex @code{no_split_stack} function attribute @opindex fsplit-stack @@ -2953,12 +3015,16 @@ 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. +Introduced in 4.6.0 + @item no_stack_limit @cindex @code{no_stack_limit} function attribute 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. +Introduced before 4.0.0 + @item noclone @cindex @code{noclone} function attribute This function attribute prevents a function from being considered for @@ -2966,6 +3032,8 @@ cloning---a mechanism that produces specialized copies of functions and which is (currently) performed by interprocedural constant propagation. +Introduced in 4.5.0 + @item noinline @cindex @code{noinline} function attribute This function attribute prevents a function from being considered for @@ -2984,6 +3052,8 @@ asm (""); (@pxref{Extended Asm}) in the called function, to serve as a special side-effect. +Introduced before 4.0.0 + @item nonnull (@var{arg-index}, @dots{}) @cindex @code{nonnull} function attribute @cindex functions with non-null pointer arguments @@ -3014,6 +3084,8 @@ my_memcpy (void *dest, const void *src, size_t len) __attribute__((nonnull)); @end smallexample +Introduced before 4.0.0 + @item noplt @cindex @code{noplt} function attribute The @code{noplt} attribute is the counterpart to option @option{-fno-plt}. @@ -3044,6 +3116,8 @@ in position-independent code. 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. +Introduced in 6.1.0 + @item noreturn @cindex @code{noreturn} function attribute @cindex functions that never return @@ -3081,6 +3155,8 @@ restored before calling the @code{noreturn} function. It does not make sense for a @code{noreturn} function to have a return type other than @code{void}. +Introduced before 4.0.0 + @item nothrow @cindex @code{nothrow} function attribute The @code{nothrow} attribute is used to inform the compiler that a @@ -3089,6 +3165,8 @@ 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. +Introduced before 4.0.0 + @item optimize @cindex @code{optimize} function attribute The @code{optimize} attribute is used to specify that a function is to @@ -3105,6 +3183,8 @@ that affect more than one function. This attribute should be used for debugging purposes only. It is not suitable in production code. +Introduced in 4.4.0 + @item pure @cindex @code{pure} function attribute @cindex functions that have no side effects @@ -3128,6 +3208,8 @@ Interesting non-pure functions are functions with infinite loops or those depending on volatile memory or other system resource, that may change between two consecutive calls (such as @code{feof} in a multithreading environment). +Introduced before 4.0.0 + @item returns_nonnull @cindex @code{returns_nonnull} function attribute The @code{returns_nonnull} attribute specifies that the function @@ -3142,6 +3224,8 @@ mymalloc (size_t len) __attribute__((returns_nonnull)); lets the compiler optimize callers based on the knowledge that the return value will never be null. +Introduced in 4.9.0 + @item returns_twice @cindex @code{returns_twice} function attribute @cindex functions that return more than once @@ -3153,6 +3237,8 @@ function. Examples of such functions are @code{setjmp} and @code{vfork}. The @code{longjmp}-like counterpart of such function, if any, might need to be marked with the @code{noreturn} attribute. +Introduced in 4.1.0 + @item section ("@var{section-name}") @cindex @code{section} function attribute @cindex functions in arbitrary sections @@ -3174,6 +3260,8 @@ attribute is not available on all platforms. If you need to map the entire contents of a module to a particular section, consider using the facilities of the linker instead. +Introduced before 4.0.0 + @item sentinel @cindex @code{sentinel} function attribute This function attribute ensures that a parameter in a function call is @@ -3201,6 +3289,8 @@ with a copy that redefines NULL appropriately. The warnings for missing or incorrect sentinels are enabled with @option{-Wformat}. +Introduced in 4.0.0 + @item simd @itemx simd("@var{mask}") @cindex @code{simd} function attribute @@ -3225,12 +3315,16 @@ If the attribute is specified and @code{#pragma omp declare simd} is present on a declaration and the @option{-fopenmp} or @option{-fopenmp-simd} switch is specified, then the attribute is ignored. +Introduced in 6.1.0 + @item stack_protect @cindex @code{stack_protect} function attribute 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. +Introduced in 5.1.0 + @item target (@var{options}) @cindex @code{target} function attribute Multiple target back ends implement the @code{target} attribute @@ -3289,12 +3383,16 @@ the @code{ifunc} attribute above) that dynamically selects a clone suitable for current architecture. The resolver is created only if there is a usage of a function with @code{target_clones} attribute. +Introduced in 6.1.0 + @item unused @cindex @code{unused} function attribute 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. +Introduced before 4.0.0 + @item used @cindex @code{used} function attribute This attribute, attached to a function, means that code must be emitted @@ -3306,6 +3404,8 @@ When applied to a member function of a C++ class template, the attribute also means that the function is instantiated if the class itself is instantiated. +Introduced before 4.0.0 + @item visibility ("@var{visibility_type}") @cindex @code{visibility} function attribute This attribute affects the linkage of the declaration to which it is attached. @@ -3411,6 +3511,8 @@ visibility of their template. If both the template and enclosing class have explicit visibility, the visibility from the template is used. +Introduced before 4.0.0 + @item warn_unused_result @cindex @code{warn_unused_result} function attribute The @code{warn_unused_result} attribute causes a warning to be emitted @@ -3432,6 +3534,8 @@ int foo () @noindent results in warning on line 5. +Introduced before 4.0.0 + @item weak @cindex @code{weak} function attribute The @code{weak} attribute causes the declaration to be emitted as a weak @@ -3441,6 +3545,8 @@ also be used with non-function declarations. Weak symbols are supported for ELF targets, and also for a.out targets when using the GNU assembler and linker. +Introduced before 4.0.0 + @item weakref @itemx weakref ("@var{target}") @cindex @code{weakref} function attribute @@ -3476,6 +3582,7 @@ performing a reloadable link on them. At present, a declaration to which @code{weakref} is attached can only be @code{static}. +Introduced in 4.1.0 @end table @@ -3498,6 +3605,8 @@ 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}. +Introduced in 6.1.0 + @item fix-cortex-a53-835769 @cindex @code{fix-cortex-a53-835769} function attribute, AArch64 Indicates that the workaround for the Cortex-A53 erratum 835769 should be @@ -3506,18 +3615,24 @@ 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}. +Introduced in 6.1.0 + @item cmodel= @cindex @code{cmodel=} function attribute, AArch64 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=}. +Introduced in 6.1.0 + @item strict-align @cindex @code{strict-align} function attribute, AArch64 Indicates that the compiler should not assume that unaligned memory references are handled by the system. The behavior is the same as for the command-line option @option{-mstrict-align}. +Introduced in 6.1.0 + @item omit-leaf-frame-pointer @cindex @code{omit-leaf-frame-pointer} function attribute, AArch64 Indicates that the frame pointer should be omitted for a leaf function call. @@ -3526,36 +3641,48 @@ To keep the frame pointer, the inverse attribute the same behavior as the command-line options @option{-momit-leaf-frame-pointer} and @option{-mno-omit-leaf-frame-pointer}. +Introduced in 6.1.0 + @item tls-dialect= @cindex @code{tls-dialect=} function attribute, AArch64 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=}. +Introduced in 6.1.0 + @item arch= @cindex @code{arch=} function attribute, AArch64 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. +Introduced in 6.1.0 + @item tune= @cindex @code{tune=} function attribute, AArch64 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. +Introduced in 6.1.0 + @item cpu= @cindex @code{cpu=} function attribute, AArch64 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. +Introduced in 6.1.0 + @item sign-return-address @cindex @code{sign-return-address} function attribute, AArch64 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}. +Introduced in 7.1.0 + @end table The above target attributes can be specified as follows: @@ -3650,6 +3777,8 @@ void f () __attribute__ ((interrupt ("ilink1"))); Permissible values for this parameter are: @w{@code{ilink1}} and @w{@code{ilink2}}. +Introduced before 4.0.0 + @item long_call @itemx medium_call @itemx short_call @@ -3672,6 +3801,9 @@ the call site. A function marked with the @code{short_call} attribute will always be close enough to be called with a conditional branch-and-link instruction, which has a 21-bit offset from the call site. + +Introduced in 4.9.0 + @end table @node ARM Function Attributes @@ -3701,11 +3833,15 @@ Permissible values for this parameter are: @code{IRQ}, @code{FIQ}, On ARMv7-M the interrupt type is ignored, and the attribute means the function may be called with a word-aligned stack pointer. +Introduced before 4.0.0 + @item isr @cindex @code{isr} function attribute, ARM Use this attribute on ARM to write Interrupt Service Routines. This is an alias to the @code{interrupt} attribute above. +Introduced before 4.0.0 + @item long_call @itemx short_call @cindex @code{long_call} function attribute, ARM @@ -3721,6 +3857,8 @@ calling sequence. The @code{short_call} attribute always places the offset to the function from the call site into the @samp{BL} instruction directly. +Introduced before 4.0.0 + @item naked @cindex @code{naked} function attribute, ARM This attribute allows the compiler to construct the @@ -3732,6 +3870,8 @@ prologue/epilogue sequences generated by the compiler. Only basic basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. +Introduced before 4.0.0 + @item pcs @cindex @code{pcs} function attribute, ARM @@ -3754,6 +3894,8 @@ double f2d (float) __attribute__((pcs("aapcs"))); Variadic functions always use the @code{"aapcs"} calling convention and the compiler rejects attempts to specify an alternative. +Introduced in 4.5.0 + @item target (@var{options}) @cindex @code{target} function attribute As discussed in @ref{Common Function Attributes}, this attribute @@ -3767,18 +3909,24 @@ On ARM, the following options are allowed: Force code generation in the Thumb (T16/T32) ISA, depending on the architecture level. +Introduced in 6.1.0 + @item arm @cindex @code{target("arm")} function attribute, ARM Force code generation in the ARM (A32) ISA. Functions from different modes can be inlined in the caller's mode. +Introduced in 6.1.0 + @item fpu= @cindex @code{target("fpu=")} function attribute, ARM 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. +Introduced in 6.1.0 + @end table @end table @@ -3804,6 +3952,8 @@ that does not insert a @code{SEI} instruction. If both @code{signal} and @code{interrupt} are specified for the same function, @code{signal} is silently ignored. +Introduced before 4.0.0 + @item naked @cindex @code{naked} function attribute, AVR This attribute allows the compiler to construct the @@ -3815,6 +3965,8 @@ prologue/epilogue sequences generated by the compiler. Only basic basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. +Introduced before 4.0.0 + @item OS_main @itemx OS_task @cindex @code{OS_main} function attribute, AVR @@ -3833,6 +3985,8 @@ is entered like for, e@.g@. task functions in a multi-threading operating system. In that case, changing the stack pointer register is guarded by save/clear/restore of the global interrupt enable flag. +Introduced in 4.3.0 + The differences to the @code{naked} function attribute are: @itemize @bullet @item @code{naked} functions do not have a return instruction whereas @@ -3843,6 +3997,10 @@ or a frame pointer whereas @code{OS_main} and @code{OS_task} do this as needed. @end itemize +Introduced in 4.3.0 (@code{OS_task}) + +Introduced in 4.4.0 (@code{OS_main}) + @item signal @cindex @code{signal} function attribute, AVR Use this attribute on the AVR to indicate that the specified @@ -3861,6 +4019,9 @@ application which is responsibility of the application. If both @code{signal} and @code{interrupt} are specified for the same function, @code{signal} is silently ignored. + +Introduced before 4.0.0 + @end table @node Blackfin Function Attributes @@ -3878,6 +4039,8 @@ is an exception handler. The compiler generates function entry and exit sequences suitable for use in an exception handler when this attribute is present. +Introduced in 4.1.0 + @item interrupt_handler @cindex @code{interrupt_handler} function attribute, Blackfin Use this attribute to @@ -3885,6 +4048,8 @@ 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. +Introduced in 4.1.0 + @item kspisusp @cindex @code{kspisusp} function attribute, Blackfin @cindex User stack pointer in interrupts on the Blackfin @@ -3892,6 +4057,8 @@ 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. +Introduced in 4.1.0 + @item l1_text @cindex @code{l1_text} function attribute, Blackfin This attribute specifies a function to be placed into L1 Instruction @@ -3899,6 +4066,8 @@ 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. +Introduced in 4.3.0 + @item l2 @cindex @code{l2} function attribute, Blackfin This attribute specifies a function to be placed into L2 @@ -3906,6 +4075,8 @@ SRAM. The function is put into a specific section named @code{.l2.text}. With @option{-mfdpic}, callers of such functions use an inlined PLT. +Introduced in 4.5.0 + @item longcall @itemx shortcall @cindex indirect calls, Blackfin @@ -3918,6 +4089,8 @@ require a different (more expensive) calling sequence. The enough for the shorter calling sequence to be used. These attributes override the @option{-mlongcall} switch. +Introduced in 4.1.0 + @item nesting @cindex @code{nesting} function attribute, Blackfin @cindex Allow nesting in an interrupt handler on the Blackfin processor @@ -3925,6 +4098,8 @@ 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. +Introduced in 4.1.0 + @item nmi_handler @cindex @code{nmi_handler} function attribute, Blackfin @cindex NMI handler functions on the Blackfin processor @@ -3933,12 +4108,17 @@ is an NMI handler. The compiler generates function entry and exit sequences suitable for use in an NMI handler when this attribute is present. +Introduced in 4.1.0 + @item saveall @cindex @code{saveall} function attribute, Blackfin @cindex save all registers on the Blackfin 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. + +Introduced in 4.1.0 + @end table @node CR16 Function Attributes @@ -3953,6 +4133,9 @@ 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. + +Introduced in 4.7.0 + @end table @node Epiphany Function Attributes @@ -3967,6 +4150,8 @@ This attribute causes the compiler to emit instructions to disable interrupts for the duration of the given function. +Introduced in 4.7.0 + @item forwarder_section @cindex @code{forwarder_section} function attribute, Epiphany This attribute modifies the behavior of an interrupt handler. @@ -3975,6 +4160,8 @@ 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. +Introduced in 4.7.0 + @item interrupt @cindex @code{interrupt} function attribute, Epiphany Use this attribute to indicate @@ -4016,6 +4203,8 @@ void __attribute__ ((interrupt ("dma0, dma1"), external_dma_handler (); @end smallexample +Introduced in 4.7.0 + @item long_call @itemx short_call @cindex @code{long_call} function attribute, Epiphany @@ -4025,6 +4214,9 @@ These attributes specify how a particular function is called. These attributes override the @option{-mlong-calls} (@pxref{Adapteva Epiphany Options}) command-line switch and @code{#pragma long_calls} settings. + +Introduced in 4.7.0 + @end table @@ -4043,6 +4235,8 @@ the function vector has a limited size (maximum 128 entries on the H8/300 and 64 entries on the H8/300H and H8S) and shares space with the interrupt vector. +Introduced before 4.0.0 + @item interrupt_handler @cindex @code{interrupt_handler} function attribute, H8/300 Use this attribute on the H8/300, H8/300H, and H8S to @@ -4050,12 +4244,17 @@ 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. +Introduced before 4.0.0 + @item saveall @cindex @code{saveall} function attribute, H8/300 @cindex save all registers on the H8/300, H8/300H, and H8S 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. + +Introduced before 4.0.0 + @end table @node IA-64 Function Attributes @@ -4072,6 +4271,8 @@ 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. +Introduced before 4.0.0 + @item version_id @cindex @code{version_id} function attribute, IA-64 This IA-64 HP-UX attribute, attached to a global variable or function, renames a @@ -4085,6 +4286,9 @@ extern int foo () __attribute__((version_id ("20040821"))); @noindent Calls to @code{foo} are mapped to calls to @code{foo@{20040821@}}. + +Introduced in 4.3.0 + @end table @node M32C Function Attributes @@ -4099,6 +4303,8 @@ 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. +Introduced in 4.5.0 + @item fast_interrupt @cindex @code{fast_interrupt} function attribute, M32C Use this attribute on the M32C port to indicate that the specified @@ -4106,6 +4312,8 @@ 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}. +Introduced in 4.5.0 + @item function_vector @cindex @code{function_vector} function attribute, M16C/M32C On M16C/M32C targets, the @code{function_vector} attribute declares a @@ -4142,12 +4350,17 @@ then be sure to write this declaration in both files. This attribute is ignored for R8C target. +Introduced in 4.3.0 + @item interrupt @cindex @code{interrupt} function attribute, M32C 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. + +Introduced in 4.1.0 + @end table @node M32R/D Function Attributes @@ -4163,6 +4376,8 @@ 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. +Introduced before 4.0.0 + @item model (@var{model-name}) @cindex @code{model} function attribute, M32R/D @cindex function addressability on the M32R/D @@ -4184,6 +4399,9 @@ Large model objects may live anywhere in the 32-bit address space (the compiler generates @code{seth/add3} instructions to load their addresses), and may not be reachable with the @code{bl} instruction (the compiler generates the much slower @code{seth/add3/jl} instruction sequence). + +Introduced before 4.0.0 + @end table @node m68k Function Attributes @@ -4201,6 +4419,10 @@ 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. +Introduced before 4.0.0 (@code{interrupt_handler}) + +Introduced in 4.3.0 (@code{interrupt}) + @item interrupt_thread @cindex @code{interrupt_thread} function attribute, fido Use this attribute on fido, a subarchitecture of the m68k, to indicate @@ -4208,6 +4430,9 @@ that the specified function is an interrupt handler that is designed to run as a thread. The compiler omits generate prologue/epilogue sequences and replaces the return instruction with a @code{sleep} instruction. This attribute is available only on fido. + +Introduced in 4.3.0 + @end table @node MCORE Function Attributes @@ -4226,6 +4451,9 @@ prologue/epilogue sequences generated by the compiler. Only basic (@pxref{Basic Asm}). While using extended @code{asm} or a mixture of basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. + +Introduced before 4.0.0 + @end table @node MeP Function Attributes @@ -4240,6 +4468,8 @@ On MeP targets, this attribute causes the compiler to emit instructions to disable interrupts for the duration of the given function. +Introduced in 4.5.0 + @item interrupt @cindex @code{interrupt} function attribute, MeP Use this attribute to indicate @@ -4247,24 +4477,33 @@ 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. +Introduced in 4.5.0 + @item near @cindex @code{near} function attribute, MeP This attribute causes the compiler to assume the called function is close enough to use the normal calling convention, overriding the @option{-mtf} command-line option. +Introduced in 4.5.0 + @item far @cindex @code{far} function attribute, MeP On MeP targets this causes the compiler to use a calling convention that assumes the called function is too far away for the built-in addressing modes. +Introduced in 4.5.0 + @item vliw @cindex @code{vliw} function attribute, MeP The @code{vliw} attribute tells the compiler to emit instructions in VLIW mode instead of core mode. Note that this attribute is not allowed unless a VLIW coprocessor has been configured and enabled through command-line options. + +Introduced in 4.5.0 + @end table @node MicroBlaze Function Attributes @@ -4281,6 +4520,8 @@ 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. +Introduced in 4.6.0 + @item break_handler @cindex @code{break_handler} function attribute, MicroBlaze @cindex break handler functions @@ -4294,16 +4535,24 @@ the @code{rtbd} instead of @code{rtsd}. void f () __attribute__ ((break_handler)); @end smallexample +Introduced in 5.1.0 + @item interrupt_handler @itemx fast_interrupt @cindex @code{interrupt_handler} function attribute, MicroBlaze @cindex @code{fast_interrupt} function attribute, MicroBlaze + 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 interrupts that do not use low-latency handlers. In both cases, GCC emits appropriate prologue code and generates a return from the handler using @code{rtid} instead of @code{rtsd}. + +Introduced in 4.6.0 (@code{interrupt_handler}) + +Introduced in 4.8.0 (@code{fast_interrupt}) + @end table @node Microsoft Windows Function Attributes @@ -4349,6 +4598,8 @@ including the symbol in the DLL's export table such as using a @file{.def} file with an @code{EXPORTS} section or, with GNU ld, using the @option{--export-all} linker flag. +Introduced before 4.0.0 + @item dllimport @cindex @code{dllimport} function attribute @cindex @code{__declspec(dllimport)} @@ -4402,6 +4653,9 @@ address. However, a pointer to a @emph{function} with the this case, the address of a stub function in the import lib is referenced. On Microsoft Windows targets, the attribute can be disabled for functions by setting the @option{-mnop-fun-dllimport} flag. + +Introduced before 4.0.0 + @end table @node MIPS Function Attributes @@ -4465,6 +4719,8 @@ void __attribute__ ((interrupt("eic"))) v8 (); void __attribute__ ((interrupt("vector=hw3"))) v9 (); @end smallexample +Introduced in 4.5.0 + @item long_call @itemx near @itemx far @@ -4481,6 +4737,10 @@ the contents of that register. The @code{near} attribute has the opposite effect; it specifies that non-PIC calls should be made using the more efficient @code{jal} instruction. +Introduced in 4.2.0 (@code{long_call}) + +introduced in 4.3.0 (@code{near}, @code{far}) + @item mips16 @itemx nomips16 @cindex @code{mips16} function attribute, MIPS @@ -4500,6 +4760,8 @@ not that within individual functions. Mixed MIPS16 and non-MIPS16 code may interact badly with some GCC extensions such as @code{__builtin_apply} (@pxref{Constructing Calls}). +Introduced in 4.3.0 + @item micromips, MIPS @itemx nomicromips, MIPS @cindex @code{micromips} function attribute @@ -4520,12 +4782,17 @@ not that within individual functions. Mixed microMIPS and non-microMIPS code may interact badly with some GCC extensions such as @code{__builtin_apply} (@pxref{Constructing Calls}). +Introduced in 4.9.0 + @item nocompression @cindex @code{nocompression} function attribute, MIPS 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 command line (@pxref{MIPS Options}). + +Introduced in 4.9.0 + @end table @node MSP430 Function Attributes @@ -4541,6 +4808,8 @@ previous interrupt state upon exit. Critical functions cannot also have the @code{naked} or @code{reentrant} attributes. They can have the @code{interrupt} attribute. +Introduced in 4.9.0 + @item interrupt @cindex @code{interrupt} function attribute, MSP430 Use this attribute to indicate @@ -4557,6 +4826,8 @@ match up with appropriate entries in the linker script. By default the names @code{watchdog} for vector 26, @code{nmi} for vector 30 and @code{reset} for vector 31 are recognized. +Introduced in 4.9.0 + @item naked @cindex @code{naked} function attribute, MSP430 This attribute allows the compiler to construct the @@ -4568,6 +4839,8 @@ prologue/epilogue sequences generated by the compiler. Only basic basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. +Introduced in 4.9.0 + @item reentrant @cindex @code{reentrant} function attribute, MSP430 Reentrant functions disable interrupts upon entry and enable them @@ -4575,6 +4848,8 @@ upon exit. Reentrant functions cannot also have the @code{naked} or @code{critical} attributes. They can have the @code{interrupt} attribute. +Introduced in 4.9.0 + @item wakeup @cindex @code{wakeup} function attribute, MSP430 This attribute only applies to interrupt functions. It is silently @@ -4582,6 +4857,8 @@ 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. +Introduced in 4.9.0 + @item lower @itemx upper @itemx either @@ -4613,6 +4890,9 @@ one pass over the objects and does the best that it can. Using the @option{-ffunction-sections} and @option{-fdata-sections} command-line options can help the packing, however, since they produce smaller, easier to pack regions. + +Introduced in 6.1.0 + @end table @node NDS32 Function Attributes @@ -4628,6 +4908,8 @@ 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. +Introduced in 4.9.0 + @item interrupt @cindex @code{interrupt} function attribute, NDS32 On NDS32 target, this attribute indicates that the specified function @@ -4656,6 +4938,8 @@ The system will help save caller registers into stack before entering interrupt handler. @end table +Introduced in 4.9.0 + @item naked @cindex @code{naked} function attribute, NDS32 This attribute allows the compiler to construct the @@ -4667,6 +4951,8 @@ prologue/epilogue sequences generated by the compiler. Only basic basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. +Introduced in 4.9.0 + @item reset @cindex @code{reset} function attribute, NDS32 @cindex reset handler functions @@ -4682,6 +4968,9 @@ Provide a user-defined function to handle NMI exception. @cindex @code{warm} function attribute, NDS32 Provide a user-defined function to handle warm reset exception. @end table + +Introduced in 4.9.0 + @end table @node Nios II Function Attributes @@ -4734,6 +5023,9 @@ library. By default functions are only callable only from other PTX functions. Kernel functions must have @code{void} return type. + +Introduced in 5.1.0 + @end table @node PowerPC Function Attributes @@ -4758,6 +5050,8 @@ the @code{#pragma longcall} setting. @xref{RS/6000 and PowerPC Options}, for more information on whether long calls are necessary. +Introduced before 4.0.0 + @item target (@var{options}) @cindex @code{target} function attribute As discussed in @ref{Common Function Attributes}, this attribute @@ -4773,6 +5067,8 @@ 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. +Introduced in 4.6.0 + @item cmpb @itemx no-cmpb @cindex @code{target("cmpb")} function attribute, PowerPC @@ -4780,6 +5076,8 @@ 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. +Introduced in 4.6.0 + @item dlmzb @itemx no-dlmzb @cindex @code{target("dlmzb")} function attribute, PowerPC @@ -4787,6 +5085,8 @@ 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. +Introduced in 4.6.0 + @item fprnd @itemx no-fprnd @cindex @code{target("fprnd")} function attribute, PowerPC @@ -4794,17 +5094,23 @@ 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. +Introduced in 4.6.0 + @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. +Introduced in 4.6.0 + @item isel @itemx no-isel @cindex @code{target("isel")} function attribute, PowerPC Generate code that uses (does not use) ISEL instruction. +Introduced in 4.6.0 + @item mfcrf @itemx no-mfcrf @cindex @code{target("mfcrf")} function attribute, PowerPC @@ -4812,6 +5118,8 @@ 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. +Introduced in 4.6.0 + @item mfpgpr @itemx no-mfpgpr @cindex @code{target("mfpgpr")} function attribute, PowerPC @@ -4819,6 +5127,8 @@ Generate code that uses (does not use) the FP move to/from general purpose register instructions implemented on the POWER6X processor and other processors that support the extended PowerPC V2.05 architecture. +Introduced in 4.6.0 + @item mulhw @itemx no-mulhw @cindex @code{target("mulhw")} function attribute, PowerPC @@ -4827,12 +5137,16 @@ multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors. These instructions are generated by default when targeting those processors. +Introduced in 4.6.0 + @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. +Introduced in 4.6.0 + @item update @itemx no-update @cindex @code{target("update")} function attribute, PowerPC @@ -4840,6 +5154,8 @@ 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. +Introduced in 4.6.0 + @item popcntb @itemx no-popcntb @cindex @code{target("popcntb")} function attribute, PowerPC @@ -4848,6 +5164,8 @@ FP reciprocal estimate instruction implemented on the POWER5 processor and other processors that support the PowerPC V2.02 architecture. +Introduced in 4.6.0 + @item popcntd @itemx no-popcntd @cindex @code{target("popcntd")} function attribute, PowerPC @@ -4855,6 +5173,8 @@ 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. +Introduced in 4.6.0 + @item powerpc-gfxopt @itemx no-powerpc-gfxopt @cindex @code{target("powerpc-gfxopt")} function attribute, PowerPC @@ -4862,6 +5182,8 @@ Generate code that uses (does not use) the optional PowerPC architecture instructions in the Graphics group, including floating-point select. +Introduced in 4.6.0 + @item powerpc-gpopt @itemx no-powerpc-gpopt @cindex @code{target("powerpc-gpopt")} function attribute, PowerPC @@ -4869,6 +5191,8 @@ Generate code that uses (does not use) the optional PowerPC architecture instructions in the General Purpose group, including floating-point square root. +Introduced in 4.6.0 + @item recip-precision @itemx no-recip-precision @cindex @code{target("recip-precision")} function attribute, PowerPC @@ -4876,6 +5200,8 @@ Assume (do not assume) that the reciprocal estimate instructions provide higher-precision estimates than is mandated by the PowerPC ABI. +Introduced in 4.6.0 + @item string @itemx no-string @cindex @code{target("string")} function attribute, PowerPC @@ -4883,6 +5209,8 @@ 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. +Introduced in 4.6.0 + @item vsx @itemx no-vsx @cindex @code{target("vsx")} function attribute, PowerPC @@ -4892,6 +5220,8 @@ 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. +Introduced in 4.6.0 + @item friz @itemx no-friz @cindex @code{target("friz")} function attribute, PowerPC @@ -4901,24 +5231,32 @@ 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. +Introduced in 4.6.0 + @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. +Introduced in 4.6.0 + @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. +Introduced in 4.6.0 + @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. +Introduced in 4.6.0 + @item cpu=@var{CPU} @cindex @code{target("cpu=@var{CPU}")} function attribute, PowerPC Specify the architecture to generate code for when compiling the @@ -4926,6 +5264,8 @@ 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. +Introduced in 4.6.0 + @item tune=@var{TUNE} @cindex @code{target("tune=@var{TUNE}")} function attribute, PowerPC Specify the architecture to tune for when compiling the function. If @@ -4933,6 +5273,9 @@ you do not specify the @code{target("tune=@var{TUNE}")} attribute and you do specify the @code{target("cpu=@var{CPU}")} attribute, compilation tunes for the @var{CPU} architecture, and not the default tuning specified on the command line. + +Introduced in 4.6.0 + @end table On the PowerPC, the inliner does not inline a @@ -4959,6 +5302,8 @@ Use @code{brk_interrupt} instead of @code{interrupt} for handlers intended to be used with the @code{BRK} opcode (i.e.@: those that must end with @code{RETB} instead of @code{RETI}). +Introduced in 4.7.0 + @item naked @cindex @code{naked} function attribute, RL78 This attribute allows the compiler to construct the @@ -4969,6 +5314,9 @@ prologue/epilogue sequences generated by the compiler. Only basic (@pxref{Basic Asm}). While using extended @code{asm} or a mixture of basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. + +Introduced in 4.9.0 + @end table @node RX Function Attributes @@ -4984,6 +5332,8 @@ 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}. +Introduced in 4.5.0 + @item interrupt @cindex @code{interrupt} function attribute, RX Use this attribute to indicate @@ -5013,6 +5363,8 @@ void __attribute__ ((interrupt (RXD1_VECT,RXD2_VECT,"dct","$default"))) txd1_handler (); @end smallexample +Introduced in 4.5.0 + @item naked @cindex @code{naked} function attribute, RX This attribute allows the compiler to construct the @@ -5024,12 +5376,17 @@ prologue/epilogue sequences generated by the compiler. Only basic basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. +Introduced in 4.5.0 + @item vector @cindex @code{vector} function attribute, RX 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 @code{interrupt} attribute for a description of its arguments. + +Introduced in 5.1.0 + @end table @node S/390 Function Attributes @@ -5052,6 +5409,8 @@ both arguments the maximum allowed value is 1000000. If both arguments are zero, hotpatching is disabled. +Introduced in 4.9.0 + @item target (@var{options}) @cindex @code{target} function attribute As discussed in @ref{Common Function Attributes}, this attribute @@ -5122,6 +5481,8 @@ saves at least 8 bytes of code; and if other successive calls are being made to the same function, it saves 2 bytes of code per each of these calls. +Introduced in 4.4.0 + @item interrupt_handler @cindex @code{interrupt_handler} function attribute, SH Use this attribute to @@ -5129,6 +5490,8 @@ 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. +Introduced before 4.0.0 + @item nosave_low_regs @cindex @code{nosave_low_regs} function attribute, SH Use this attribute on SH targets to indicate that an @code{interrupt_handler} @@ -5136,11 +5499,15 @@ 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. +Introduced before 4.0.0 + @item renesas @cindex @code{renesas} function attribute, SH On SH targets this attribute specifies that the function or struct follows the Renesas ABI. +Introduced before 4.0.0 + @item resbank @cindex @code{resbank} function attribute, SH On the SH2A target, this attribute enables the high-speed register @@ -5154,6 +5521,8 @@ vector table address offset are saved into a register bank. Register banks are stacked in first-in last-out (FILO) sequence. Restoration from the bank is executed by issuing a RESBANK instruction. +Introduced in 4.4.0 + @item sp_switch @cindex @code{sp_switch} function attribute, SH Use this attribute on the SH to indicate an @code{interrupt_handler} @@ -5167,16 +5536,23 @@ void f () __attribute__ ((interrupt_handler, sp_switch ("alt_stack"))); @end smallexample +Introduced before 4.0.0 + @item trap_exit @cindex @code{trap_exit} function attribute, SH 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. +Introduced before 4.0.0 + @item trapa_handler @cindex @code{trapa_handler} function attribute, SH On SH targets this function attribute is similar to @code{interrupt_handler} but it does not save and restore all registers. + +Introduced in 4.1.0 + @end table @node SPU Function Attributes @@ -5195,6 +5571,9 @@ prologue/epilogue sequences generated by the compiler. Only basic (@pxref{Basic Asm}). While using extended @code{asm} or a mixture of basic @code{asm} and C code may appear to work, they cannot be depended upon to work reliably and are not supported. + +Introduced in 4.3.0 + @end table @node Symbian OS Function Attributes @@ -5217,6 +5596,9 @@ 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 when either attribute is present. + +Introduced before 4.0.0 + @end table @node Visium Function Attributes @@ -5231,6 +5613,9 @@ 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. + +Introduced in 5.1.0 + @end table @node x86 Function Attributes @@ -5248,6 +5633,8 @@ 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. +Introduced in 4.1.0 + @item fastcall @cindex @code{fastcall} function attribute, x86-32 @cindex functions that pop the argument stack on x86-32 @@ -5258,6 +5645,8 @@ and other typed arguments are passed on the stack. The called function pops the arguments off the stack. If the number of arguments is variable all arguments are pushed on the stack. +Introduced before 4.0.0 + @item thiscall @cindex @code{thiscall} function attribute, x86-32 @cindex functions that pop the argument stack on x86-32 @@ -5271,6 +5660,8 @@ The @code{thiscall} attribute is intended for C++ non-static member functions. As a GCC extension, this calling convention can be used for C functions and for static member methods. +Introduced in 4.6.0 + @item ms_abi @itemx sysv_abi @cindex @code{ms_abi} function attribute, x86 @@ -5286,6 +5677,8 @@ when targeting Windows. On all other systems, the default is the x86/AMD ABI. Note, the @code{ms_abi} attribute for Microsoft Windows 64-bit targets currently requires the @option{-maccumulate-outgoing-args} option. +Introduced in 4.4.0 + @item callee_pop_aggregate_return (@var{number}) @cindex @code{callee_pop_aggregate_return} function attribute, x86 @@ -5300,6 +5693,8 @@ stack for hidden pointer. However, on x86-32 Microsoft Windows targets, the compiler assumes that the caller pops the stack for hidden pointer. +Introduced in 4.6.0 + @item ms_hook_prologue @cindex @code{ms_hook_prologue} function attribute, x86 @@ -5308,6 +5703,8 @@ 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. +Introduced in 4.5.0 + @item regparm (@var{number}) @cindex @code{regparm} function attribute, x86 @cindex functions that are passed arguments in registers on x86-32 @@ -5328,6 +5725,8 @@ safe since the loaders there save EAX, EDX and ECX. (Lazy binding can be disabled with the linker or the loader if desired, to avoid the problem.) +Introduced before 4.0.0 + @item sseregparm @cindex @code{sseregparm} function attribute, x86 On x86-32 targets with SSE support, the @code{sseregparm} attribute @@ -5336,6 +5735,8 @@ 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. +Introduced in 4.1.0 + @item force_align_arg_pointer @cindex @code{force_align_arg_pointer} function attribute, x86 On x86 targets, the @code{force_align_arg_pointer} attribute may be @@ -5344,6 +5745,8 @@ 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. +Introduced in 4.2.0 + @item stdcall @cindex @code{stdcall} function attribute, x86-32 @cindex functions that pop the argument stack on x86-32 @@ -5351,6 +5754,8 @@ 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. +Introduced before 4.0.0 + @item no_caller_saved_registers @cindex @code{no_caller_saved_registers} function attribute, x86 Use this attribute to indicate that the specified function has no @@ -5362,6 +5767,8 @@ the EFLAGS register. Since GCC doesn't preserve MPX, SSE, MMX nor x87 states, the GCC option @option{-mgeneral-regs-only} should be used to compile functions with @code{no_caller_saved_registers} attribute. +Introduced in 7.1.0 + @item interrupt @cindex @code{interrupt} function attribute, x86 Use this attribute to indicate that the specified function is an @@ -5424,6 +5831,8 @@ Exception handlers should only be used for exceptions that push an error code; you should use an interrupt handler in other cases. The system will crash if the wrong kind of handler is used. +Introduced in 7.1.0 + @item target (@var{options}) @cindex @code{target} function attribute As discussed in @ref{Common Function Attributes}, this attribute @@ -5436,119 +5845,165 @@ On the x86, the following options are allowed: @cindex @code{target("abm")} function attribute, x86 Enable/disable the generation of the advanced bit instructions. +Introduced in 4.4.0 + @item aes @itemx no-aes @cindex @code{target("aes")} function attribute, x86 Enable/disable the generation of the AES instructions. +Introduced in 4.4.0 + @item default @cindex @code{target("default")} function attribute, x86 @xref{Function Multiversioning}, where it is used to specify the default function version. +Introduced in 4.8.0 + @item mmx @itemx no-mmx @cindex @code{target("mmx")} function attribute, x86 Enable/disable the generation of the MMX instructions. +Introduced in 4.4.0 + @item pclmul @itemx no-pclmul @cindex @code{target("pclmul")} function attribute, x86 Enable/disable the generation of the PCLMUL instructions. +Introduced in 4.4.0 + @item popcnt @itemx no-popcnt @cindex @code{target("popcnt")} function attribute, x86 Enable/disable the generation of the POPCNT instruction. +Introduced in 4.4.0 + @item sse @itemx no-sse @cindex @code{target("sse")} function attribute, x86 Enable/disable the generation of the SSE instructions. +Introduced in 4.4.0 + @item sse2 @itemx no-sse2 @cindex @code{target("sse2")} function attribute, x86 Enable/disable the generation of the SSE2 instructions. +Introduced in 4.4.0 + @item sse3 @itemx no-sse3 @cindex @code{target("sse3")} function attribute, x86 Enable/disable the generation of the SSE3 instructions. +Introduced in 4.4.0 + @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). +Introduced in 4.4.0 + @item sse4.1 @itemx no-sse4.1 @cindex @code{target("sse4.1")} function attribute, x86 Enable/disable the generation of the sse4.1 instructions. +Introduced in 4.4.0 + @item sse4.2 @itemx no-sse4.2 @cindex @code{target("sse4.2")} function attribute, x86 Enable/disable the generation of the sse4.2 instructions. +Introduced in 4.4.0 + @item sse4a @itemx no-sse4a @cindex @code{target("sse4a")} function attribute, x86 Enable/disable the generation of the SSE4A instructions. +Introduced in 4.4.0 + @item fma4 @itemx no-fma4 @cindex @code{target("fma4")} function attribute, x86 Enable/disable the generation of the FMA4 instructions. +Introduced in 4.9.0 + @item xop @itemx no-xop @cindex @code{target("xop")} function attribute, x86 Enable/disable the generation of the XOP instructions. +Introduced in 4.9.0 + @item lwp @itemx no-lwp @cindex @code{target("lwp")} function attribute, x86 Enable/disable the generation of the LWP instructions. +Introduced in 4.5.0 + @item ssse3 @itemx no-ssse3 @cindex @code{target("ssse3")} function attribute, x86 Enable/disable the generation of the SSSE3 instructions. +Introduced in 4.4.0 + @item cld @itemx no-cld @cindex @code{target("cld")} function attribute, x86 Enable/disable the generation of the CLD before string moves. +Introduced in 4.4.0 + @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. +Introduced in 4.4.0 + @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. +Introduced in 4.4.0 + @item inline-all-stringops @itemx no-inline-all-stringops @cindex @code{target("inline-all-stringops")} function attribute, x86 Enable/disable inlining of string operations. +Introduced in 4.4.0 + @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. +Introduced in 4.4.0 + @item align-stringops @itemx no-align-stringops @cindex @code{target("align-stringops")} function attribute, x86 Do/do not align destination of inlined string operations. +Introduced in 4.4.0 + @item recip @itemx no-recip @cindex @code{target("recip")} function attribute, x86 @@ -5556,20 +6011,29 @@ Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS instructions followed an additional Newton-Raphson step instead of doing a floating-point division. +Introduced in 4.4.0 + @item arch=@var{ARCH} @cindex @code{target("arch=@var{ARCH}")} function attribute, x86 Specify the architecture to generate code for in compiling the function. +Introduced in 4.4.0 + @item tune=@var{TUNE} @cindex @code{target("tune=@var{TUNE}")} function attribute, x86 Specify the architecture to tune for in compiling the function. +Introduced in 4.4.0 + @item fpmath=@var{FPMATH} @cindex @code{target("fpmath=@var{FPMATH}")} function attribute, x86 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. + +Introduced in 4.4.0 + @end table On the x86, the inliner does not inline a @@ -5591,6 +6055,9 @@ 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. + +Introduced before 4.0.0 + @end table @node Variable Attributes @@ -5707,6 +6174,8 @@ alignment. See your linker documentation for further information. The @code{aligned} attribute can also be used for functions (@pxref{Common Function Attributes}.) +Introduced before 4.0.0 + @item cleanup (@var{cleanup_function}) @cindex @code{cleanup} variable attribute The @code{cleanup} attribute runs a function when the variable goes @@ -5723,6 +6192,8 @@ does not allow the exception to be caught, only to perform an action. It is undefined what happens if @var{cleanup_function} does not return normally. +Introduced before 4.0.0 + @item common @itemx nocommon @cindex @code{common} variable attribute @@ -5736,6 +6207,8 @@ opposite---to allocate space for it directly. These attributes override the default chosen by the @option{-fno-common} and @option{-fcommon} flags respectively. +Introduced before 4.0.0 + @item deprecated @itemx deprecated (@var{msg}) @cindex @code{deprecated} variable attribute @@ -5762,6 +6235,8 @@ The @code{deprecated} attribute can also be used for functions and types (@pxref{Common Function Attributes}, @pxref{Common Type Attributes}). +Introduced before 4.0.0 + @item mode (@var{mode}) @cindex @code{mode} variable attribute This attribute specifies the data type for the declaration---whichever @@ -5775,6 +6250,8 @@ indicate the mode corresponding to a one-byte integer, @code{word} or @code{__word__} for the mode of a one-word integer, and @code{pointer} or @code{__pointer__} for the mode used to represent pointers. +Introduced before 4.0.0 + @item packed @cindex @code{packed} variable attribute The @code{packed} attribute specifies that a variable or structure field @@ -5799,6 +6276,8 @@ been fixed in GCC 4.4 but the change can lead to differences in the structure layout. See the documentation of @option{-Wpacked-bitfield-compat} for more information. +Introduced before 4.0.0 + @item section ("@var{section-name}") @cindex @code{section} variable attribute Normally, the compiler places the objects it generates in sections like @@ -5848,6 +6327,8 @@ attribute is not available on all platforms. If you need to map the entire contents of a module to a particular section, consider using the facilities of the linker instead. +Introduced before 4.0.0 + @item tls_model ("@var{tls_model}") @cindex @code{tls_model} variable attribute The @code{tls_model} attribute sets thread-local storage model @@ -5859,12 +6340,16 @@ The @var{tls_model} argument should be one of @code{global-dynamic}, Not all targets support this attribute. +Introduced before 4.0.0 + @item unused @cindex @code{unused} variable attribute This attribute, attached to a variable, means that the variable is meant to be possibly unused. GCC does not produce a warning for this variable. +Introduced before 4.0.0 + @item used @cindex @code{used} variable attribute This attribute, attached to a variable with static storage, means that @@ -5875,6 +6360,8 @@ When applied to a static data member of a C++ class template, the attribute also means that the member is instantiated if the class itself is instantiated. +Introduced before 4.0.0 + @item vector_size (@var{bytes}) @cindex @code{vector_size} variable attribute This attribute specifies the vector size for the variable, measured in @@ -5905,17 +6392,23 @@ struct S __attribute__ ((vector_size (16))) foo; is invalid even if the size of the structure is the same as the size of the @code{int}. +Introduced before 4.0.0 + @item visibility ("@var{visibility_type}") @cindex @code{visibility} variable attribute This attribute affects the linkage of the declaration to which it is attached. The @code{visibility} attribute is described in @ref{Common Function Attributes}. +Introduced before 4.0.0 + @item weak @cindex @code{weak} variable attribute The @code{weak} attribute is described in @ref{Common Function Attributes}. +Introduced before 4.0.0 + @end table @node AVR Variable Attributes @@ -5996,6 +6489,8 @@ at all. @end table +Introduced before 4.0.0 + @item io @itemx io (@var{addr}) @cindex @code{io} variable attribute, AVR @@ -6021,6 +6516,8 @@ Example: extern volatile int porta __attribute__((io)); @end smallexample +Introduced in 5.1.0 + @item io_low @itemx io_low (@var{addr}) @cindex @code{io_low} variable attribute, AVR @@ -6029,6 +6526,8 @@ 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. +Introduced in 5.1.0 + @item address @itemx address (@var{addr}) @cindex @code{address} variable attribute, AVR @@ -6039,6 +6538,8 @@ memory-mapped peripherals that may lie outside the io address range. volatile int porta __attribute__((address (0x600))); @end smallexample +Introduced in 5.1.0 + @item absdata @cindex @code{absdata} variable attribute, AVR Variables in static storage and with the @code{absdata} attribute can @@ -6068,6 +6569,8 @@ warning like See also the @option{-mabsdata} @ref{AVR Options,command-line option}. +Introduced in 7.1.0 + @end table @node Blackfin Variable Attributes @@ -6088,11 +6591,16 @@ 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}. +Introduced in 4.3.0 + @item l2 @cindex @code{l2} variable attribute, Blackfin 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}. + +Introduced in 4.5.0 + @end table @node H8/300 Variable Attributes @@ -6113,6 +6621,8 @@ on data in the eight-bit data area. Note the eight-bit data area is limited to You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +Introduced before 4.0.0 + @item tiny_data @cindex @code{tiny_data} variable attribute, H8/300 @cindex tiny data section on the H8/300H and H8S @@ -6122,6 +6632,8 @@ The compiler generates more efficient code for loads and stores on data in the tiny data section. Note the tiny data area is limited to slightly under 32KB of data. +Introduced before 4.0.0 + @end table @node IA-64 Variable Attributes @@ -6141,6 +6653,8 @@ instruction). Caveat: such addressing is by definition not position independent and hence this attribute must not be used for objects defined by shared libraries. +Introduced before 4.0.0 + @end table @node M32R/D Variable Attributes @@ -6162,6 +6676,9 @@ addresses can be loaded with the @code{ld24} instruction). Medium and large model objects may live anywhere in the 32-bit address space (the compiler generates @code{seth/add3} instructions to load their addresses). + +Introduced before 4.0.0 + @end table @node MeP Variable Attributes @@ -6184,11 +6701,15 @@ Any variable with the @code{based} attribute is assigned to the @code{.based} section, and is accessed with relative to the @code{$tp} register. +Introduced in 4.5.0 + @item tiny @cindex @code{tiny} variable attribute, MeP Likewise, the @code{tiny} attribute assigned variables to the @code{.tiny} section, relative to the @code{$gp} register. +Introduced in 4.5.0 + @item near @cindex @code{near} variable attribute, MeP Variables with the @code{near} attribute are assumed to have addresses @@ -6196,6 +6717,8 @@ that fit in a 24-bit addressing mode. This is the default for large variables (@code{-mtiny=4} is the default) but this attribute can override @code{-mtiny=} for small variables, or override @code{-ml}. +Introduced in 4.5.0 + @item far @cindex @code{far} variable attribute, MeP Variables with the @code{far} attribute are addressed using a full @@ -6203,6 +6726,8 @@ Variables with the @code{far} attribute are addressed using a full allows modules to make no assumptions about where variables might be stored. +Introduced in 4.5.0 + @item io @cindex @code{io} variable attribute, MeP @itemx io (@var{addr}) @@ -6215,6 +6740,8 @@ assumed some other module assigns an address). Example: int timer_count __attribute__((io(0x123))); @end smallexample +Introduced in 4.5.0 + @item cb @itemx cb (@var{addr}) @cindex @code{cb} variable attribute, MeP @@ -6226,6 +6753,8 @@ address. Example: int cpu_clock __attribute__((cb(0x123))); @end smallexample +Introduced in 4.5.0 + @end table @node Microsoft Windows Variable Attributes @@ -6243,6 +6772,8 @@ attributes available on all x86 targets. The @code{dllimport} and @code{dllexport} attributes are described in @ref{Microsoft Windows Function Attributes}. +Introduced before 4.0.0 + @item selectany @cindex @code{selectany} variable attribute The @code{selectany} attribute causes an initialized global variable to @@ -6264,6 +6795,8 @@ targets. You can use @code{__declspec (selectany)} as a synonym for @code{__attribute__ ((selectany))} for compatibility with other compilers. +Introduced in 4.1.0 + @item shared @cindex @code{shared} variable attribute On Microsoft Windows, in addition to putting variable definitions in a named @@ -6291,6 +6824,8 @@ linkers work. See @code{section} attribute for more information. The @code{shared} attribute is only available on Microsoft Windows@. +Introduced before 4.0.0 + @end table @node MSP430 Variable Attributes @@ -6303,6 +6838,8 @@ Any data with the @code{noinit} attribute will not be initialised by the C runtime startup code, or the program loader. Not initialising data in this way can reduce program startup times. +Introduced in 6.1.0 + @item persistent @cindex @code{persistent} variable attribute, MSP430 Any variable with the @code{persistent} attribute will not be @@ -6314,6 +6851,8 @@ value will be retained across resets. The linker script being used to create the application should ensure that persistent data is correctly placed. +Introduced in 6.1.0 + @item lower @itemx upper @itemx either @@ -6323,6 +6862,11 @@ placed. These attributes are the same as the MSP430 function attributes of the same name (@pxref{MSP430 Function Attributes}). These attributes can be applied to both functions and variables. + +Introduced in 4.5.0 (@code{either}) + +Introduced in 6.1.0 (@code{lower}, @code{upper}) + @end table @node Nvidia PTX Variable Attributes @@ -6337,6 +6881,9 @@ 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. The runtime does not initialize variables in this memory space. + +Introduced before 4.0.0 + @end table @node PowerPC Variable Attributes @@ -6350,10 +6897,14 @@ Three attributes currently are defined for PowerPC configurations: For full documentation of the struct attributes please see the documentation in @ref{x86 Variable Attributes}. +Introduced in 4.2.0 + @cindex @code{altivec} variable attribute, PowerPC For documentation of @code{altivec} attribute please see the documentation in @ref{PowerPC Type Attributes}. +Introduced before 4.0.0 + @node RL78 Variable Attributes @subsection RL78 Variable Attributes @@ -6362,6 +6913,8 @@ The RL78 back end supports the @code{saddr} variable attribute. This specifies placement of the corresponding variable in the SADDR area, which can be accessed more efficiently than the default memory region. +Introduced in 5.1.0 + @node SPU Variable Attributes @subsection SPU Variable Attributes @@ -6370,6 +6923,8 @@ The SPU supports the @code{spu_vector} attribute for variables. For documentation of this attribute please see the documentation in @ref{SPU Type Attributes}. +Introduced in 4.3.0 + @node V850 Variable Attributes @subsection V850 Variable Attributes @@ -6382,15 +6937,22 @@ These variable attributes are supported by the V850 back end: Use this attribute to explicitly place a variable in the small data area, which can hold up to 64 kilobytes. +Introduced before 4.0.0 + @item tda @cindex @code{tda} variable attribute, V850 Use this attribute to explicitly place a variable in the tiny data area, which can hold up to 256 bytes in total. +Introduced before 4.0.0 + @item zda @cindex @code{zda} variable attribute, V850 Use this attribute to explicitly place a variable in the first 32 kilobytes of memory. + +Introduced before 4.0.0 + @end table @node x86 Variable Attributes @@ -6419,6 +6981,8 @@ see @ref{x86 Options}, for details of how structure layout is affected. @xref{x86 Type Attributes}, for information about the corresponding attributes on types. +Introduced before 4.0.0 + @end table @node Xstormy16 Variable Attributes @@ -6437,6 +7001,8 @@ memory and use special opcodes to access it. Such variables are placed in either the @code{.bss_below100} section or the @code{.data_below100} section. +Introduced in 4.0.0 + @end table @node Type Attributes @@ -6560,6 +7126,8 @@ alignment. See your linker documentation for further information. The @code{aligned} attribute can only increase alignment. Alignment can be decreased by specifying the @code{packed} attribute. See below. +Introduced before 4.0.0 + @item bnd_variable_size @cindex @code{bnd_variable_size} type attribute @cindex Pointer Bounds Checker attributes @@ -6592,6 +7160,8 @@ S *p = (S *)malloc (sizeof(S) + 100); p->data[10] = 0; //OK @end smallexample +Introduced in 5.1.0 + @item deprecated @itemx deprecated (@var{msg}) @cindex @code{deprecated} type attribute @@ -6625,6 +7195,8 @@ present. The @code{deprecated} attribute can also be used for functions and variables (@pxref{Function Attributes}, @pxref{Variable Attributes}.) +Introduced before 4.0.0 + @item designated_init @cindex @code{designated_init} type attribute This attribute may only be applied to structure types. It indicates @@ -6637,6 +7209,8 @@ initialization will result in future breakage. GCC emits warnings based on this attribute by default; use @option{-Wno-designated-init} to suppress them. +Introduced in 5.1.0 + @item may_alias @cindex @code{may_alias} type attribute Accesses through pointers to types with this attribute are not subject @@ -6678,6 +7252,8 @@ declaration, the above program would abort when compiled with @option{-fstrict-aliasing}, which is on by default at @option{-O2} or above. +Introduced before 4.0.0 + @item packed @cindex @code{packed} type attribute This attribute, attached to @code{struct} or @code{union} type @@ -6717,6 +7293,8 @@ You may only specify the @code{packed} attribute attribute on the definition of an @code{enum}, @code{struct} or @code{union}, not on a @code{typedef} that does not also define the enumerated type, structure or union. +Introduced before 4.0.0 + @item scalar_storage_order ("@var{endianness}") @cindex @code{scalar_storage_order} type attribute When attached to a @code{union} or a @code{struct}, this attribute sets @@ -6757,6 +7335,8 @@ Moreover, the use of type punning or aliasing to toggle the storage order is not supported; that is to say, a given scalar object cannot be accessed through distinct types that assign a different storage order to it. +Introduced in 6.1.0 + @item transparent_union @cindex @code{transparent_union} type attribute @@ -6819,6 +7399,8 @@ pid_t wait (wait_status_ptr_t p) @} @end smallexample +Introduced before 4.0.0 + @item unused @cindex @code{unused} type attribute When attached to a type (including a @code{union} or a @code{struct}), @@ -6829,6 +7411,8 @@ the case with lock or thread classes, which are usually defined and then not referenced, but contain constructors and destructors that have nontrivial bookkeeping functions. +Introduced before 4.0.0 + @item visibility @cindex @code{visibility} type attribute In C++, attribute visibility (@pxref{Function Attributes}) can also be @@ -6843,6 +7427,8 @@ and caught in another, the class must have default visibility. Otherwise the two shared objects are unable to use the same typeinfo node and exception handling will break. +Introduced before 4.0.0 + @end table To specify multiple attributes, separate them by commas within the @@ -6875,6 +7461,8 @@ virtual table for @code{C} is not exported. (You can use @code{__attribute__} instead of @code{__declspec} if you prefer, but most Symbian OS code uses @code{__declspec}.) +Introduced in 4.0.0 + @node MeP Type Attributes @subsection MeP Type Attributes @@ -6887,6 +7475,8 @@ Specifically, the @code{based}, @code{tiny}, @code{near}, and @code{far} attributes may be applied to either. The @code{io} and @code{cb} attributes may not be applied to types. +Introduced in 4.5.0 + @node PowerPC Type Attributes @subsection PowerPC Type Attributes @@ -6898,6 +7488,8 @@ Three attributes currently are defined for PowerPC configurations: For full documentation of the @code{ms_struct} and @code{gcc_struct} attributes please see the documentation in @ref{x86 Type Attributes}. +Introduced in 4.2.0 + @cindex @code{altivec} type attribute, PowerPC The @code{altivec} attribute allows one to declare AltiVec vector data types supported by the AltiVec Programming Interface Manual. The @@ -6914,6 +7506,8 @@ __attribute__((altivec(bool__))) unsigned These attributes mainly are intended to support the @code{__vector}, @code{__pixel}, and @code{__bool} AltiVec keywords. +Introduced before 4.0.0 + @node SPU Type Attributes @subsection SPU Type Attributes @@ -6923,6 +7517,8 @@ allows one to declare vector data types supported by the Sony/Toshiba/IBM SPU Language Extensions Specification. It is intended to support the @code{__vector} keyword. +Introduced in 4.3.0 + @node x86 Type Attributes @subsection x86 Type Attributes @@ -6950,6 +7546,8 @@ see @ref{x86 Options}, for details of how structure layout is affected. @xref{x86 Variable Attributes}, for information about the corresponding attributes on variables. +Introduced before 4.0.0 + @end table @node Label Attributes @@ -6991,6 +7589,8 @@ 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. +Introduced before 4.0.0 + @item hot @cindex @code{hot} label attribute The @code{hot} attribute on a label is used to inform the compiler that @@ -6998,6 +7598,8 @@ 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}. +Introduced in 4.3.0 + @item cold @cindex @code{cold} label attribute The @code{cold} attribute on labels is used to inform the compiler that @@ -7005,6 +7607,8 @@ 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 with computed goto or @code{asm goto}. +Introduced in 4.3.0 + @end table @node Enumerator Attributes @@ -7044,6 +7648,8 @@ of the deprecated enumerator, to enable users to easily find further information about why the enumerator is deprecated, or what they should do instead. Note that the warnings only occurs for uses. +Introduced before 4.0.0 + @end table @node Statement Attributes @@ -7084,6 +7690,8 @@ be used in a switch statement (the compiler will issue an error otherwise), after a preceding statement and before a logically succeeding case label, or user-defined label. +Introduced in 7.1.0 + @end table @node Attribute Syntax @@ -22491,6 +23099,8 @@ variable or function. @option{-Wabi-tag} also warns about this situation; this warning can be avoided by explicitly tagging the variable or function or moving it into a tagged inline namespace. +Introduced in 4.8.0 + @item init_priority (@var{priority}) @cindex @code{init_priority} variable attribute @@ -22515,6 +23125,8 @@ Some_Class B __attribute__ ((init_priority (543))); Note that the particular values of @var{priority} do not matter; only their relative ordering. +Introduced before 4.0.0 + @item warn_unused @cindex @code{warn_unused} type attribute @@ -22532,6 +23144,8 @@ control a resource, such as @code{std::lock_guard}. This attribute is also accepted in C, but it is unnecessary because C does not have constructors or destructors. +Introduced in 4.9.0 + @end table @node Function Multiversioning