diff options
Diffstat (limited to 'gcc/doc')
30 files changed, 1657 insertions, 251 deletions
diff --git a/gcc/doc/analyzer.texi b/gcc/doc/analyzer.texi index 4dd14c8..87a2a40 100644 --- a/gcc/doc/analyzer.texi +++ b/gcc/doc/analyzer.texi @@ -432,7 +432,7 @@ binop_svalue (mult_expr, initial_svalue(‘size_t’, decl_region(frame_region(â @subsection Analyzer Paths We need to explain to the user what the problem is, and to persuade them -that there really is a problem. Hence having a @code{diagnostic_path} +that there really is a problem. Hence having a @code{diagnostics::paths::path} isn't just an incidental detail of the analyzer; it's required. Paths ought to be: @@ -491,7 +491,7 @@ and notes if it is infeasible. The above gives us a shortest feasible @code{exploded_path} through the @code{exploded_graph} (a list of @code{exploded_edge *}). We use this -@code{exploded_path} to build a @code{diagnostic_path} (a list of +@code{exploded_path} to build a @code{diagnostics::paths::path} (a list of @strong{events} for the diagnostic subsystem) - specifically a @code{checker_path}. @@ -624,17 +624,17 @@ which writes out the diagnostics in HTML form, and generates SVG state diagrams visualizing the state of memory at each event (inspired by the "ddd" debugger). These can be seen by pressing 'j' and 'k' to single-step forward and backward through events. Note that these SVG diagrams are -created from an intermediate XML representation generated from -@code{program_state} objects. The XML representation can be easier to +created from an intermediate SARIF directed graph representation generated from +@code{program_state} objects. The SARIF representation can be easier to read - for example, rather than storing the contents of memory via byte offsets, it uses fields for structs and element indexes for arrays, recursively. However it is a different representation, and thus bugs could be hidden by this transformation. Generating the SVG diagrams requires an invocation of "dot" per event, so it noticeably slows down diagnostic -emission, hence the opt-in command-line flag. The XML and ``dot'' +emission, hence the opt-in command-line flag. The SARIF and ``dot'' representations can be seen by @code{__analyzer_dump_xml} and @code{__analyzer_dump_dot} below (writing them to stderr), or by adding -@code{show-state-diagrams-xml=yes} and +@code{show-state-diagrams-sarif=yes} and @code{show-state-diagrams-dot-src=yes} to the html sink, which shows them within the generated HTML next to the generated SVG. @@ -792,9 +792,9 @@ will emit a warning describing the state of the 2nd argument a name matching the 1st argument (which must be a string literal). This is for use when debugging, and may be of use in DejaGnu tests. -@item __analyzer_dump_xml +@item __analyzer_dump_sarif @smallexample -__analyzer_dump_xml (); +__analyzer_dump_sarif (); @end smallexample will dump the copious information about the analyzer's state each time it diff --git a/gcc/doc/avr-mmcu.texi b/gcc/doc/avr-mmcu.texi index feb7725..5efcc81 100644 --- a/gcc/doc/avr-mmcu.texi +++ b/gcc/doc/avr-mmcu.texi @@ -50,15 +50,15 @@ @item @anchor{avrxmega2}avrxmega2 ``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB of program memory. -@*@var{mcu}@tie{}= @code{atxmega8e5}, @code{atxmega16a4}, @code{atxmega16a4u}, @code{atxmega16c4}, @code{atxmega16d4}, @code{atxmega16e5}, @code{atxmega32a4}, @code{atxmega32a4u}, @code{atxmega32c3}, @code{atxmega32c4}, @code{atxmega32d3}, @code{atxmega32d4}, @code{atxmega32e5}, @code{avr64da28}, @code{avr64da32}, @code{avr64da48}, @code{avr64da64}, @code{avr64db28}, @code{avr64db32}, @code{avr64db48}, @code{avr64db64}, @code{avr64dd14}, @code{avr64dd20}, @code{avr64dd28}, @code{avr64dd32}, @code{avr64du28}, @code{avr64du32}, @code{avr64ea28}, @code{avr64ea32}, @code{avr64ea48}, @code{avr64sd28}, @code{avr64sd32}, @code{avr64sd48}. +@*@var{mcu}@tie{}= @code{atxmega8e5}, @code{atxmega16a4}, @code{atxmega16a4u}, @code{atxmega16c4}, @code{atxmega16d4}, @code{atxmega16e5}, @code{atxmega32a4}, @code{atxmega32a4u}, @code{atxmega32c3}, @code{atxmega32c4}, @code{atxmega32d3}, @code{atxmega32d4}, @code{atxmega32e5}, @code{avr64da28}, @code{avr64da28s}, @code{avr64da32}, @code{avr64da32s}, @code{avr64da48}, @code{avr64da48s}, @code{avr64da64}, @code{avr64da64s}, @code{avr64db28}, @code{avr64db32}, @code{avr64db48}, @code{avr64db64}, @code{avr64dd14}, @code{avr64dd20}, @code{avr64dd28}, @code{avr64dd32}, @code{avr64du28}, @code{avr64du32}, @code{avr64ea28}, @code{avr64ea32}, @code{avr64ea48}, @code{avr64sd28}, @code{avr64sd32}, @code{avr64sd48}. @item @anchor{avrxmega3}avrxmega3 ``XMEGA'' devices with up to 64@tie{}KiB of combined program memory and RAM, and with program memory visible in the RAM address space. -@*@var{mcu}@tie{}= @code{attiny202}, @code{attiny204}, @code{attiny212}, @code{attiny214}, @code{attiny402}, @code{attiny404}, @code{attiny406}, @code{attiny412}, @code{attiny414}, @code{attiny416}, @code{attiny416auto}, @code{attiny417}, @code{attiny424}, @code{attiny426}, @code{attiny427}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny824}, @code{attiny826}, @code{attiny827}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny1624}, @code{attiny1626}, @code{attiny1627}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{attiny3224}, @code{attiny3226}, @code{attiny3227}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}, @code{avr16dd14}, @code{avr16dd20}, @code{avr16dd28}, @code{avr16dd32}, @code{avr16du14}, @code{avr16du20}, @code{avr16du28}, @code{avr16du32}, @code{avr16ea28}, @code{avr16ea32}, @code{avr16ea48}, @code{avr16eb14}, @code{avr16eb20}, @code{avr16eb28}, @code{avr16eb32}, @code{avr32da28}, @code{avr32da32}, @code{avr32da48}, @code{avr32db28}, @code{avr32db32}, @code{avr32db48}, @code{avr32dd14}, @code{avr32dd20}, @code{avr32dd28}, @code{avr32dd32}, @code{avr32du14}, @code{avr32du20}, @code{avr32du28}, @code{avr32du32}, @code{avr32ea28}, @code{avr32ea32}, @code{avr32ea48}, @code{avr32sd20}, @code{avr32sd28}, @code{avr32sd32}. +@*@var{mcu}@tie{}= @code{attiny202}, @code{attiny204}, @code{attiny212}, @code{attiny214}, @code{attiny402}, @code{attiny404}, @code{attiny406}, @code{attiny412}, @code{attiny414}, @code{attiny416}, @code{attiny416auto}, @code{attiny417}, @code{attiny424}, @code{attiny426}, @code{attiny427}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny824}, @code{attiny826}, @code{attiny827}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny1624}, @code{attiny1626}, @code{attiny1627}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{attiny3224}, @code{attiny3226}, @code{attiny3227}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}, @code{avr16dd14}, @code{avr16dd20}, @code{avr16dd28}, @code{avr16dd32}, @code{avr16du14}, @code{avr16du20}, @code{avr16du28}, @code{avr16du32}, @code{avr16ea28}, @code{avr16ea32}, @code{avr16ea48}, @code{avr16eb14}, @code{avr16eb20}, @code{avr16eb28}, @code{avr16eb32}, @code{avr32da28}, @code{avr32da28s}, @code{avr32da32}, @code{avr32da32s}, @code{avr32da48}, @code{avr32da48s}, @code{avr32db28}, @code{avr32db32}, @code{avr32db48}, @code{avr32dd14}, @code{avr32dd20}, @code{avr32dd28}, @code{avr32dd32}, @code{avr32du14}, @code{avr32du20}, @code{avr32du28}, @code{avr32du32}, @code{avr32ea28}, @code{avr32ea32}, @code{avr32ea48}, @code{avr32sd20}, @code{avr32sd28}, @code{avr32sd32}. @item @anchor{avrxmega4}avrxmega4 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory. -@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64a3u}, @code{atxmega64a4u}, @code{atxmega64b1}, @code{atxmega64b3}, @code{atxmega64c3}, @code{atxmega64d3}, @code{atxmega64d4}, @code{avr128da28}, @code{avr128da32}, @code{avr128da48}, @code{avr128da64}, @code{avr128db28}, @code{avr128db32}, @code{avr128db48}, @code{avr128db64}. +@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64a3u}, @code{atxmega64a4u}, @code{atxmega64b1}, @code{atxmega64b3}, @code{atxmega64c3}, @code{atxmega64d3}, @code{atxmega64d4}, @code{avr128da28}, @code{avr128da28s}, @code{avr128da32}, @code{avr128da32s}, @code{avr128da48}, @code{avr128da48s}, @code{avr128da64}, @code{avr128da64s}, @code{avr128db28}, @code{avr128db32}, @code{avr128db48}, @code{avr128db64}. @item @anchor{avrxmega5}avrxmega5 ``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory and more than 64@tie{}KiB of RAM. diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index fc60792..cc1656f 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -3252,7 +3252,7 @@ helps people match the @samp{#endif} to the corresponding @samp{#ifdef}. Older programs sometimes put @var{MACRO} directly after the @samp{#endif} without enclosing it in a comment. This is invalid code according to the C standard. CPP accepts it with a warning. It -never affects which @samp{#ifndef} the @samp{#endif} matches. +never affects which @samp{#ifdef} the @samp{#endif} matches. @findex #ifndef Sometimes you wish to use some code if a macro is @emph{not} defined. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 70adf2d..3c11928 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -5654,12 +5654,12 @@ You can specify the kind of interrupt to be handled by adding an optional parameter to the interrupt attribute like this: @smallexample -void f (void) __attribute__ ((interrupt ("user"))); +void f (void) __attribute__ ((interrupt ("supervisor"))); @end smallexample -Permissible values for this parameter are @code{user}, @code{supervisor}, -and @code{machine}. If there is no parameter, then it defaults to -@code{machine}. +Permissible values for this parameter are @code{supervisor}, +@code{machine}, and @code{rnmi}. If there is no parameter, then it +defaults to @code{machine}. @cindex @code{riscv_vector_cc} function attribute, RISC-V @item riscv_vector_cc @@ -6798,6 +6798,11 @@ Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS instructions followed an additional Newton-Raphson step instead of doing a floating-point division. +@cindex @code{target("80387")} function attribute, x86 +@item 80387 +@itemx no-80387 +Generate code containing 80387 instructions for floating point. + @cindex @code{target("general-regs-only")} function attribute, x86 @item general-regs-only Generate code which uses only the general registers. @@ -7135,6 +7140,85 @@ align them on any target. The @code{aligned} attribute can also be used for functions (@pxref{Common Function Attributes}.) +@cindex @code{alloc_size} variable attribute +@item alloc_size (@var{position}) +@itemx alloc_size (@var{position-1}, @var{position-2}) +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 +to an object whose size is given by the function argument at @var{position}, +or by the product of the arguments at @var{position-1} and @var{position-2}. +Meaningful sizes are positive values less than @code{PTRDIFF_MAX}. Other +sizes are diagnosed when detected. GCC uses this information to improve +the results of @code{__builtin_object_size}. + +For instance, the following declarations + +@smallexample +typedef __attribute__ ((alloc_size (1, 2))) void* + (*calloc_ptr) (size_t, size_t); +typedef __attribute__ ((alloc_size (1))) void* + (*malloc_ptr) (size_t); +@end smallexample + +@noindent +specify that @code{calloc_ptr} is a pointer of a function that, like +the standard C function @code{calloc}, returns an object whose size +is given by the product of arguments 1 and 2, and similarly, that +@code{malloc_ptr}, like the standard C function @code{malloc}, +returns an object whose size is given by argument 1 to the 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 +with static storage duration. The function must take one parameter, +a pointer to a type compatible with the variable. The return value +of the function (if any) is ignored. + +When multiple variables in the same scope have @code{cleanup} +attributes, at exit from the scope their associated cleanup functions +are run in reverse order of definition (last defined, first +cleanup). + +If @option{-fexceptions} is enabled, then @var{cleanup_function} +is run during the stack unwinding that happens during the +processing of the exception. Note that the @code{cleanup} attribute +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. + +@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}) +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 +libraries that define aliases that are expected to specify the same +set of attributes as the aliased symbols. The @code{copy} attribute +can be used with variables, functions or types. However, the kind +of symbol to which the attribute is applied (either varible or +function) must match the kind of symbol to which the argument refers. +The @code{copy} attribute copies only syntactic and semantic attributes +but not attributes that affect a symbol's linkage or visibility such as +@code{alias}, @code{visibility}, or @code{weak}. The @code{deprecated} +attribute is also not copied. @xref{Common Function Attributes}. +@xref{Common Type Attributes}. + @cindex @code{counted_by} variable attribute @item counted_by (@var{count}) The @code{counted_by} attribute may be attached to the C99 flexible array @@ -7238,85 +7322,6 @@ in @code{p->array}. Note, however, the above feature is not valid for the pointer field. -@cindex @code{alloc_size} variable attribute -@item alloc_size (@var{position}) -@itemx alloc_size (@var{position-1}, @var{position-2}) -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 -to an object whose size is given by the function argument at @var{position}, -or by the product of the arguments at @var{position-1} and @var{position-2}. -Meaningful sizes are positive values less than @code{PTRDIFF_MAX}. Other -sizes are diagnosed when detected. GCC uses this information to improve -the results of @code{__builtin_object_size}. - -For instance, the following declarations - -@smallexample -typedef __attribute__ ((alloc_size (1, 2))) void* - (*calloc_ptr) (size_t, size_t); -typedef __attribute__ ((alloc_size (1))) void* - (*malloc_ptr) (size_t); -@end smallexample - -@noindent -specify that @code{calloc_ptr} is a pointer of a function that, like -the standard C function @code{calloc}, returns an object whose size -is given by the product of arguments 1 and 2, and similarly, that -@code{malloc_ptr}, like the standard C function @code{malloc}, -returns an object whose size is given by argument 1 to the 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 -with static storage duration. The function must take one parameter, -a pointer to a type compatible with the variable. The return value -of the function (if any) is ignored. - -When multiple variables in the same scope have @code{cleanup} -attributes, at exit from the scope their associated cleanup functions -are run in reverse order of definition (last defined, first -cleanup). - -If @option{-fexceptions} is enabled, then @var{cleanup_function} -is run during the stack unwinding that happens during the -processing of the exception. Note that the @code{cleanup} attribute -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. - -@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}) -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 -libraries that define aliases that are expected to specify the same -set of attributes as the aliased symbols. The @code{copy} attribute -can be used with variables, functions or types. However, the kind -of symbol to which the attribute is applied (either varible or -function) must match the kind of symbol to which the argument refers. -The @code{copy} attribute copies only syntactic and semantic attributes -but not attributes that affect a symbol's linkage or visibility such as -@code{alias}, @code{visibility}, or @code{weak}. The @code{deprecated} -attribute is also not copied. @xref{Common Function Attributes}. -@xref{Common Type Attributes}. - @cindex @code{deprecated} variable attribute @item deprecated @itemx deprecated (@var{msg}) @@ -12806,6 +12811,7 @@ the two, as explained in the sections below. @menu * Global Register Variables:: Variables declared at global scope. * Local Register Variables:: Variables declared within a function. +* Hard Register Constraints:: Operands forced into specific machine registers. @end menu @node Global Register Variables @@ -13011,6 +13017,167 @@ with slightly different characteristics (@pxref{MIPS Coprocessors,, Defining coprocessor specifics for MIPS targets, gccint, GNU Compiler Collection (GCC) Internals}). +@node Hard Register Constraints +@subsubsection Hard Register Constraints + +Similar to register @code{asm} but still distinct, hard register constraints +are another way to force operands of inline @code{asm} into specific machine +registers. In contrast to register @code{asm} where a variable is bound to a +machine register, a hard register constraint binds an @code{asm} operand to a +machine register. Assume in the following that @code{r4} is a general-purpose +register, @code{f5} a floating-point register, and @code{v6} a vector register +for some target. + +@smallexample +int x; +int y __attribute__ ((vector_size (16))); +@dots{} +asm ("some instructions" + : "=@{r4@}" (x) + : "@{f5@}" (42.0), "@{v6@}" (y)); +@end smallexample + +For the inline @code{asm}, variable @code{x} is bound to register @code{r4}, +and @code{y} is loaded to @code{v6}. Furthermore, constant @code{42.0} is +loaded into floating-point register @code{f5}. + +A key difference between register @code{asm} and hard register constraints is +that the latter are specified at the point where they are supposed to +materialize, namely at inline @code{asm}, which may lead to more readable code. + +@subsubheading Usage + +Each input operand is loaded into the register specified by its corresponding +hard register constraint. Furthermore, each hard register must be used at most +once among an alternative for inputs. This renders hard register constraints +more strict compared to register @code{asm} where multiple inputs may share a +register as for example in + +@smallexample +int x; +register int y asm ("0") = @dots{}; +asm ("" : "=r" (x) : "r" (y), "r" (y)); +@end smallexample + +or even + +@smallexample +register int x asm ("0") = 42; +register int y asm ("0") = 24; +asm ("" : "=r" (x) : "r" (x), "r" (y)); +@end smallexample + +The analogue for hard register constraints is invalid in order to prevent +subtle bugs. + +Likewise, two outputs must not share a register among an alternative. That +means, the following example is invalid + +@smallexample +int x, y; +asm ("" : "=@{r4@}" (x), "=@{r4@}" (y)); // invalid +@end smallexample + +which also aligns with register @code{asm}. Despite that, each output must +refer to a distinct object if a hard register constraint is involved. For +example, in the following, object @code{x} is assigned two registers. + +@smallexample +int x; +asm ("" : "=r" (x), "=r" (x)); +@end smallexample + +This is not allowed for hard register constraints in order to prevent subtle +bugs. Even if only one output operand has a hard register constraint, the code +is rejected since the allocation for the object is still ambiguous. + +@smallexample +int x; +asm ("" : "=r" (x), "=@{1@}" (x)); // invalid +@end smallexample + +The type of an operand must be supported by the corresponding machine register. + +A hard register constraint may refer to any general, floating-point, or vector +register except a fixed register as e.g.@: the stack-pointer register. The set +of allowed registers is target dependent analogue to register @code{asm}. +Furthermore, the referenced register must be a valid register name of the +target. Note, on some targets, a single register may be referred to by +different names where each name specifies the length of the register. For +example, on x86_64 the register names @code{rcx}, @code{ecx}, and @code{cx} all +refer to the same register but in different sizes. If any of those names is +used for a hard register constraint, the actual size of a register is +determined by its corresponding operand. For example + +@smallexample +long x; +asm ("mov\t$42, %0" : "=@{ecx@}" (x)); +@end smallexample + +Although the hard register constraint refers to register @code{ecx}, the actual +register will be @code{rcx} since on x86_64 a @code{long} is 8 byte in total. +This aligns with register @code{asm} where you could have + +@smallexample +register long x asm ("ecx"); +@end smallexample + +@subsubheading Interaction with Register @code{asm} + +A mixture of both constructs as for example + +@smallexample +register int x asm ("r4") = 42; +int y; +asm ("" : "=@{r5@}" (y) : "r" (x)); +@end smallexample + +is valid. + +If an operand is a register @code{asm} and the corresponding constraint a hard +register, then both must refer to the same register. That means + +@smallexample +register int x asm ("r4"); +asm ("" : "=@{r4@}" (x)); +@end smallexample + +is valid and + +@smallexample +register int x asm ("r4"); +asm ("" : "=@{r5@}" (x)); // invalid +@end smallexample + +is invalid. + +Note, register @code{asm} may not only be clobbered by function calls but also +by inline @code{asm} in conjunction with hard register constraints. For +example, in the following + +@smallexample +register int x asm ("r5") = 42; +int y; +asm ("" : "=@{r5@}" (y)); +asm ("" : "+r" (x)); +@end smallexample + +variable @code{x} materializes before the very first inline @code{asm} which +writes to register @code{r5} and therefore clobbers @code{x} which in turn is +read by the subsequent inline @code{asm}. + +@subsubheading Limitations + +At the moment fixed registers are not supported for hard register constraints. +Thus, idioms like + +@smallexample +register void *x asm ("rsp"); +asm ("" : "=r" (x)); +@end smallexample + +are not supported for hard register constraints. This might be lifted. + @node Size of an asm @subsection Size of an @code{asm} @@ -15553,7 +15720,7 @@ are 128-bit. Only supported on targets when 128-bit types are supported. Returns the calculated 8-bit bit-reversed CRC using the initial CRC (8-bit), data (8-bit) and the polynomial (8-bit). @var{crc} is the initial CRC, @var{data} is the data and -@var{poly} is the polynomial without leading 1. +@var{poly} is the polynomial without leading 1. @var{poly} is required to be a compile-time constant. Table-based or clmul-based CRC may be used for the calculation, depending on the target architecture. @enddefbuiltin @@ -15608,7 +15775,7 @@ is 32-bit. Returns the calculated 8-bit bit-forward CRC using the initial CRC (8-bit), data (8-bit) and the polynomial (8-bit). @var{crc} is the initial CRC, @var{data} is the data and -@var{poly} is the polynomial without leading 1. +@var{poly} is the polynomial without leading 1. @var{poly} is required to be a compile-time constant. Table-based or clmul-based CRC may be used for the calculation, depending on the target architecture. @enddefbuiltin @@ -16356,8 +16523,9 @@ invoke undefined behavior at run time. Warnings for out of bound accesses for vector subscription can be enabled with @option{-Warray-bounds}. -Vector comparison is supported with standard comparison -operators: @code{==, !=, <, <=, >, >=}. Comparison operands can be +Vector comparison is supported with standard comparison operators: +@code{==}, @code{!=}, @code{<}, @code{<=}, @code{>}, and +@code{>=}. Comparison operands can be vector expressions of integer-type or real-type. Comparison between integer-type vectors and real-type vectors are not supported. The result of the comparison is a vector of the same width and number of @@ -17085,7 +17253,8 @@ is computed. @smallexample struct V @{ char buf1[10]; int b; char buf2[10]; @} var; -char *p = &var.buf1[1], *q = &var.b; +char *p = &var.buf1[1]; +int *q = &var.b; /* Here the object p points to is var. */ assert (__builtin_object_size (p, 0) == sizeof (var) - 1); @@ -30684,6 +30853,12 @@ A binary type trait: @code{true} whenever the @var{type1} and @var{type2} refer to the same type. @enddefbuiltin +@defbuiltin{size_t __builtin_structured_binding_size (@var{type})} +This trait returns the structured binding size ([dcl.struct.bind]) +of @var{type}. If a type does not have a structured binding size, +an error is diagnosed unless it is used in SFINAE contexts. +@enddefbuiltin + @node Deprecated Features @section Deprecated Features diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index 9bd0f0d..d908aea 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -143,11 +143,7 @@ available and access to assembly programming is achieved using the same syntax as that used by GCC. The gm2 driver allows third party libraries to be installed alongside -gm2 libraries. For example if the user specifies library @code{foo} -using @code{-flibs=foo} the driver will check the standard GCC install -directory for a sub directory @code{foo} containing the library -contents. The library module search path is altered accordingly -for compile and link. +gm2 libraries. @xref{Module Search Path}. @node Development, Features, Why use GNU Modula-2, Overview @section How to get source code using git @@ -229,6 +225,7 @@ such as the AVR and the ARM). * Standard procedures:: Permanently accessible base procedures. * High procedure function:: Behavior of the high procedure function. * Dialect:: GNU Modula-2 supported dialects. +* Module Search Path:: How to add library modules. * Exceptions:: Exception implementation * Semantic checking:: How to detect run time problems at compile time. * Extensions:: GNU Modula-2 language extensions. @@ -525,6 +522,15 @@ following include paths. for internal use only: used by the driver to copy the user facing @samp{-I} option. +@item -fm2-pathname-root=@file{pathroot} +add search paths derived from the specified @file{pathroot}. +@xref{Module Search Path} for examples. + +@item -fm2-pathname-rootI +for internal use only: used by the driver to copy every user +@samp{-fm2-pathname-root=} facing option in order with all other +@samp{-I} options. + @item -fm2-plugin insert plugin to identify run time errors at compile time (default on). @@ -1379,7 +1385,7 @@ Actual parameter | HIGH (a) | a[HIGH (a)] = nul str3 | 3 | TRUE @end example -@node Dialect, Exceptions, High procedure function, Using +@node Dialect, Module Search Path, High procedure function, Using @section GNU Modula-2 supported dialects This section describes the dialects understood by GNU Modula-2. @@ -1444,6 +1450,43 @@ implemented as above, apart from the exception calling in the ISO dialect. Instead of exception handling the results are the same as the PIM4 dialect. This is a temporary implementation situation. +@node Module Search Path, Exceptions, Dialect, Using +@section Module Search Path + +This section describes the default module search path and how this +might be changed. By default the compiler will search the current +directory, local include dir, prefix include dir, gcc version specific +modules and lastly native system header dir. The exact location and +whether all these directories are used depends upon the configuration +options used when building GCC. + +The @samp{-I} option option can be used to introduce new directories +in the module search path and for convenience the options @samp{-flibs=} +and @samp{-fm2-pathname-root=} are also provided. + +The site wide modules are typically located at +@var{prefix}@file{/include/m2} +whereas the version specific modules are located in +@var{libsubdir}@file{/m2}. Both of these @file{/m2} directories +are organized such that the non dialect specific modules are at the +top and dialect specific modules are in subdirectories. + +The @samp{-fm2-pathname-root=} option is equivalent to adding a +@samp{-I} path for every library dialect. For example if the library +dialect order is selected by @samp{-flibs=pim,iso,log} and +@samp{-fm2-pathname-root=foo} is supplied then this is equivalent to +the following pairs of options: + +@example +-fm2-pathname=m2pim -I@file{foo/m2/m2pim} +-fm2-pathname=m2iso -I@file{foo/m2/m2iso} +-fm2-pathname=m2log -I@file{foo/m2/m2log} +-fm2-pathname=- -I@file{foo/m2} +@end example + +The option @samp{-fsources} will show the source module, path and +pathname for each module parsed. + @node Exceptions, Semantic checking, Dialect, Using @section Exception implementation @@ -2023,7 +2066,7 @@ CONST VAR head: List ; -@end group +@end group @end example @example @@ -2034,13 +2077,13 @@ VAR BEGIN p := head^.next ; printf ("\nunique data\n"); - printf ("===========\n"); + printf ("===========\n"); WHILE p # NIL DO printf ("%d\n", p^.value); p := p^.next END END Display ; -@end group +@end group @end example @example @@ -2053,7 +2096,7 @@ BEGIN next := NIL END END Add ; -@end group +@end group @end example @example @@ -2075,17 +2118,17 @@ EXCEPT THEN printf ("list was empty, add sentinal\n"); Add (head, -1) ; - RETRY (* Jump back to the begin statement. *) + RETRY (* Jump back to the begin statement. *) ELSIF p^.next = NIL THEN printf ("growing the list\n"); Add (p^.next, val) ; RETRY (* Jump back to the begin statement. *) ELSE - printf ("should never reach here!\n"); + printf ("should never reach here!\n"); END END Unique ; -@end group +@end group @end example @example @@ -2104,7 +2147,7 @@ BEGIN head := NIL ; unique END lazyunique. -@end group +@end group @end example @example @@ -2127,7 +2170,7 @@ unique data 0 2 1 -@end group +@end group @end example @node Unbounded by reference, Building a shared library, Exception handling, Using diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 80ee2cd..c399b1f 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -302,7 +302,7 @@ released on 2017-05-06. The gcobol documentation is maintained as manpages using troff mdoc. GNU groff is required to convert them to PDF format. Conversion to HTML is done with mandoc, available at -@uref{http://mdocml.bsd.lv/}. +@uref{https://mandoc.bsd.lv}. Because ISO COBOL defines strict requirements for numerical precision, gcobol requires hardware with 128-bit computation instructions. This @@ -393,7 +393,7 @@ Note binutils 2.35 or newer is required for LTO to work correctly with GNU libtool that includes doing a bootstrap with LTO enabled. @item gzip version 1.2.4 (or later) or -@itemx bzip2 version 1.0.2 (or later) +@itemx xz version 5.0 (or later) Necessary to uncompress GCC @command{tar} files when source code is obtained via HTTPS mirror sites. @@ -1254,6 +1254,9 @@ descriptor-based dialect. For RISC-V targets, possible values for @var{dialect} are @code{trad} or @code{desc}, which select between the traditional GNU dialect and the GNU TLS descriptor-based dialect. +For i386, x86-64 targets, possible values for @var{dialect} are @code{gnu} or +@code{gnu2}, which select between the original GNU dialect and the GNU TLS +descriptor-based dialect. @item --enable-multiarch Specify whether to enable or disable multiarch support. The default is @@ -1558,23 +1561,23 @@ for riscv*-*-elf*. The accepted values and meanings are given below. Every config is constructed with four components: architecture string, ABI, reuse rule with architecture string and reuse rule with sub-extension. -Example 1: Add multi-lib suppport for rv32i with ilp32. +Example 1: Add multi-lib support for rv32i with ilp32. @smallexample rv32i-ilp32-- @end smallexample -Example 2: Add multi-lib suppport for rv32i with ilp32 and rv32imafd with ilp32. +Example 2: Add multi-lib support for rv32i with ilp32 and rv32imafd with ilp32. @smallexample rv32i-ilp32--;rv32imafd-ilp32-- @end smallexample -Example 3: Add multi-lib suppport for rv32i with ilp32; rv32im with ilp32 and +Example 3: Add multi-lib support for rv32i with ilp32; rv32im with ilp32 and rv32ic with ilp32 will reuse this multi-lib set. @smallexample rv32i-ilp32-rv32im-c @end smallexample -Example 4: Add multi-lib suppport for rv64ima with lp64; rv64imaf with lp64, +Example 4: Add multi-lib support for rv64ima with lp64; rv64imaf with lp64, rv64imac with lp64 and rv64imafc with lp64 will reuse this multi-lib set. @smallexample rv64ima-lp64--f,c,fc @@ -1585,13 +1588,13 @@ rv64ima-lp64--f,c,fc config options, @var{val} is a comma separated list of possible code model, currently we support medlow and medany. -Example 5: Add multi-lib suppport for rv64ima with lp64; rv64ima with lp64 and +Example 5: Add multi-lib support for rv64ima with lp64; rv64ima with lp64 and medlow code model @smallexample rv64ima-lp64--;--cmodel=medlow @end smallexample -Example 6: Add multi-lib suppport for rv64ima with lp64; rv64ima with lp64 and +Example 6: Add multi-lib support for rv64ima with lp64; rv64ima with lp64 and medlow code model; rv64ima with lp64 and medany code model @smallexample rv64ima-lp64--;--cmodel=medlow,medany @@ -1720,7 +1723,7 @@ libraries. This option is only supported on Epiphany targets. @item --with-fpmath=@var{isa} This options sets @option{-mfpmath=sse} by default and specifies the default -ISA for floating-point arithmetics. You can select either @samp{sse} which +ISA for floating-point arithmetic. You can select either @samp{sse} which enables @option{-msse2} or @samp{avx} which enables @option{-mavx} by default. This option is only supported on i386 and x86-64 targets. @@ -1887,8 +1890,8 @@ Produce code conforming to version 20191213. In the absence of this configuration option the default version is 20191213. @item --enable-__cxa_atexit -Define if you want to use @code{__cxa_atexit}, rather than atexit, to -register C++ destructors for local statics and global objects. +Define if you want to use @code{__cxa_atexit}, rather than @code{atexit}, +to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires @code{__cxa_atexit} in libc. This option is currently only available on systems with GNU libc. When enabled, this @@ -2667,6 +2670,17 @@ target binutils supports @code{Intel CET} instructions and disabled otherwise. In this case, the target libraries are configured to get additional @option{-fcf-protection} option. +@item --enable-x86-64-mfentry +@itemx --disable-x86-64-mfentry +Enable @option {-mfentry} by default on x86-64 to put the profiling +counter call, @code{__fentry__}, before the prologue so that @option{-pg} +can be used with @option{-fshrink-wrap} which is enabled at @option{-O1}. +This configure option is 64-bit only because @code{__fentry__} doesn't +support PIC in 32-bit mode. + +@option{--enable-x86-64-mfentry=auto} is default. @option{-mfentry} is +enabled on Linux/x86-64 by default. + @item --with-riscv-attribute=@samp{yes}, @samp{no} or @samp{default} Generate RISC-V attribute by default, in order to record extra build information in object. @@ -3789,8 +3803,7 @@ Microsoft Windows: @item The @uref{https://sourceware.org/cygwin/,,Cygwin} project; @item -The @uref{https://osdn.net/projects/mingw/,,MinGW} and -@uref{https://www.mingw-w64.org/,,mingw-w64} projects. +the @uref{https://www.mingw-w64.org/,,mingw-w64} project. @end itemize @item @@ -4051,9 +4064,15 @@ AMD GCN GPU target. Instead of GNU Binutils, you need to install LLVM and copy @file{bin/llvm-mc} to @file{amdgcn-amdhsa/bin/as}, @file{bin/lld} to @file{amdgcn-amdhsa/bin/ld}, +@file{bin/llvm-objdump} to @file{amdgcn-amdhsa/bin/objdump}, @file{bin/llvm-nm} to @file{amdgcn-amdhsa/bin/nm}, and @file{bin/llvm-ar} to both @file{bin/amdgcn-amdhsa-ar} and -@file{bin/amdgcn-amdhsa-ranlib}. +@file{bin/amdgcn-amdhsa-ranlib}. The LLVM version is required for the +assembler (llvm-mc) and linker (lld); however, for the others, the respective +GNU Binutils counterpart can be used instead. While all mentioned programs are +required when building GCC, the installed GCC compiler only needs the assembler +and linker; @code{nm}, @code{ar}, and @code{ranlib} are required when installing +@code{gcc-nm}, @code{gcc-ar}, and @code{gcc-ranlib}. The required version of LLVM depends on the devices that you want to support. As the list of ISAs is long, GCC by default only builds a subset of the @@ -4077,12 +4096,12 @@ ISA targets @code{gfx9-generic}, @code{gfx10-3-generic}, and @code{gfx11-generic} reduce the number of required multilibs but note that @code{gfx9-generic} does not include @code{gfx908} or @code{gfx90a}, that linking specific ISA code with generic code is currently not supported, -and that only a future ROCm release (newer than 6.3.3) will be able to execute -generic code. +and that only ROCm 6.4.0 or newer is able to execute generic code. Use Newlib (4.3.0 or newer; 4.4.0 contains some improvements and 4.5.0 fixes the device console output for GFX10 and GFX11 devices; post-4.5.0 -commit 2ef1a37e7 [Mar 25, 2025] fixes a SIMD math issue). +commits 2ef1a37e7 [Mar 25, 2025], f13e8e215 [Aug 8, 2025], and +bd409f3c1 [Aug 27, 2025] fix SIMD math issues). To run the binaries, install the HSA Runtime from the @uref{https://rocm.docs.amd.com/,,ROCm Platform}, and use @@ -5153,13 +5172,6 @@ respects, this target is the same as the @anchor{windows} @heading Microsoft Windows -@subheading Intel 16-bit versions -The 16-bit versions of Microsoft Windows, such as Windows 3.1, are not -supported. - -However, the 32-bit port has limited support for Microsoft -Windows 3.11 in the Win32s environment, as a target only. See below. - @subheading Intel 32-bit versions The 32-bit versions of Windows, including Windows 95, Windows NT, Windows XP, and Windows Vista, are supported by several different target diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7640e7d..c0b7aab 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -268,7 +268,7 @@ in the following sections. -Wrange-loop-construct -Wredundant-move -Wredundant-tags -Wreorder -Wregister -Wno-sfinae-incomplete -Wstrict-null-sentinel -Wno-subobject-linkage -Wtemplates --Wno-non-template-friend -Wold-style-cast +-Wno-non-c-typedef-for-linkage -Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions -Wself-move -Wsign-promo -Wsized-deallocation -Wsuggest-final-methods -Wsuggest-final-types -Wsuggest-override -Wno-template-body @@ -322,6 +322,9 @@ Objective-C and Objective-C++ Dialects}. -fno-diagnostics-show-cwe -fno-diagnostics-show-rules -fno-diagnostics-show-highlight-colors +-fno-diagnostics-show-nesting +-fno-diagnostics-show-nesting-locations +-fdiagnostics-show-nesting-levels -fdiagnostics-minimum-margin-width=@var{width} -fdiagnostics-parseable-fixits -fdiagnostics-generate-patch -fdiagnostics-show-template-tree -fno-elide-type @@ -331,7 +334,8 @@ Objective-C and Objective-C++ Dialects}. -fdiagnostics-column-unit=@r{[}display@r{|}byte@r{]} -fdiagnostics-column-origin=@var{origin} -fdiagnostics-escape-format=@r{[}unicode@r{|}bytes@r{]} --fdiagnostics-text-art-charset=@r{[}none@r{|}ascii@r{|}unicode@r{|}emoji@r{]}} +-fdiagnostics-text-art-charset=@r{[}none@r{|}ascii@r{|}unicode@r{|}emoji@r{]} +-fdiagnostics-show-context@r{[}=@var{depth}@r{]}} @item Warning Options @xref{Warning Options,,Options to Request or Suppress Warnings}. @@ -353,7 +357,7 @@ Objective-C and Objective-C++ Dialects}. -Wno-builtin-macro-redefined -Wc90-c99-compat -Wc99-c11-compat -Wc11-c23-compat -Wc23-c2y-compat -Wc++-compat -Wc++11-compat -Wc++14-compat -Wc++17-compat --Wc++20-compat +-Wc++20-compat -Wc++26-compat -Wno-c++11-extensions -Wno-c++14-extensions -Wno-c++17-extensions -Wno-c++20-extensions -Wno-c++23-extensions -Wcalloc-transposed-args @@ -388,6 +392,7 @@ Objective-C and Objective-C++ Dialects}. -Winit-self -Winline -Wno-int-conversion -Wint-in-bool-context -Wno-int-to-pointer-cast -Wno-invalid-memory-model -Winvalid-pch -Winvalid-utf8 -Wno-unicode -Wjump-misses-init +-Wkeyword-macro -Wlarger-than=@var{byte-size} -Wleading-whitespace=@var{kind} -Wlogical-not-parentheses -Wlogical-op -Wlong-long -Wno-lto-type-mismatch -Wmain -Wmaybe-uninitialized @@ -433,7 +438,8 @@ Objective-C and Objective-C++ Dialects}. -Wunsuffixed-float-constants -Wunterminated-string-initialization -Wunused --Wunused-but-set-parameter -Wunused-but-set-variable +-Wunused-but-set-parameter -Wunused-but-set-parameter=@var{n} +-Wunused-but-set-variable -Wunused-but-set-variable=@var{n} -Wunused-const-variable -Wunused-const-variable=@var{n} -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-macros @@ -914,7 +920,7 @@ Objective-C and Objective-C++ Dialects}. @emph{AVR Options} (@ref{AVR Options}) @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args -mcvt -mbranch-cost=@var{cost} -mfuse-add=@var{level} -mfuse-move=@var{level} --mcall-prologues -mgas-isr-prologues -mint8 -mflmap +-mfuse-move2 -mcall-prologues -mgas-isr-prologues -mint8 -mflmap -mdouble=@var{bits} -mlong-double=@var{bits} -mno-call-main -mn_flash=@var{size} -mfract-convert-truncate -mno-interrupts -mmain-is-OS_task -mrelax -mrmw -mstrict-X -mtiny-stack @@ -1097,7 +1103,8 @@ Objective-C and Objective-C++ Dialects}. -mcmodel=@var{code-model} -mrelax -mpass-mrelax-to-as -mrecip -mrecip=@var{opt} -mfrecipe -mno-frecipe -mdiv32 -mno-div32 -mlam-bh -mno-lam-bh -mlamcas -mno-lamcas -mld-seq-sa -mno-ld-seq-sa --mtls-dialect=@var{opt} -mannotate-tablejump -mno-annotate-tablejump} +-mscq -mno-scq -mtls-dialect=@var{opt} +-mannotate-tablejump -mno-annotate-tablejump} @emph{M32C Options} (@ref{M32C Options}) @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}} @@ -1258,7 +1265,7 @@ See RS/6000 and PowerPC Options. @emph{PRU Options} (@ref{PRU Options}) @gccoptlist{-mmcu=@var{mcu} -minrt -mno-relax -mloop --mabi=@var{variant}} +-mmul -mfillzero -mabi=@var{variant}} @emph{RISC-V Options} (@ref{RISC-V Options}) @gccoptlist{-mbranch-cost=@var{N-instruction} @@ -3015,8 +3022,9 @@ Version 20, which first appeared in G++ 15, fixes manglings of lambdas in static data member initializers. Version 21, which first appeared in G++ 16, fixes unnecessary captures -in noexcept lambdas (c++/119764) and layout of a base class -with all explicitly defaulted constructors (c++/120012). +in noexcept lambdas (c++/119764), layout of a base class with all explicitly +defaulted constructors (c++/120012), and mangling of class and array +objects with implicitly zero-initialized non-trailing subobjects (c++/121231). See also @option{-Wabi}. @@ -3816,6 +3824,23 @@ Warn when a type with an ABI tag is used in a context that does not have that ABI tag. See @ref{C++ Attributes} for more information about ABI tags. +@opindex Wabbreviated-auto-in-template-arg +@opindex Wno-abbreviated-auto-in-template-arg +@item -Wno-abbreviated-auto-in-template-arg +Disable the error for an @code{auto} placeholder type used within a +template argument list to declare a C++20 abbreviated function +template, e.g. + +@smallexample +void f(S<auto>); +@end smallexample + +This feature was proposed in the Concepts TS, but was not adopted into +C++20; in the standard, a placeholder in a parameter declaration must +appear as a decl-specifier. The error can also be reduced to a +warning by @option{-fpermissive} or +@option{-Wno-error=abbreviated-auto-in-template-arg}. + @opindex Wcomma-subscript @opindex Wno-comma-subscript @item -Wcomma-subscript @r{(C++ and Objective-C++ only)} @@ -4471,6 +4496,28 @@ to @code{__null}. Although it is a null pointer constant rather than a null pointer, it is guaranteed to be of the same size as a pointer. But this use is not portable across different compilers. +@opindex Wno-non-c-typedef-for-linkage +@opindex Wnon-c-typedef-for-linkage +@item -Wno-non-c-typedef-for-linkage @r{(C++ and Objective-C++ only)} +Disable pedwarn for unnamed classes with a typedef name for linkage purposes +containing C++ specific members, base classes, default member initializers +or lambda expressions, including those on nested member classes. + +@smallexample +typedef struct @{ + int a; // non-static data members are ok + struct T @{ int b; @}; // member classes too + enum E @{ E1, E2, E3 @}; // member enumerations as well + int c = 42; // default member initializers are not ok + struct U : A @{ int c; @}; // classes with base classes are not ok + typedef int V; // typedef is not ok + using W = int; // using declaration is not ok + decltype([]()@{@}) x; // lambda expressions not ok +@} S; +@end smallexample + +In all these cases, the tag name S should be added after the struct keyword. + @opindex Wno-non-template-friend @opindex Wnon-template-friend @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)} @@ -5409,7 +5456,8 @@ options: -fdiagnostics-urls=never -fdiagnostics-path-format=separate-events -fdiagnostics-text-art-charset=none --fno-diagnostics-show-event-links} +-fno-diagnostics-show-event-links +-fno-diagnostics-show-nesting} In the future, if GCC changes the default appearance of its diagnostics, the corresponding option to disable the new behavior will be added to this list. @@ -5746,6 +5794,22 @@ left margin. This option controls the minimum width of the left margin printed by @option{-fdiagnostics-show-line-numbers}. It defaults to 6. +@opindex fdiagnostics-show-context +@item -fdiagnostics-show-context[=@var{depth}] +@itemx -fno-diagnostics-show-context +With this option, the compiler might print the interesting control flow +chain that guards the basic block of the statement which has the warning. +@var{depth} is the maximum depth of the control flow chain. +Currently, The list of the impacted warning options includes: +@option{-Warray-bounds}, @option{-Wstringop-overflow}, +@option{-Wstringop-overread}, @option{-Wstringop-truncation}. +and @option{-Wrestrict}. +More warning options might be added to this list in future releases. +The forms @option{-fdiagnostics-show-context} and +@option{-fno-diagnostics-show-context} are aliases for +@option{-fdiagnostics-show-context=1} and +@option{-fdiagnostics-show-context=0}, respectively. + @opindex fdiagnostics-parseable-fixits @item -fdiagnostics-parseable-fixits Emit fix-it hints in a machine-parseable format, suitable for consumption @@ -6031,6 +6095,40 @@ emoji variant of the character). The default is @samp{emoji}, except when the environment variable @env{LANG} is set to @samp{C}, in which case the default is @samp{ascii}. +@opindex fno-diagnostics-show-nesting +@opindex fdiagnostics-show-nesting +@item -fno-diagnostics-show-nesting +Some GCC diagnostics have an internal tree-like structure of nested +sub-diagnostics, such as for problems when instantiating C++ templates. + +By default GCC uses indentation and bullet points in its text output to +show the nesting structure of these diagnostics, moves location +information to separate lines to make the structure clearer, and +eliminates redundant repeated information. + +Selecting @option{-fno-diagnostics-show-nesting} suppresses this +indentation, reformatting, and elision, restoring an older `look'' for the +diagnostics. + +@opindex fno-diagnostics-show-nesting-locations +@opindex fdiagnostics-show-nesting-locations +@item -fno-diagnostics-show-nesting-locations + +When @option{fdiagnostics-show-nesting} is enabled, file names and +line- and column- numbers are displayed on separate lines from the +messages. This location information can be disabled altogether with +@option{-fno-diagnostics-show-nesting-locations}. +This option exists for use by GCC developers, for writing DejaGnu test cases. + +@opindex fdiagnostics-show-nesting-levels +@opindex fno-diagnostics-show-nesting-levels +@item -fdiagnostics-show-nesting-levels +When @option{fdiagnostics-show-nesting} is enabled, use +@option{fdiagnostics-show-nesting-levels} to also display numbers +showing the depth of the nesting. +This option exists for use by GCC developers for debugging nested +diagnostics, but may be of use to plugin authors. + @opindex fdiagnostics-format @item -fdiagnostics-format=@var{FORMAT} Select a different format for printing diagnostics. @@ -6079,18 +6177,18 @@ Supported keys are: Override colorization settings from @option{-fdiagnostics-color} for this text output. -@item experimental-nesting=@r{[}yes@r{|}no@r{]} -Enable an experimental mode that emphasizes hierarchical relationships -within diagnostics messages, displaying location information on separate -lines. +@item show-nesting=@r{[}yes@r{|}no@r{]} +Enable a mode that emphasizes hierarchical relationships +within diagnostics messages, as per @option{-fdiagnostics-show-nesting}. +Defaults to @code{yes}. -@item experimental-nesting-show-locations=@r{[}yes@r{|}no@r{]} -If @code{experimental-nesting=yes}, then by default locations are +@item show-nesting-locations=@r{[}yes@r{|}no@r{]} +If @code{show-nesting=yes}, then by default locations are shown; set this key to @code{no} to disable printing such locations. This exists for use by GCC developers, for writing DejaGnu test cases. -@item experimental-nesting-show-levels=@r{[}yes@r{|}no@r{]} -This is a debugging option for use with @code{experimental-nesting=yes}. +@item show-nesting-levels=@r{[}yes@r{|}no@r{]} +This is a debugging option for use with @code{show-nesting=yes}. Set this key to @code{yes} to print explicit nesting levels in the output. This exists for use by GCC developers. @@ -6126,10 +6224,10 @@ end-users, and subject to change or removal without notice: @table @gcctabopt -@item xml-state=@r{[}yes@r{|}no@r{]} +@item state-graphs=@r{[}yes@r{|}no@r{]} This is a debugging feature and defaults to @code{no}. -If @code{xml-state=yes}, then attempt to capture detailed state information -from @option{-fanalyzer} in the generated SARIF. +If @code{state-graphs=yes}, then attempt to capture detailed state +information from @option{-fanalyzer} in the generated SARIF. @end table @@ -6177,11 +6275,11 @@ then if @code{show-state-diagrams=yes}, the generated state diagrams will also show the .dot source input to GraphViz used for the diagram. -@item show-state-diagrams-xml=@r{[}yes@r{|}no@r{]} +@item show-state-diagrams-sarif=@r{[}yes@r{|}no@r{]} This is a debugging feature and defaults to @code{no}. -If @code{show-state-diagrams-xml=yes} +If @code{show-state-diagrams-sarif=yes} then if @code{show-state-diagrams=yes}, the generated state diagrams will -also show an XML representation of the state. +also show a SARIF representation of the state. @end table @@ -6443,6 +6541,7 @@ only by this flag, but it also downgrades some C and C++ diagnostics that have their own flag: @gccoptlist{ +-Wabbreviated-auto-in-template-arg @r{(C++ and Objective-C++ only)} -Wdeclaration-missing-parameter-type @r{(C and Objective-C only)} -Wimplicit-function-declaration @r{(C and Objective-C only)} -Wimplicit-int @r{(C and Objective-C only)} @@ -7903,27 +8002,89 @@ statement. @opindex Wunused-but-set-parameter @opindex Wno-unused-but-set-parameter @item -Wunused-but-set-parameter +@option{-Wunused-but-set-parameter} is the same as +@option{-Wunused-but-set-parameter=3} and +@option{-Wno-unused-but-set-parameter} is the same as +@option{-Wunused-but-set-parameter=0}. + +@opindex Wunused-but-set-parameter= +@item -Wunused-but-set-parameter=@var{n} Warn whenever a function parameter is assigned to, but otherwise unused (aside from its declaration). To suppress this warning use the @code{unused} attribute (@pxref{Variable Attributes}). -This warning is also enabled by @option{-Wunused} together with -@option{-Wextra}. +@option{-Wunused-but-set-parameter=0} disables the warning. +With @option{-Wunused-but-set-parameter=1} all uses except initialization +and left hand side of assignment which is not further used disable the +warning. +With @option{-Wunused-but-set-parameter=2} additionally uses of parameter +in @code{++} and @code{--} operators don't count as uses. +And finally with @option{-Wunused-but-set-parameter=3} additionally +uses in @var{parm} @code{@var{@@}=} @var{rhs} outside of @var{rhs} don't +count as uses. See @option{-Wunused-but-set-variable=@var{n}} option for +examples. + +This @option{-Wunused-but-set-parameter=3} warning is also enabled by +@option{-Wunused} together with @option{-Wextra}. @opindex Wunused-but-set-variable @opindex Wno-unused-but-set-variable @item -Wunused-but-set-variable +@option{-Wunused-but-set-variable} is the same as +@option{-Wunused-but-set-variable=3} and +@option{-Wno-unused-but-set-variable} is the same as +@option{-Wunused-but-set-variable=0}. + +@opindex Wunused-but-set-variable= +@item -Wunused-but-set-variable=@var{n} Warn whenever a local variable is assigned to, but otherwise unused (aside from its declaration). -This warning is enabled by @option{-Wall}. +This @option{-Wunused-but-set-variable=3} warning is enabled by @option{-Wall}. To suppress this warning use the @code{unused} attribute (@pxref{Variable Attributes}). -This warning is also enabled by @option{-Wunused}, which is enabled -by @option{-Wall}. +@option{-Wunused-but-set-variable=0} disables the warning. +With @option{-Wunused-but-set-variable=1} all uses except initialization +and left hand side of assignment which is not further used disable the +warning. +With @option{-Wunused-but-set-variable=2} additionally uses of variable +in @code{++} and @code{--} operators don't count as uses. +And finally with @option{-Wunused-but-set-variable=3} additionally +uses in @var{parm} @code{@var{@@}=} @var{rhs} outside of @var{rhs} don't +count as uses. + +This @option{-Wunused-but-set-variable=3} warning is also enabled by +@option{-Wunused}, which is enabled by @option{-Wall}. + +@smallexample +void foo (void) +@{ + int a = 1; // @option{-Wunused-variable} warning + int b = 0; // Warning for @var{n} >= 1 + b = 1; b = 2; + int c = 0; // Warning for @var{n} >= 2 + ++c; c--; --c; c++; + int d = 0; // Warning for @var{n} >= 3 + d += 4; + int e = 0; // No warning, cast to void + (void) e; + int f = 0; // No warning, f used + int g = f = 5; + (void) g; + int h = 0; // No warning, preincrement used + int i = ++h; + (void) i; + int j = 0; // No warning, postdecrement used + int k = j--; + (void) k; + int l = 0; // No warning, l used + int m = l |= 2; + (void) m; +@} +@end smallexample @opindex Wunused-function @opindex Wno-unused-function @@ -9672,6 +9833,12 @@ and ISO C++ 2017. This warning is enabled by @option{-Wall}. Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020. This warning is enabled by @option{-Wall}. +@opindex Wc++26-compat +@opindex Wno-c++26-compat +@item -Wc++26-compat @r{(C++ and Objective-C++ only)} +Warn about C++ constructs whose meaning differs between ISO C++ 2023 +and upcoming ISO C++ 2026. This warning is enabled by @option{-Wall}. + @opindex Wc++11-extensions @opindex Wno-c++11-extensions @item -Wno-c++11-extensions @r{(C++ and Objective-C++ only)} @@ -10311,6 +10478,14 @@ Do not warn if certain built-in macros are redefined. This suppresses warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__}, @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}. +@opindex Wkeyword-macro +@opindex Wno-keyword-macro +@item -Wkeyword-macro +Warn if a keyword is defined as a macro or undefined. +For C++ identifiers with special meaning or standard attribute identifiers +are diagnosed as well. This warning is enabled by default for C++26 +if @code{-Wpedantic} and emits a pedwarn in that case. + @opindex Wfree-labels @opindex Wno-free-labels @item -Wfree-labels @r{(C and Objective-C only)} @@ -15476,7 +15651,7 @@ If omitted, it defaults to @file{fbdata.afdo} in the current directory. Producing an AutoFDO profile data file requires running your program with the @command{perf} utility on a supported GNU/Linux target system. -For more information, see @uref{https://perf.wiki.kernel.org/}. +For more information, see @uref{https://perfwiki.github.io/main/}. E.g. @smallexample @@ -17697,6 +17872,9 @@ Instructions number above which STFL stall penalty can be compensated. The maximum number of use and def visits when discovering a STV chain before the discovery is aborted. +@item ix86-vect-unroll-limit +Limit how much the autovectorizer may unroll a loop. + @end table @end table @@ -20525,18 +20703,22 @@ LTO output files. @opindex fdump-rtl-@var{pass} @item -d@var{letters} @itemx -fdump-rtl-@var{pass} -@itemx -fdump-rtl-@var{pass}=@var{filename} +@itemx -fdump-rtl-@var{pass}-@var{options} +@itemx -fdump-rtl-@var{pass}-@var{options}=@var{filename} Says to make debugging dumps during compilation at times specified by -@var{letters}. This is used for debugging the RTL-based passes of the +@var{letters} when using @option{-d} or by @var{pass} when using +@option{-fdump-rtl}. This is used for debugging the RTL-based passes of the compiler. Some @option{-d@var{letters}} switches have different meaning when @option{-E} is used for preprocessing. @xref{Preprocessor Options}, for information about preprocessor-specific dump options. -Debug dumps can be enabled with a @option{-fdump-rtl} switch or some -@option{-d} option @var{letters}. Here are the possible -letters for use in @var{pass} and @var{letters}, and their meanings: +The @samp{-@var{options}} form allows greater control over the details of the +dump. See @option{-fdump-tree}. + +Here are actual instances of command-line options following these patterns and +their meanings: @table @gcctabopt @@ -21063,8 +21245,7 @@ GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}. Each function in the file is pretty-printed as a subgraph, so that GraphViz can render them all in a single plot. -This option currently only works for RTL dumps, and the RTL is always -dumped in slim form. +RTL is always dumped in slim form. @item vops Enable showing virtual operands for every statement. @item lineno @@ -22759,7 +22940,7 @@ Compile for the CDNA3 gfx950 devices. (Experimental) @item gfx9-generic Compile generic code for Vega devices, executable on the following subset of -GFX9 devices: gfx900, gfx902, gfx904, gfx906, gfx909 and gfx90c. (Experimental) +GFX9 devices: gfx900, gfx902, gfx904, gfx906, gfx909 and gfx90c. @item gfx9-4-generic Compile generic code for CDNA3 devices, executable on the following subset of @@ -22788,7 +22969,7 @@ Compile for RDNA2 gfx1036 devices (GFX10 series). @item gfx10-3-generic Compile generic code for GFX10-3 devices, executable on gfx1030, -gfx1031, gfx1032, gfx1033, gfx1034, gfx1035, and gfx1036. (Experimental) +gfx1031, gfx1032, gfx1033, gfx1034, gfx1035, and gfx1036. @item gfx1100 Compile for RDNA3 gfx1100 devices (GFX11 series). @@ -22816,7 +22997,7 @@ Compile for RDNA3 gfx1153 devices (GFX11 series). (Experimental) @item gfx11-generic Compile generic code for GFX11 devices, executable on gfx1100, gfx1101, -gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, and gfx1153. (Experimental) +gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, and gfx1153. @end table @opindex msram-ecc @@ -25023,6 +25204,10 @@ Valid values for @var{level} are in the range @code{0} @dots{} @code{23} which is a 3:2:2:2 mixed radix value. Each digit controls some aspect of the optimization. +@opindex mfuse-move2 +@item -mfuse-move2 +Run a post combine optimization pass that tries to fuse move instructions. + @opindex mstrict-X @item -mstrict-X Use address register @code{X} in a way proposed by the hardware. This means @@ -28409,6 +28594,14 @@ Whether a same-address load-load barrier (@code{dbar 0x700}) is needed. When build with @option{-march=la664}, it is enabled by default. The default is @option{-mno-ld-seq-sa}, the load-load barrier is needed. +@opindex mscq +@opindex mno-scq +@item -mscq +@item -mno-scq +Use (do not use) the 16-byte conditional store instruction @code{sc.q}. +The default is @option{-mscq} if the machine type specified with +@option{-march=} supports this instruction, @option{-mno-scq} otherwise. + @opindex mtls-dialect @item -mtls-dialect=@var{opt} This option controls which tls dialect may be used for general dynamic and @@ -31132,6 +31325,14 @@ instead of the @option{--relax} option. @item -mloop Allow (or do not allow) GCC to use the LOOP instruction. +@opindex mmul +@item -mmul +Allow (or do not allow) GCC to use the PRU multiplier unit. + +@opindex mfillzero +@item -mfillzero +Allow (or do not allow) GCC to use the FILL and ZERO instructions. + @opindex mabi @item -mabi=@var{variant} Specify the ABI variant to output code for. @option{-mabi=ti} selects the @@ -31242,7 +31443,7 @@ The default is @option{-misa-spec=20191213} unless GCC has been configured with @option{--with-isa-spec=} specifying a different default version. @opindex march -@item -march=@var{ISA-string|Profiles|Profile_ISA-string} +@item -march=@var{ISA-string|Profiles|Profile_ISA-string|help|unset} Generate code for given RISC-V ISA or Profiles or a combination of them (e.g.@: @samp{rv64im} @samp{rvi20u64} @samp{rvi20u64_zbb}). ISA strings and Profiles must be lower-case. Examples include @samp{rv64i}, @samp{rv32g}, @@ -31253,6 +31454,12 @@ at the beginning of the option, then use underline connect ISA-string (e.g.@: @option{help} (@option{-march=help}) is accepted to list all supported extensions. +@samp{-march=unset} causes the compiler to ignore any @samp{-march=@dots{}} options +that appear earlier on the command line, behaving as if the option was never +passed. This is useful for ensuring that the architecture is taken from the +@samp{-mcpu} option, and it will result in an error if no @samp{-mcpu} option +is given when @samp{-march=unset} is used. + The syntax of the ISA string is defined as follows: @table @code @@ -31283,31 +31490,14 @@ When the RISC-V specifications define an extension as depending on other extensions, GCC will implicitly add the dependent extensions to the enabled extension set if they weren't added explicitly. -@opindex mcpu -@item -mcpu=@var{processor-string} -Use architecture of and optimize the output for the given processor, specified -by particular CPU name. -Permissible values for this option are: @samp{mips-p8700}, @samp{sifive-e20}, -@samp{sifive-e21}, @samp{sifive-e24}, @samp{sifive-e31}, @samp{sifive-e34}, -@samp{sifive-e76}, @samp{sifive-s21}, @samp{sifive-s51}, @samp{sifive-s54}, -@samp{sifive-s76}, @samp{sifive-u54}, @samp{sifive-u74}, @samp{sifive-x280}, -@samp{sifive-xp450}, @samp{sifive-x670}, @samp{thead-c906}, @samp{tt-ascalon-d8}, -@samp{xiangshan-nanhu}, @samp{xiangshan-kunminghu}, @samp{xt-c908}, @samp{xt-c908v}, -@samp{xt-c910}, @samp{xt-c910v2}, @samp{xt-c920}, @samp{xt-c920v2}. +@include riscv-mcpu.texi Note that @option{-mcpu} does not override @option{-march} or @option{-mtune}. -@opindex mtune -@item -mtune=@var{processor-string} -Optimize the output for the given processor, specified by microarchitecture or -particular CPU name. Permissible values for this option are: -@samp{generic-ooo}, @samp{mips-p8700}, @samp{rocket}, @samp{sifive-3-series}, -@samp{sifive-5-series}, @samp{sifive-7-series}, @samp{size}, -@samp{sifive-p400-series}, @samp{sifive-p600-series}, and all valid options for -@option{-mcpu=}. +@include riscv-mtune.texi When @option{-mtune=} is not specified, use the setting from @option{-mcpu}, -the default is @samp{rocket} if both are not specified. +the default is @samp{generic} if both are not specified. The @samp{size} choice is not intended for use by end-users. This is used when @option{-Os} is specified. It overrides the instruction cost info @@ -34868,9 +35058,9 @@ Intel Panther Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, PCONFIG, PKU, -VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, UINTR, AVXIFMA, -AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3, SM4 and -PREFETCHI instruction set support. +VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, UINTR, AVXIFMA, AVXVNNIINT8, +AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3, SM4 and PREFETCHI +instruction set support. @item sapphirerapids @itemx emeraldrapids @@ -34973,9 +35163,9 @@ Intel Clearwater Forest CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, -LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, -ENQCMD, UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, -SHA512, SM3, SM4, USER_MSR and PREFETCHI instruction set support. +LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, ENQCMD, +UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, +SM3, SM4, USER_MSR and PREFETCHI instruction set support. @item k6 AMD K6 CPU with MMX instruction set support. @@ -37717,6 +37907,16 @@ compilation which is to be used as input to the next stage: for example, the output of the preprocessor, which is the input to the compiler proper. +@vindex GCC_DIAGNOSTICS_LOG +@item GCC_DIAGNOSTICS_LOG +If @env{GCC_DIAGNOSTICS_LOG} is set, then additional information +about the diagnostics subsystem will be emitted. If it is set to an empty +value, then the information will be written to stderr; otherwise, GCC will +attempt to open that file and write the information there. + +The precise content and format of the information is subject to change; +it is intended for use by GCC developers, rather than end-users. + @vindex GCC_COMPARE_DEBUG @item GCC_COMPARE_DEBUG Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing diff --git a/gcc/doc/libgdiagnostics/topics/compatibility.rst b/gcc/doc/libgdiagnostics/topics/compatibility.rst index 10adcc5..ccf1236 100644 --- a/gcc/doc/libgdiagnostics/topics/compatibility.rst +++ b/gcc/doc/libgdiagnostics/topics/compatibility.rst @@ -178,6 +178,8 @@ acccessing values within a :type:`diagnostic_logical_location`: * :func:`diagnostic_logical_location_get_decorated_name` +.. _LIBGDIAGNOSTICS_ABI_2: + ``LIBGDIAGNOSTICS_ABI_2`` ------------------------- ``LIBGDIAGNOSTICS_ABI_2`` covers the addition of these functions for @@ -186,3 +188,86 @@ supporting command-line options and SARIF playback: * :func:`diagnostic_manager_add_sink_from_spec` * :func:`diagnostic_manager_set_analysis_target` + +.. _LIBGDIAGNOSTICS_ABI_3: + +``LIBGDIAGNOSTICS_ABI_3`` +------------------------- + +``LIBGDIAGNOSTICS_ABI_3`` covers the addition of these functions for +working with directed graphs: + + * :func:`diagnostic_manager_new_graph` + + * :func:`diagnostic_manager_take_global_graph` + + * :func:`diagnostic_take_graph` + + * :func:`diagnostic_graph_release` + + * :func:`diagnostic_graph_set_description` + + * :func:`diagnostic_graph_add_node` + + * :func:`diagnostic_graph_add_edge` + + * :func:`diagnostic_graph_get_node_by_id` + + * :func:`diagnostic_graph_get_edge_by_id` + + * :func:`diagnostic_node_set_label` + + * :func:`diagnostic_node_set_location` + + * :func:`diagnostic_node_set_logical_location` + +.. _LIBGDIAGNOSTICS_ABI_4: + +``LIBGDIAGNOSTICS_ABI_4`` +------------------------- + +``LIBGDIAGNOSTICS_ABI_4`` covers the addition of these functions for +working with :type:`diagnostic_message_buffer`. + + * :func:`diagnostic_message_buffer_new` + + * :func:`diagnostic_message_buffer_release` + + * :func:`diagnostic_message_buffer_append_str` + + * :func:`diagnostic_message_buffer_append_text` + + * :func:`diagnostic_message_buffer_append_byte` + + * :func:`diagnostic_message_buffer_append_printf` + + * :func:`diagnostic_message_buffer_append_event_id` + + * :func:`diagnostic_message_buffer_begin_url` + + * :func:`diagnostic_message_buffer_end_url` + + * :func:`diagnostic_message_buffer_begin_quote` + + * :func:`diagnostic_message_buffer_end_quote` + + * :func:`diagnostic_message_buffer_begin_color` + + * :func:`diagnostic_message_buffer_end_color` + + * :func:`diagnostic_message_buffer_dump` + + * :func:`diagnostic_finish_via_msg_buf` + + * :func:`diagnostic_add_location_with_label_via_msg_buf` + + * :func:`diagnostic_execution_path_add_event_via_msg_buf` + +.. _LIBGDIAGNOSTICS_ABI_5: + +``LIBGDIAGNOSTICS_ABI_5`` +------------------------- + +``LIBGDIAGNOSTICS_ABI_5`` covers the addition of this function: + + * :func:`diagnostic_manager_set_debug_physical_locations` diff --git a/gcc/doc/libgdiagnostics/topics/diagnostic-manager.rst b/gcc/doc/libgdiagnostics/topics/diagnostic-manager.rst index 0390704..c94d19e 100644 --- a/gcc/doc/libgdiagnostics/topics/diagnostic-manager.rst +++ b/gcc/doc/libgdiagnostics/topics/diagnostic-manager.rst @@ -63,17 +63,17 @@ Responsibilities include: diagnostic_manager *control_mgr) This function can be used to support option processing similar to GCC's - :option:`-fdiagnostics-add-output=`. This allows command-line tools to - support the same domain-specific language for specifying output sink - as GCC does. - - The function will attempt to parse :param:`spec` as if it were - an argument to GCC's :option:`-fdiagnostics-add-output=OUTPUT-SPEC`. - If successful, it will add an output sink to :param:`affected_mgr` and return zero. - Otherwise, it will emit an error diagnostic to :param:`control_mgr` and + `-fdiagnostics-add-output= <https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-add-output>`_. + This allows command-line tools to support the same domain-specific + language for specifying output sinks as GCC does. + + The function will attempt to parse ``spec`` as if it were + an argument to GCC's `-fdiagnostics-add-output= <https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html#index-fdiagnostics-add-output>`_. + If successful, it will add an output sink to ``affected_mgr`` and return zero. + Otherwise, it will emit an error diagnostic to ``control_mgr`` and return non-zero. - :param:`affected_mgr` and :param:`control_mgr` can be the same manager, + ``affected_mgr`` and ``control_mgr`` can be the same manager, or be different managers. This function was added in :ref:`LIBGDIAGNOSTICS_ABI_2`; you can @@ -83,14 +83,14 @@ Responsibilities include: #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_manager_add_sink_from_spec - .. function:: void diagnostic_manager_set_analysis_target (diagnostic_manager *mgr, \ const diagnostic_file *file) - This function sets the "main input file" of :param:`mgr` to be - :param:`file`. + This function sets the "main input file" of ``mgr`` to be + ``file``. This affects the :code:`<title>` of generated HTML and - the :code:`role` of the artifact in SARIF output (SARIF v2.1.0 section 3.24.6). + the :code:`role` of the :code:`artifact` in SARIF output + (`SARIF v2.1.0 section 3.24.6 <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790867>`_). This function was added in :ref:`LIBGDIAGNOSTICS_ABI_2`; you can test for its presence using diff --git a/gcc/doc/libgdiagnostics/topics/diagnostics.rst b/gcc/doc/libgdiagnostics/topics/diagnostics.rst index 3d24da0..7454c6e 100644 --- a/gcc/doc/libgdiagnostics/topics/diagnostics.rst +++ b/gcc/doc/libgdiagnostics/topics/diagnostics.rst @@ -105,6 +105,24 @@ Diagnostics are All three parameters must be non-NULL. +.. function:: void diagnostic_finish_via_msg_buf (diagnostic *diag, \ + diagnostic_message_buffer *msg_buf) + + This is equivalent to :func:`diagnostic_finish`, but using a message + buffer rather than a format string and variadic arguments. + + ``diag`` and ``msg_buf`` must both be non-NULL. + + Calling this function transfers ownership of ``msg_buf`` to the + diagnostic - do not call :func:`diagnostic_message_buffer_release` on + it. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer Diagnostic groups ***************** diff --git a/gcc/doc/libgdiagnostics/topics/execution-paths.rst b/gcc/doc/libgdiagnostics/topics/execution-paths.rst index 321503f..8381c45 100644 --- a/gcc/doc/libgdiagnostics/topics/execution-paths.rst +++ b/gcc/doc/libgdiagnostics/topics/execution-paths.rst @@ -88,6 +88,28 @@ cross-references between events. In particular FIXME Equivalent to :func:`diagnostic_execution_path_add_event`, but using a :type:`va_list` rather than directly taking variadic arguments. +.. function:: diagnostic_event_id diagnostic_execution_path_add_event_via_msg_buf (diagnostic_execution_path *path, \ + const diagnostic_physical_location *physical_loc, \ + const diagnostic_logical_location *logical_loc, \ + unsigned stack_depth, + diagnostic_message_buffer *msg_buf) + + This is equivalent to :func:`diagnostic_execution_path_add_event` but + using a message buffer rather than a format string and variadic + arguments. + + ``path`` and ``msg_buf`` must both be non-NULL. + + Calling this function transfers ownership of ``msg_buf`` to the + path - do not call :func:`diagnostic_message_buffer_release` on it. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + Paths are printed to text sinks, and for SARIF sinks each path is added as a ``codeFlow`` object (see SARIF 2.1.0 `§3.36 codeFlow object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790990>`_). diff --git a/gcc/doc/libgdiagnostics/topics/graphs.rst b/gcc/doc/libgdiagnostics/topics/graphs.rst new file mode 100644 index 0000000..b976013 --- /dev/null +++ b/gcc/doc/libgdiagnostics/topics/graphs.rst @@ -0,0 +1,197 @@ +.. Copyright (C) 2025 Free Software Foundation, Inc. + Originally contributed by David Malcolm <dmalcolm@redhat.com> + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <https://www.gnu.org/licenses/>. + +.. default-domain:: c + +Graphs +====== + +.. type:: diagnostic_graph + +SARIF has support for capturing directed graphs (such as callgraphs +and control flow graphs), both at the level of the run as a whole, +and at the level of individual results. + +libgdiagnostics supports this with the following entrypoints, allowing +directed graphs to be + +* created (with :func:`diagnostic_manager_new_graph`) + +* reported "globally" (with :func:`diagnostic_manager_take_global_graph`) + +* reported as part of a :type:`diagnostic` (with :func:`diagnostic_take_graph`), or + +* discarded (with :func:`diagnostic_graph_release`). + +.. function:: diagnostic_graph * diagnostic_manager_new_graph (diagnostic_manager *manager) + + Create a new directed graph. + + The resulting graph is owned by the caller and must have one of + :func:`diagnostic_manager_take_global_graph`, + :func:`diagnostic_take_graph`, + or :func:`diagnostic_graph_release` called on it to avoid leaks. + + The parameter ``manager`` must be non-null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: void diagnostic_manager_take_global_graph (diagnostic_manager *manager, \ + diagnostic_graph *graph) + + Report this graph "globally", taking ownership of it. + This won't appear in text sinks, but in SARIF sinks the graph will be + added to theRun.graphs (SARIF v2.1.0 3.14.20). + + Parameters ``manager`` and ``graph`` must both be non-null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: void diagnostic_take_graph (diagnostic *diag, \ + diagnostic_graph *graph) + + Add this graph to ``diag``, transferring ownership of it to ``diag``. + This won't appear in text sinks, but in SARIF sinks the graph will be + added to theResult.graphs (SARIF v2.1.0 3.27.19). + + Parameters ``diag`` and ``graph`` must both be non-null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: void diagnostic_graph_release (diagnostic_graph *graph) + + Release ``graph`` which must still be owned by the caller + i.e. it must *not* have had + :func:`diagnostic_manager_take_global_graph` or + :func:`diagnostic_take_graph` called on it. + + Parameters ``graph`` can be null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + + +.. function:: void diagnostic_graph_set_description (diagnostic_graph *graph, \ + const char *description) + + Set the description of ``graph`` for use in the value of the + SARIF ``description`` property (SARIF v2.1.0 section 3.39.2). + + The parameter ``graph`` must be non-null. + The parameter ``description`` can be null, for clearing any existing + description. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: diagnostic_node * diagnostic_graph_add_node (diagnostic_graph *graph, \ + const char *node_id, \ + diagnostic_node *parent_node) + + Create and add a new node within ``graph`` with the given `id``. + The id must be unique within nodes in ``graph``. + + The parameters ``graph`` and ``id`` must be non-null. + + ``parent_node`` can be NULL (for a top-level node in the graph), + or non-null for a child node, allowing for arbitrary nesting of + nodes. + + The new node is owned by ``graph``. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: diagnostic_edge * diagnostic_graph_add_edge (diagnostic_graph *graph, \ + const char *edge_id, \ + diagnostic_node *src_node, \ + diagnostic_node *dst_node, \ + const char *label) + + Create and add a new edge within ``graph``. + + The parameters ``graph``, ``src_node`` and ``dest_node`` + must be non-null. + + If non-null, then ``edge_id`` must be unique within ``graph``; + if ``edge_id`` is null then a unique id of the form "edge0", "edge1", + etc will be used automatically. + + If non-null, then ``label`` will be used for the value of the + SARIF ``label`` property (SARIF v2.1.0 section 3.41.3). + + The new edge is owned by ``graph``. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: diagnostic_node *diagnostic_graph_get_node_by_id (diagnostic_graph *graph, \ + const char *node_id) + + Get the node in ``graph`` with the given id, or null. + + The parameters ``graph`` and ``node_id`` must be non-null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: diagnostic_edge *diagnostic_graph_get_edge_by_id (diagnostic_graph *graph, \ + const char *edge_id) + + Get the edge in ``graph`` with the given id, or null. + + The parameters ``graph`` and ``edge_id`` must be non-null. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + + +.. type:: diagnostic_node + +.. function:: void diagnostic_node_set_label (diagnostic_node *node, \ + const char *label) + + Set the label of ``node`` for use in the value of the + SARIF ``label`` property (SARIF v2.1.0 section 3.40.3). + + The parameter ``node`` must be non-null. + The parameter ``label`` can be null, for clearing any existing + label. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: void diagnostic_node_set_location (diagnostic_node *node, \ + const diagnostic_physical_location *loc) + + Set the physical location of ``node``, if any. + + The parameter ``node`` must be non-null. + The parameter ``loc`` can be null, for clearing any existing + location. + + If set, the value will be used by SARIF sinks within the + ``location`` property (SARIF v2.1.0 section 3.40.4). + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. + +.. function:: void diagnostic_node_set_logical_location (diagnostic_node *node, \ + const diagnostic_logical_location *logical_loc) + + Set the logical location of ``node``, if any. + + The parameter ``node`` must be non-null. + The parameter ``logical_loc`` _can be null, for clearing any existing + location. + + If set, the value will be used by SARIF sinks within the + ``location`` property (SARIF v2.1.0 section 3.40.4). + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`. diff --git a/gcc/doc/libgdiagnostics/topics/index.rst b/gcc/doc/libgdiagnostics/topics/index.rst index 6eb3ed6..437ee05 100644 --- a/gcc/doc/libgdiagnostics/topics/index.rst +++ b/gcc/doc/libgdiagnostics/topics/index.rst @@ -28,6 +28,7 @@ Topic reference diagnostic-manager.rst diagnostics.rst message-formatting.rst + message-buffers.rst physical-locations.rst logical-locations.rst metadata.rst @@ -35,5 +36,6 @@ Topic reference execution-paths.rst text-output.rst sarif.rst + graphs.rst ux.rst compatibility.rst diff --git a/gcc/doc/libgdiagnostics/topics/logical-locations.rst b/gcc/doc/libgdiagnostics/topics/logical-locations.rst index 184b563..294d396 100644 --- a/gcc/doc/libgdiagnostics/topics/logical-locations.rst +++ b/gcc/doc/libgdiagnostics/topics/logical-locations.rst @@ -120,7 +120,7 @@ source location "equal" input values on the same :type:`diagnostic_manager` will return the same instance of :type:`diagnostic_logical_location`. "Equal" here includes different string buffers that compare as equal with - :func:``strcmp`. + :func:`strcmp`. .. function:: void diagnostic_manager_debug_dump_logical_location (const diagnostic_manager *diag_mgr, \ const diagnostic_logical_location *loc, \ @@ -147,8 +147,9 @@ Accessors The following functions can be used to access the data that was passed to a :type:`diagnostic_logical_location` when it was created. In each case, the -``loc`` parameter must be non-NULL. :type:`const char *` values will point -at copies of the original buffer. +``loc`` parameter must be non-NULL. The return values will point +at *copies* of the original buffer owned by the +:type:`diagnostic_logical_location`, or be null. .. function:: enum diagnostic_logical_location_kind_t diagnostic_logical_location_get_kind (const diagnostic_logical_location *loc) diff --git a/gcc/doc/libgdiagnostics/topics/message-buffers.rst b/gcc/doc/libgdiagnostics/topics/message-buffers.rst new file mode 100644 index 0000000..c6f5851 --- /dev/null +++ b/gcc/doc/libgdiagnostics/topics/message-buffers.rst @@ -0,0 +1,310 @@ +.. Copyright (C) 2025 Free Software Foundation, Inc. + Originally contributed by David Malcolm <dmalcolm@redhat.com> + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <https://www.gnu.org/licenses/>. + +.. default-domain:: c + +Message buffers +=============== + +.. type:: diagnostic_message_buffer + +A :type:`diagnostic_message_buffer` is a buffer into which text can be +accumulated, before being used: + +* as the message of a diagnostic, using :func:`diagnostic_finish_via_msg_buf` + +* as the text of a label for a :type:`diagnostic_physical_location` using + :func:`diagnostic_add_location_with_label_via_msg_buf` + +* as the text of an event within a :type:`diagnostic_execution_path` using + :func:`diagnostic_execution_path_add_event_via_msg_buf` + +This is to allow more flexible creation of messages than a "format string +plus variadic arguments" API. + +.. function:: diagnostic_message_buffer * diagnostic_message_buffer_new (void) + + This function creates a new :type:`diagnostic_message_buffer`. + + The caller is responsible for cleaning it up, either by handing it off + to one of the API entrypoints that takes ownership of it (such as + :func:`diagnostic_finish_via_msg_buf`), or by calling + :func:`diagnostic_message_buffer_release` on it. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_release (diagnostic_message_buffer *msg_buf) + + This function releases ``msg_buf``. + + Typically you don't need to call this, but instead will pass the + buffer to one of the API entrypoints that takes over ownership of + it (such as :func:`diagnostic_finish_via_msg_buf`); calling it + after this would lead to a double-free bug, as you no longer "own" + the buffer. + + ``msg_buf`` must be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_append_str (diagnostic_message_buffer *msg_buf, \ + const char *p) + + This function appends the null-terminated string ``p`` to the buffer. + The string is assumed to be UTF-8 encoded. + + ``msg_buf`` and ``p`` must both be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_append_text (diagnostic_message_buffer *msg_buf, \ + const char *p, \ + size_t len) + + This function appends ``len`` bytes from ``p`` to the buffer. + The bytes are assumed to be UTF-8 encoded. + + ``msg_buf`` and ``p`` must both be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_append_byte (diagnostic_message_buffer *msg_buf,\ + char ch) + + This function appends ``ch`` to the buffer. This should be either + ASCII, or part of UTF-8 encoded text. + + ``msg_buf`` must be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_append_printf (diagnostic_message_buffer *msg_buf, \ + const char *fmt, ...) + + This function appends a formatted string to the buffer, using the + formatting rules for ``printf``. + + The string is assumed to be UTF-8 encoded. + + ``msg_buf`` and ``fmt`` must both be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_append_event_id (diagnostic_message_buffer *msg_buf, \ + diagnostic_event_id event_id) + + This function appends a :type:`diagnostic_event_id` to the buffer. + + ``msg_buf`` must be non-NULL. + + For text output, the event will be printed in the form ``(1)``. + + This is analogous to the + :doc:`%@ message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +Hyperlink support +***************** + +.. function:: void diagnostic_message_buffer_begin_url (diagnostic_message_buffer *msg_buf, \ + const char *url) + + This function indicates the beginning of a run of text that should be + associated with the given URL. The run of text should be closed with + a matching call to :func:`diagnostic_message_buffer_end_url`. + + ``msg_buf`` and ``url`` must both be non-NULL. + + For text output in a suitably modern terminal, the run of text will + be emitted as a clickable hyperlink to the URL. + + For SARIF sinks, the run of text will be emitted using SARIF's + embedded link syntax. + + This is analogous to the + :doc:`%{ message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_end_url (diagnostic_message_buffer *msg_buf) + + This function ends a run of text within the buffer started with + :func:`diagnostic_message_buffer_begin_url`. + + ``msg_buf`` must be non-NULL. + + This is analogous to the + :doc:`%} message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +Quoted text +*********** + +.. function:: void diagnostic_message_buffer_begin_quote (diagnostic_message_buffer *msg_buf) + + This function indicates the beginning of a run of text that should be + printed in quotes. The run of text should be closed with + a matching call to :func:`diagnostic_message_buffer_end_quote`. + + ``msg_buf`` must be non-NULL. + + For text output in a suitably modern terminal, the run of text will + appear in bold. + be emitted as a clickable hyperlink to the URL. + + For SARIF sinks, the run of text will be emitted using SARIF's + embedded link syntax. + + This is analogous to the + ``%<``:doc:`message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_end_url (diagnostic_message_buffer *msg_buf) + + This function ends a run of text within the buffer started with + :func:`diagnostic_message_buffer_begin_url`. + + ``msg_buf`` must be non-NULL. + + This is analogous to the + :doc:`%> message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +Color +***** + +.. function:: void diagnostic_message_buffer_begin_color (diagnostic_message_buffer *msg_buf, \ + const char *color) + + This function indicates the beginning of a run of text that should be + colorized as the given color. The run of text should be closed with + a matching call to :func:`diagnostic_message_buffer_end_color`. + + The precise set of available color names is currently undocumented. + + ``msg_buf`` and ``color`` must both be non-NULL. + + For text output in a suitable terminal, the run of text will + be colorized. + + For SARIF sinks, the run of text will be emitted using SARIF's + embedded link syntax. + + This is analogous to the + :doc:`%r message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_message_buffer_end_color (diagnostic_message_buffer *msg_buf) + + This function ends a run of text within the buffer started with + :func:`diagnostic_message_buffer_begin_color`. + + ``msg_buf`` must be non-NULL. + + This is analogous to the + :doc:`%R message formatting code <message-formatting>`. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +Debugging a message buffer +************************** + +.. function:: void diagnostic_message_buffer_dump (const diagnostic_message_buffer *msg_buf, \ + FILE *outf) + + This function writes a representation of the contents of ``msg_buf`` + to ``outf``, for debugging. + + ``msg_buf`` can be NULL or non-NULL. + ``outf`` must be non-NULL. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_4`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer diff --git a/gcc/doc/libgdiagnostics/topics/message-formatting.rst b/gcc/doc/libgdiagnostics/topics/message-formatting.rst index 7064b70..803feba 100644 --- a/gcc/doc/libgdiagnostics/topics/message-formatting.rst +++ b/gcc/doc/libgdiagnostics/topics/message-formatting.rst @@ -23,6 +23,11 @@ Message formatting Various libgdiagnostics entrypoints take a format string and variadic arguments. +.. note:: + + See also :type:`diagnostic_message_buffer`, which offers an + alternative way to build up messages. + The format strings take codes prefixed by ``%``, or ``%q`` to put the result in quotes. For example:: diff --git a/gcc/doc/libgdiagnostics/topics/physical-locations.rst b/gcc/doc/libgdiagnostics/topics/physical-locations.rst index 099e27e..fcd81a0 100644 --- a/gcc/doc/libgdiagnostics/topics/physical-locations.rst +++ b/gcc/doc/libgdiagnostics/topics/physical-locations.rst @@ -284,3 +284,39 @@ This diagnostic has three locations | ~~ ^ ~~~~~ | | | | int const char * + +.. function:: void diagnostic_add_location_with_label_via_msg_buf (diagnostic *diag, \ + const diagnostic_physical_location *loc, \ + diagnostic_message_buffer *msg_buf) + + This is equivalent to :func:`diagnostic_add_location_with_label` but + using a message buffer rather than a text string. + + ``diag`` and ``msg_buf`` must both be non-NULL. + + Calling this function transfers ownership of ``msg_buf`` to the + diagnostic - do not call :func:`diagnostic_message_buffer_release` on + it. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_3`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_message_buffer + +.. function:: void diagnostic_manager_set_debug_physical_locations (diagnostic_manager *mgr, \ + int value) + + Calling ``diagnostic_manager_set_debug_physical_locations (mgr, 1);`` + will lead to debugging information being printed to ``stderr`` when + creating :type:`diagnostic_physical_location` instances. + + The precise format of these messages is subject to change. + + This function was added in :ref:`LIBGDIAGNOSTICS_ABI_5`; you can + test for its presence using + + .. code-block:: c + + #ifdef LIBDIAGNOSTICS_HAVE_diagnostic_manager_set_debug_physical_locations diff --git a/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst b/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst index 95b95ca..e64b668 100644 --- a/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst +++ b/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst @@ -112,10 +112,10 @@ leading to output like this:: foo.c:17: error: can't find 'foo.h'" 17 | #include <foo.h> -where libgdiagnostics will attempt to load the source file and +where libgdiagnostics will attempt to load ``foo.c`` and quote the pertinent line. -If libgdiagnostics cannot open the file, it will merely print:: +If libgdiagnostics cannot open ``foo.c``, it will merely print:: foo.c:17: error: can't find 'foo.h' @@ -160,14 +160,15 @@ On compiling and running the program, we should get this output:: 17 | #include <foo.h> | ^~~~~ -where libgdiagnostics will attempt to load the source file and +where libgdiagnostics will attempt to load ``foo.c`` and underling the pertinent part of the given line. -If libgdiagnostics cannot open the file, it will merely print:: +If libgdiagnostics cannot open ``foo.c``, it will merely print:: foo.c:17:8: error: can't find 'foo.h' -A range can span multiple lines within the same file. +A range can span multiple lines within the same file, but cannot +span multiple files. As before, you can use :func:`diagnostic_manager_debug_dump_location` to dump the locations. For the above example:: diff --git a/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst b/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst index 0ac8bf0..9147171 100644 --- a/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst +++ b/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst @@ -134,8 +134,6 @@ Here's the above example in full: :end-before: end full example -Moving on -********* - -That's the end of the tutorial. For more information on libgdiagnostics, see -the :doc:`topic guide <../topics/index>`. +See the :doc:`guide to execution paths <../topics/execution-paths>` +for more information, or go on to +:doc:`the next section of the tutorial <08-message-buffers>`. diff --git a/gcc/doc/libgdiagnostics/tutorial/08-message-buffers.rst b/gcc/doc/libgdiagnostics/tutorial/08-message-buffers.rst new file mode 100644 index 0000000..a83c50c --- /dev/null +++ b/gcc/doc/libgdiagnostics/tutorial/08-message-buffers.rst @@ -0,0 +1,75 @@ +.. Copyright (C) 2025 Free Software Foundation, Inc. + Originally contributed by David Malcolm <dmalcolm@redhat.com> + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + <https://www.gnu.org/licenses/>. + +.. default-domain:: c + +Tutorial part 8: message buffers +================================ + +In previous examples, we finished a diagnostic with a call to +:func:`diagnostic_finish`, which takes a format string and arguments +to determine the text message of the diagnostic. + +Sometimes this approach is inconvenient, such as where you might want to +build up a message programatically from a series of components. +Additionally, you might have existing code that uses ``fprintf``, whereas +:func:`diagnostic_finish` has its +:doc:`own formatting conventions <../topics/message-formatting>` which are +:strong:`not` the same as printf. + +For this reason libgdiagnostics (from ``LIBGDIAGNOSTICS_ABI_3`` onwards) +supports :type:`diagnostic_message_buffer`, which can be used to accumulate a +message before using it. + +You create a :type:`diagnostic_message_buffer` using +:func:`diagnostic_message_buffer_new`. + +There are various API entrypoints for accumulating text into the buffer. + +For example: + +.. literalinclude:: ../../../testsuite/libgdiagnostics.dg/test-message-buffer.c + :language: c + :start-after: /* begin quoted source */ + :end-before: /* end quoted source */ + +Running this will produce this text output:: + +.. code-block:: console + + $ ./test-message-buffer.c.exe + ./test-message-buffer.c.exe: error: this is a string; foo; int: 42 str: mostly harmless; this is a link 'this is quoted' highlight A highlight B (1). + +where in a suitably-capable terminal if a text sink is directly +connected to a tty: + +* the ``this is a link`` will be a clickable hyperlink + (and the URL will be captured in SARIF output). + +* the quoted text will be in bold + +* the ``highlight A`` and ``highlight B`` text will be colorized + +* the event ID will be colorized (and will be a URL in SARIF output + if used within a :type:`diagnostic_execution_path`). + + +Moving on +********* + +That's the end of the tutorial. For more information on libgdiagnostics, see +the :doc:`topic guide <../topics/index>`. diff --git a/gcc/doc/libgdiagnostics/tutorial/index.rst b/gcc/doc/libgdiagnostics/tutorial/index.rst index 172a28c..09a15e9 100644 --- a/gcc/doc/libgdiagnostics/tutorial/index.rst +++ b/gcc/doc/libgdiagnostics/tutorial/index.rst @@ -30,3 +30,4 @@ The following tutorial gives an overview of how to use libgdiagnostics. 05-warnings.rst 06-fix-it-hints.rst 07-execution-paths.rst + 08-message-buffers.rst diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 28159b2..973c0dd 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -1366,6 +1366,12 @@ as for @samp{<} apply. A register operand is allowed provided that it is in a general register. +@cindex hard registers in constraint +@item @samp{@{r@}} +An operand is bound to hard register @samp{r} which may be any general, +floating-point, or vector register except a fixed register like a stack pointer +register. The set of fixed registers is target dependent. + @cindex constants in constraints @cindex @samp{i} in constraint @item @samp{i} @@ -8589,7 +8595,7 @@ If this pattern is not defined, a call to the library function @cindex @code{spaceship@var{m}4} instruction pattern @item @samp{spaceship@var{m}4} -Initialize output operand 0 with mode of integer type to -1, 0, 1 or 2 +Initialize output operand 0 with mode of integer type to -1, 0, 1 or -128 if operand 1 with mode @var{m} compares less than operand 2, equal to operand 2, greater than operand 2 or is unordered with operand 2. Operand 3 should be @code{const0_rtx} if the result is used in comparisons, @@ -8597,7 +8603,7 @@ Operand 3 should be @code{const0_rtx} if the result is used in comparisons, is integral unsigned, @code{constm1_rtx} if the result is used as integer value and the comparison is integral signed and some other @code{CONST_INT} if the result is used as integer value and the comparison is floating point. -In the last case, instead of setting output operand 0 to 2 for unordered, +In the last case, instead of setting output operand 0 to -128 for unordered, set it to operand 3. @var{m} should be a scalar floating point mode. @@ -8609,6 +8615,12 @@ Return 1 if operand 1 is a finite floating point number and 0 otherwise. @var{m} is a scalar floating point mode. Operand 0 has mode @code{SImode}, and operand 1 has mode @var{m}. +@cindex @code{isnan@var{m}2} instruction pattern +@item @samp{isnan@var{m}2} +Return 1 if operand 1 is a @code{NaN} and 0 otherwise. +@var{m} is a scalar floating point mode. Operand 0 +has mode @code{SImode}, and operand 1 has mode @var{m}. + @cindex @code{isnormal@var{m}2} instruction pattern @item @samp{isnormal@var{m}2} Return 1 if operand 1 is a normal floating point number and 0 diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi index b46b997..25cd2bc 100644 --- a/gcc/doc/options.texi +++ b/gcc/doc/options.texi @@ -529,6 +529,12 @@ code generation. @item Param This is an option that is a parameter. +@item NoOffload +This option will not be passed through from the host compiler to any offload +target compilers via the LTO mechanism. It is intended for use with +optimization tuning parameters where settings appropriate for the host system +are likely to harm the performance of the offload device. + @item Undocumented The option is deliberately missing documentation and should not be included in the @option{--help} output. diff --git a/gcc/doc/riscv-ext.texi b/gcc/doc/riscv-ext.texi index c3ed1bf..13056e7 100644 --- a/gcc/doc/riscv-ext.texi +++ b/gcc/doc/riscv-ext.texi @@ -714,4 +714,36 @@ @tab 1.0 @tab Ventana integer conditional operations extension +@item xmipscmov +@tab 1.0 +@tab Mips conditional move extension + +@item xmipscbop +@tab 1.0 +@tab Mips Prefetch extension + +@item xandesperf +@tab 5.0 +@tab Andes performace extension + +@item xandesbfhcvt +@tab 5.0 +@tab Andes bfloat16 conversion extension + +@item xandesvbfhcvt +@tab 5.0 +@tab Andes vector bfloat16 conversion extension + +@item xandesvsintload +@tab 5.0 +@tab Andes vector INT4 load extension + +@item xandesvpackfph +@tab 5.0 +@tab Andes vector packed FP16 extension + +@item xandesvdot +@tab 5.0 +@tab Andes vector dot product extension + @end multitable diff --git a/gcc/doc/riscv-mcpu.texi b/gcc/doc/riscv-mcpu.texi new file mode 100644 index 0000000..6753e51 --- /dev/null +++ b/gcc/doc/riscv-mcpu.texi @@ -0,0 +1,69 @@ +@c Copyright (C) 2025 Free Software Foundation, Inc. +@c This is part of the GCC manual. +@c For copying conditions, see the file gcc/doc/include/fdl.texi. + +@c This file is generated automatically using +@c gcc/config/riscv/gen-riscv-mcpu-texi.cc from: +@c gcc/config/riscv/riscv-cores.def + +@c Please *DO NOT* edit manually. + +@samp{Core Name} + +@opindex mcpu +@item -mcpu=@var{processor-string} +Use architecture of and optimize the output for the given processor, specified +by particular CPU name. Permissible values for this option are: + + +@samp{sifive-e20}, + +@samp{sifive-e21}, + +@samp{sifive-e24}, + +@samp{sifive-e31}, + +@samp{sifive-e34}, + +@samp{sifive-e76}, + +@samp{sifive-s21}, + +@samp{sifive-s51}, + +@samp{sifive-s54}, + +@samp{sifive-s76}, + +@samp{sifive-u54}, + +@samp{sifive-u74}, + +@samp{sifive-x280}, + +@samp{sifive-p450}, + +@samp{sifive-p670}, + +@samp{thead-c906}, + +@samp{xt-c908}, + +@samp{xt-c908v}, + +@samp{xt-c910}, + +@samp{xt-c910v2}, + +@samp{xt-c920}, + +@samp{xt-c920v2}, + +@samp{tt-ascalon-d8}, + +@samp{xiangshan-nanhu}, + +@samp{xiangshan-kunminghu}, + +@samp{mips-p8700}. diff --git a/gcc/doc/riscv-mtune.texi b/gcc/doc/riscv-mtune.texi new file mode 100644 index 0000000..a2a4d3e --- /dev/null +++ b/gcc/doc/riscv-mtune.texi @@ -0,0 +1,59 @@ +@c Copyright (C) 2025 Free Software Foundation, Inc. +@c This is part of the GCC manual. +@c For copying conditions, see the file gcc/doc/include/fdl.texi. + +@c This file is generated automatically using +@c gcc/config/riscv/gen-riscv-mtune-texi.cc from: +@c gcc/config/riscv/riscv-cores.def + +@c Please *DO NOT* edit manually. + +@samp{Tune Name} + +@opindex mtune +@item -mtune=@var{processor-string} +Optimize the output for the given processor, specified by microarchitecture or +particular CPU name. Permissible values for this option are: + + +@samp{generic}, + +@samp{rocket}, + +@samp{sifive-3-series}, + +@samp{sifive-5-series}, + +@samp{sifive-7-series}, + +@samp{sifive-p400-series}, + +@samp{sifive-p600-series}, + +@samp{tt-ascalon-d8}, + +@samp{thead-c906}, + +@samp{xt-c908}, + +@samp{xt-c908v}, + +@samp{xt-c910}, + +@samp{xt-c910v2}, + +@samp{xt-c920}, + +@samp{xt-c920v2}, + +@samp{xiangshan-nanhu}, + +@samp{xiangshan-kunminghu}, + +@samp{generic-ooo}, + +@samp{size}, + +@samp{mips-p8700}, + +and all valid options for @option{-mcpu=}. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 6c5586e..c001e8e 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 2002-2025 Free Software Foundation, Inc. +cc Copyright (C) 2002-2025 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -2373,6 +2373,15 @@ whether it does so by default). @itemx aarch64_sve1024_hw @itemx aarch64_sve2048_hw Like @code{aarch64_sve_hw}, but also test for an exact hardware vector length. +@item aarch64_sve2_hw +AArch64 target that is able to generate and execute SVE2 code (regardless of +whether it does so by default). +@item aarch64_sve2p1_hw +AArch64 target that is able to generate and execute SVE2.1 code (regardless of +whether it does so by default). +@item aarch64_sme_hw +AArch64 target that is able to generate and execute SME code (regardless of +whether it does so by default). @item aarch64_fjcvtzs_hw AArch64 target that is able to generate and execute armv8.3-a FJCVTZS @@ -2554,6 +2563,12 @@ Test system has an integer register width of 64 bits. @item riscv_a Test target architecture has support for the A extension. +@item riscv_b_ok +Test target architecture can execute code with B extension enabled. + +@item riscv_v_ok +Test target architecture can execute code with V extension enabled. + @item riscv_zaamo Test target architecture has support for the zaamo extension. diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index 0d765b1..c7c6f28 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -314,9 +314,8 @@ works with the Apple/NeXT Objective-C runtime library. There is no formal written standard for Objective-C or Objective-C++@. The authoritative manual on traditional Objective-C (1.0) is -``Object-Oriented Programming and the Objective-C Language'': -@uref{https://gnustep.github.io/@/resources/@/documentation/@/ObjectivCBook.pdf} -is the original NeXTstep document. +``Object-Oriented Programming and the Objective-C Language'' +(@uref{https://www.gnustep.org/@/resources/@/documentation/@/ObjectivCBook.pdf}). The Objective-C exception and synchronization syntax (that is, the keywords @code{@@try}, @code{@@throw}, @code{@@catch}, diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 5e30564..3764268 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -37,6 +37,8 @@ through the macros defined in the @file{.h} file. * Trampolines:: Code set up at run time to enter a nested function. * Library Calls:: Controlling how library routines are implicitly called. * Addressing Modes:: Defining addressing modes valid for memory operands. +* Vectorization:: Controlling how the vectorizer operates. +* OpenMP and OpenACC:: Defining how OpenMP and OpenACC features should work. * Anchored Addresses:: Defining how @option{-fsection-anchors} should work. * Condition Code:: Defining how insns update the condition code. * Costs:: Defining relative costs of different operations. @@ -1424,10 +1426,10 @@ the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT} @defmac MAX_FIXED_MODE_SIZE An integer expression for the size in bits of the largest integer -machine mode that should actually be used. All integer machine modes of -this size or smaller can be used for structures and unions with the -appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE -(DImode)} is assumed. +machine mode that should actually be used by GCC internally. +All integer machine modes of this size or smaller can be used for +structures and unions with the appropriate sizes. If this macro is +undefined, @code{MAX (BITS_PER_WORD * 2, 64)} is assumed. @end defmac @defmac STACK_SAVEAREA_MODE (@var{save_level}) @@ -6282,6 +6284,10 @@ reciprocal of the machine-specific builtin function @var{fndecl}, or @code{NULL_TREE} if such a function is not available. @end deftypefn +@node Vectorization +@section Vectorization +@cindex Vectorization + @deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void) This hook should return the DECL of a function @var{f} that given an address @var{addr} as an argument returns a mask @var{m} that can be @@ -6382,12 +6388,14 @@ return type of the vectorized function shall be of vector type @var{vec_type_out} and the argument types should be @var{vec_type_in}. @end deftypefn -@deftypefn {Target Hook} bool TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT (machine_mode @var{mode}, const_tree @var{type}, int @var{misalignment}, bool @var{is_packed}) +@deftypefn {Target Hook} bool TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT (machine_mode @var{mode}, const_tree @var{type}, int @var{misalignment}, bool @var{is_packed}, bool @var{is_gather_scatter}) This hook should return true if the target supports misaligned vector store/load of a specific factor denoted in the @var{misalignment} parameter. The vector store/load should be of machine mode @var{mode} and -the elements in the vectors should be of type @var{type}. @var{is_packed} -parameter is true if the memory access is defined in a packed struct. +the elements in the vectors should be of type @var{type}. The +@var{is_packed} parameter is true if the misalignment is unknown and the +memory access is defined in a packed struct. @var{is_gather_scatter} is true +if the load/store is a gather or scatter. @end deftypefn @deftypefn {Target Hook} machine_mode TARGET_VECTORIZE_PREFERRED_SIMD_MODE (scalar_mode @var{mode}) @@ -6511,6 +6519,19 @@ The default is @code{NULL_TREE} which means to not vectorize scatter stores. @end deftypefn +@deftypefn {Target Hook} bool TARGET_VECTORIZE_PREFER_GATHER_SCATTER (machine_mode @var{mode}, int @var{scale}, unsigned int @var{group_size}) +This hook returns TRUE if gather loads or scatter stores are cheaper on +this target than a sequence of elementwise loads or stores. The @var{mode} +and @var{scale} correspond to the @code{gather_load} and +@code{scatter_store} instruction patterns. The @var{group_size} is the +number of scalar elements in each scalar loop iteration that are to be +combined into the vector. +@end deftypefn + +@node OpenMP and OpenACC +@section OpenMP and OpenACC +@cindex OpenMP and OpenACC + @deftypefn {Target Hook} int TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN (struct cgraph_node *@var{}, struct cgraph_simd_clone *@var{}, @var{tree}, @var{int}, @var{bool}) This hook should set @var{vecsize_mangle}, @var{vecsize_int}, @var{vecsize_float} fields in @var{simd_clone} structure pointed by @var{clone_info} argument and also @@ -12860,7 +12881,7 @@ At preset, this feature does not support address spaces. It also requires @code{Pmode} to be the same as @code{ptr_mode}. @end deftypefn -@deftypefn {Target Hook} uint8_t TARGET_MEMTAG_TAG_SIZE () +@deftypefn {Target Hook} uint8_t TARGET_MEMTAG_TAG_BITSIZE () Return the size of a tag (in bits) for this platform. The default returns 8. diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index eccc4d8..c3ed9a9 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -37,6 +37,8 @@ through the macros defined in the @file{.h} file. * Trampolines:: Code set up at run time to enter a nested function. * Library Calls:: Controlling how library routines are implicitly called. * Addressing Modes:: Defining addressing modes valid for memory operands. +* Vectorization:: Controlling how the vectorizer operates. +* OpenMP and OpenACC:: Defining how OpenMP and OpenACC features should work. * Anchored Addresses:: Defining how @option{-fsection-anchors} should work. * Condition Code:: Defining how insns update the condition code. * Costs:: Defining relative costs of different operations. @@ -1251,10 +1253,10 @@ the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT} @defmac MAX_FIXED_MODE_SIZE An integer expression for the size in bits of the largest integer -machine mode that should actually be used. All integer machine modes of -this size or smaller can be used for structures and unions with the -appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE -(DImode)} is assumed. +machine mode that should actually be used by GCC internally. +All integer machine modes of this size or smaller can be used for +structures and unions with the appropriate sizes. If this macro is +undefined, @code{MAX (BITS_PER_WORD * 2, 64)} is assumed. @end defmac @defmac STACK_SAVEAREA_MODE (@var{save_level}) @@ -4273,6 +4275,10 @@ address; but often a machine-dependent strategy can generate better code. @hook TARGET_BUILTIN_RECIPROCAL +@node Vectorization +@section Vectorization +@cindex Vectorization + @hook TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD @hook TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST @@ -4311,6 +4317,12 @@ address; but often a machine-dependent strategy can generate better code. @hook TARGET_VECTORIZE_BUILTIN_SCATTER +@hook TARGET_VECTORIZE_PREFER_GATHER_SCATTER + +@node OpenMP and OpenACC +@section OpenMP and OpenACC +@cindex OpenMP and OpenACC + @hook TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN @hook TARGET_SIMD_CLONE_ADJUST @@ -8124,7 +8136,7 @@ maintainer is familiar with. @hook TARGET_MEMTAG_CAN_TAG_ADDRESSES -@hook TARGET_MEMTAG_TAG_SIZE +@hook TARGET_MEMTAG_TAG_BITSIZE @hook TARGET_MEMTAG_GRANULE_SIZE |