diff options
author | Martin Liska <mliska@suse.cz> | 2022-10-08 10:19:23 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-10-08 10:19:23 +0200 |
commit | d9e7934d25da4a78ffef1f738206aa1d897911df (patch) | |
tree | 1bd1697c14259e095f4b4790946eae7df0c5a2e3 /gcc/doc | |
parent | da0970e441345f8349522ff1abac5c223044ebb1 (diff) | |
parent | 6ffbf87ca66f4ed9cd79cff675fabe2109e46e85 (diff) | |
download | gcc-d9e7934d25da4a78ffef1f738206aa1d897911df.zip gcc-d9e7934d25da4a78ffef1f738206aa1d897911df.tar.gz gcc-d9e7934d25da4a78ffef1f738206aa1d897911df.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/analyzer.texi | 4 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 75 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 45 | ||||
-rw-r--r-- | gcc/doc/md.texi | 3 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 6 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 6 |
6 files changed, 117 insertions, 22 deletions
diff --git a/gcc/doc/analyzer.texi b/gcc/doc/analyzer.texi index 06eb98f..ec49f95 100644 --- a/gcc/doc/analyzer.texi +++ b/gcc/doc/analyzer.texi @@ -544,6 +544,10 @@ __analyzer_eval (expr); will emit a warning with text "TRUE", FALSE" or "UNKNOWN" based on the truthfulness of the argument. This is useful for writing DejaGnu tests. +@smallexample +__analyzer_get_unknown_ptr (); +@end smallexample +will obtain an unknown @code{void *}. @subsection Other Debugging Techniques diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 46eeb98..71a4c1b 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7454,6 +7454,32 @@ This warning can be disabled by @option{-Wno-if-not-aligned}. The @code{warn_if_not_aligned} attribute can also be used for types (@pxref{Common Type Attributes}.) +@cindex @code{strict_flex_array} variable attribute +@item strict_flex_array (@var{level}) +The @code{strict_flex_array} attribute should be attached to the trailing +array field of a structure. It controls when to treat the trailing array +field of a structure as a flexible array member for the purposes of accessing +the elements of such an array. +@var{level} must be an integer betwen 0 to 3. + +@var{level}=0 is the least strict level, all trailing arrays of structures +are treated as flexible array members. @var{level}=3 is the strictest level, +only when the trailing array is declared as a flexible array member per C99 +standard onwards (@samp{[]}), it is treated as a flexible array member. + +There are two more levels in between 0 and 3, which are provided to support +older codes that use GCC zero-length array extension (@samp{[0]}) or one-element +array as flexible array members (@samp{[1]}): +When @var{level} is 1, the trailing array is treated as a flexible array member +when it is declared as either @samp{[]}, @samp{[0]}, or @samp{[1]}; +When @var{level} is 2, the trailing array is treated as a flexible array member +when it is declared as either @samp{[]}, or @samp{[0]}. + +This attribute can be used with or without the @option{-fstrict-flex-arrays}. +When both the attribute and the option present at the same time, the level of +the strictness for the specific trailing array field is determined by the +attribute. + @item alloc_size (@var{position}) @itemx alloc_size (@var{position-1}, @var{position-2}) @cindex @code{alloc_size} variable attribute @@ -9182,6 +9208,20 @@ available for functions (@pxref{Function Attributes}), variables (@pxref{Variable Attributes}), labels (@pxref{Label Attributes}), enumerators (@pxref{Enumerator Attributes}), and for types (@pxref{Type Attributes}). +@table @code +@item fallthrough +@cindex @code{fallthrough} statement attribute +The @code{fallthrough} attribute with a null statement serves as a +fallthrough statement. It hints to the compiler that a statement +that falls through to another case label, or user-defined label +in a switch statement is intentional and thus the +@option{-Wimplicit-fallthrough} warning must not trigger. The +fallthrough attribute may appear at most once in each attribute +list, and may not be mixed with other attributes. It can only +be used in a switch statement (the compiler will issue an error +otherwise), after a preceding statement and before a logically +succeeding case label, or user-defined label. + This example uses the @code{fallthrough} statement attribute to indicate that the @option{-Wimplicit-fallthrough} warning should not be emitted: @@ -9196,19 +9236,28 @@ switch (cond) @} @end smallexample -@table @code -@item fallthrough -@cindex @code{fallthrough} statement attribute -The @code{fallthrough} attribute with a null statement serves as a -fallthrough statement. It hints to the compiler that a statement -that falls through to another case label, or user-defined label -in a switch statement is intentional and thus the -@option{-Wimplicit-fallthrough} warning must not trigger. The -fallthrough attribute may appear at most once in each attribute -list, and may not be mixed with other attributes. It can only -be used in a switch statement (the compiler will issue an error -otherwise), after a preceding statement and before a logically -succeeding case label, or user-defined label. +@item assume +@cindex @code{assume} statement attribute +The @code{assume} attribute with a null statement serves as portable +assumption. It should have a single argument, a conditional expression, +which is not evaluated. If the argument would evaluate to true +at the point where it appears, it has no effect, otherwise there +is undefined behavior. This is a GNU variant of the ISO C++23 +standard @code{assume} attribute, but it can be used in any version of +both C and C++. + +@smallexample +int +foo (int x, int y) +@{ + __attribute__((assume(x == 42))); + __attribute__((assume(++y == 43))); + return x + y; +@} +@end smallexample + +@code{y} is not actually incremented and the compiler can but does not +have to optimize it to just @code{return 42 + 42;}. @end table diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index cc9754b..3101021 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -169,7 +169,8 @@ in the following sections. -fopenmp -fopenmp-simd @gol -fpermitted-flt-eval-methods=@var{standard} @gol -fplan9-extensions -fsigned-bitfields -funsigned-bitfields @gol --fsigned-char -funsigned-char -fsso-struct=@var{endianness}} +-fsigned-char -funsigned-char -fstrict-flex-arrays[=@var{n}] @gol +-fsso-struct=@var{endianness}} @item C++ Language Options @xref{C++ Dialect Options,,Options Controlling C++ Dialect}. @@ -2496,7 +2497,10 @@ this switch. You may want to use the @option{-fno-gnu-keywords} flag instead, which disables @code{typeof} but not @code{asm} and @code{inline}. In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this switch only affects the @code{asm} and @code{typeof} keywords, -since @code{inline} is a standard keyword in ISO C99. +since @code{inline} is a standard keyword in ISO C99. In C2X mode +(@option{-std=c2x} or @option{-std=gnu2x}), this switch only affects +the @code{asm} keyword, since @code{typeof} is a standard keyword in +ISO C2X. @item -fno-builtin @itemx -fno-builtin-@var{function} @@ -2699,7 +2703,8 @@ can be omitted, to use a target-specific default value. @item -fopenmp @opindex fopenmp @cindex OpenMP parallel -Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and +Enable handling of OpenMP directives @code{#pragma omp} in C/C++, +@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ and @code{!$omp} in Fortran. When @option{-fopenmp} is specified, the compiler generates parallel code according to the OpenMP Application Program Interface v4.5 @w{@uref{https://www.openmp.org}}. This option @@ -2711,9 +2716,12 @@ have support for @option{-pthread}. @option{-fopenmp} implies @opindex fopenmp-simd @cindex OpenMP SIMD @cindex SIMD -Enable handling of OpenMP's SIMD directives with @code{#pragma omp} -in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives -are ignored. +Enable handling of OpenMP's @code{simd}, @code{declare simd}, +@code{declare reduction}, @code{assume}, @code{ordered}, @code{scan}, +@code{loop} directives and combined or composite directives with +@code{simd} as constituent with @code{#pragma omp} in C/C++, +@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ +and @code{!$omp} in Fortran. Other OpenMP directives are ignored. @item -fpermitted-flt-eval-methods=@var{style} @opindex fpermitted-flt-eval-methods @@ -2790,6 +2798,31 @@ The type @code{char} is always a distinct type from each of @code{signed char} or @code{unsigned char}, even though its behavior is always just like one of those two. +@item -fstrict-flex-arrays +@opindex fstrict-flex-arrays +@opindex fno-strict-flex-arrays +Control when to treat the trailing array of a structure as a flexible array +member for the purpose of accessing the elements of such an array. +The positive form is equivalent to @option{-fstrict-flex-arrays=3}, which is the +strictest. A trailing array is treated as a flexible array member only when it +is declared as a flexible array member per C99 standard onwards. +The negative form is equivalent to @option{-fstrict-flex-arrays=0}, which is the +least strict. All trailing arrays of structures are treated as flexible array +members. + +@item -fstrict-flex-arrays=@var{level} +@opindex fstrict-flex-arrays=@var{level} +Control when to treat the trailing array of a structure as a flexible array +member for the purpose of accessing the elements of such an array. The value +of @var{level} controls the level of strictness. + +The possible values of @var{level} are the same as for the +@code{strict_flex_array} attribute (@pxref{Variable Attributes}). + +You can control this behavior for a specific trailing array field of a +structure by using the variable attribute @code{strict_flex_array} attribute +(@pxref{Variable Attributes}). + @item -fsso-struct=@var{endianness} @opindex fsso-struct Set the default scalar storage order of structures and unions to the diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index bb42ee1..d0a71ecb 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -3267,9 +3267,6 @@ Like @code{b}, if @option{-mpowerpc64} is used; otherwise, @code{NO_REGS}. @item wB Signed 5-bit constant integer that can be loaded into an Altivec register. -@item wD -Int constant that is the element number of the 64-bit scalar in a vector. - @item wE Vector constant that can be loaded with the XXSPLTIB instruction. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 4f4f090..4ce7574 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3423,6 +3423,12 @@ someone decided it was a good idea to use that register number to terminate the stack backtrace. New ports should avoid this. @end defmac +@defmac DWARF_VERSION_DEFAULT +A C expression whose value is the default dwarf standard version we'll honor +and advertise when generating dwarf debug information, in absence of +an explicit @option{-gdwarf-@var{version}} option on the command line. +@end defmac + @deftypefn {Target Hook} void TARGET_DWARF_HANDLE_FRAME_UNSPEC (const char *@var{label}, rtx @var{pattern}, int @var{index}) @c hook-start:TARGET_DWARF_HANDLE_FRAME_UNSPEC This target hook allows the backend to emit frame-related insns that diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 21b849e..501ddf1 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -2575,6 +2575,12 @@ someone decided it was a good idea to use that register number to terminate the stack backtrace. New ports should avoid this. @end defmac +@defmac DWARF_VERSION_DEFAULT +A C expression whose value is the default dwarf standard version we'll honor +and advertise when generating dwarf debug information, in absence of +an explicit @option{-gdwarf-@var{version}} option on the command line. +@end defmac + @hook TARGET_DWARF_HANDLE_FRAME_UNSPEC @hook TARGET_DWARF_POLY_INDETERMINATE_VALUE |