aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-06-17 13:05:50 +0200
committerMartin Liska <mliska@suse.cz>2022-06-17 13:05:50 +0200
commit910ef4ff32f3a53dbd12445e1eb8c5349d047140 (patch)
treeef0772e400ad08ab2bef318992cc2c1bf6fb5b7e /gcc/doc
parentcad2e08f6c249937e10ad5ae0d4a117923979efb (diff)
parent94018fd2675190a4353cb199da4957538f070886 (diff)
downloadgcc-910ef4ff32f3a53dbd12445e1eb8c5349d047140.zip
gcc-910ef4ff32f3a53dbd12445e1eb8c5349d047140.tar.gz
gcc-910ef4ff32f3a53dbd12445e1eb8c5349d047140.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/avr-mmcu.texi6
-rw-r--r--gcc/doc/extend.texi23
-rw-r--r--gcc/doc/gcov-tool.texi36
-rw-r--r--gcc/doc/gcov.texi389
-rw-r--r--gcc/doc/install.texi122
-rw-r--r--gcc/doc/invoke.texi593
-rw-r--r--gcc/doc/match-and-simplify.texi36
-rw-r--r--gcc/doc/md.texi28
-rw-r--r--gcc/doc/options.texi11
-rw-r--r--gcc/doc/sourcebuild.texi55
-rw-r--r--gcc/doc/tm.texi25
11 files changed, 1156 insertions, 168 deletions
diff --git a/gcc/doc/avr-mmcu.texi b/gcc/doc/avr-mmcu.texi
index 8c09f08..c3e9817 100644
--- a/gcc/doc/avr-mmcu.texi
+++ b/gcc/doc/avr-mmcu.texi
@@ -50,15 +50,15 @@
@item 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}.
+@*@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}.
@item 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{attiny417}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}.
+@*@var{mcu}@tie{}= @code{attiny202}, @code{attiny204}, @code{attiny212}, @code{attiny214}, @code{attiny402}, @code{attiny404}, @code{attiny406}, @code{attiny412}, @code{attiny414}, @code{attiny416}, @code{attiny417}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}, @code{avr32da28}, @code{avr32da32}, @code{avr32da48}, @code{avr32db28}, @code{avr32db32}, @code{avr32db48}.
@item 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}.
+@*@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}.
@item 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/extend.texi b/gcc/doc/extend.texi
index ff81d33..38d943c 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2647,6 +2647,14 @@ The mode is intended to be used as a means to help validate the expected
object size, for example in functions that call @code{__builtin_object_size}.
@xref{Object Size Checking}.
+Note that the @code{access} attribute merely specifies how an object
+referenced by the pointer argument can be accessed; it does not imply that
+an access @strong{will} happen. Also, the @code{access} attribute does not
+imply the attribute @code{nonnull}; it may be appropriate to add both attributes
+at the declaration of a function that unconditionally manipulates a buffer via
+a pointer argument. See the @code{nonnull} attribute for more information and
+caveats.
+
@item alias ("@var{target}")
@cindex @code{alias} function attribute
The @code{alias} attribute causes the declaration to be emitted as an alias
@@ -13447,7 +13455,7 @@ There are also built-in versions of the ISO C99 functions
@code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf}, @code{floorl},
@code{fmodf}, @code{fmodl}, @code{frexpf}, @code{frexpl}, @code{ldexpf},
@code{ldexpl}, @code{log10f}, @code{log10l}, @code{logf}, @code{logl},
-@code{modfl}, @code{modf}, @code{powf}, @code{powl}, @code{sinf},
+@code{modfl}, @code{modff}, @code{powf}, @code{powl}, @code{sinf},
@code{sinhf}, @code{sinhl}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
@code{tanf}, @code{tanhf}, @code{tanhl} and @code{tanl}
that are recognized in any mode since ISO C90 reserves these names for
@@ -13512,7 +13520,7 @@ exceptions handling functions @code{fegetround}, @code{feclearexcept} and
@code{feraiseexcept}. They may not be available for all targets, and because
they need close interaction with libc internal values, they may not be available
for all target libcs, but in all cases they will gracefully fallback to libc
-calls. This built-in functions appear both with and without the
+calls. These built-in functions appear both with and without the
@code{__builtin_} prefix.
@deftypefn {Built-in Function} void *__builtin_alloca (size_t size)
@@ -21827,6 +21835,9 @@ Intel Knights Landing CPU.
@item knm
Intel Knights Mill CPU.
+@item lujiazui
+ZHAOXIN lujiazui CPU.
+
@item amdfam10h
AMD Family 10h CPU.
@@ -25139,7 +25150,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified)
@item __has_trivial_assign (type)
If @code{type} is @code{const}- qualified or is a reference type then
-the trait is @code{false}. Otherwise if @code{__is_pod (type)} is
+the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is
@code{true} then the trait is @code{true}, else if @code{type} is
a cv-qualified class or union type with a trivial copy assignment
([class.copy]) then the trait is @code{true}, else it is @code{false}.
@@ -25147,7 +25158,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified)
@code{void}, or an array of unknown bound.
@item __has_trivial_copy (type)
-If @code{__is_pod (type)} is @code{true} or @code{type} is a reference
+If @code{__is_trivial (type)} is @code{true} or @code{type} is a reference
type then the trait is @code{true}, else if @code{type} is a cv class
or union type with a trivial copy constructor ([class.copy]) then the trait
is @code{true}, else it is @code{false}. Requires: @code{type} shall be
@@ -25155,7 +25166,7 @@ a complete type, (possibly cv-qualified) @code{void}, or an array of unknown
bound.
@item __has_trivial_constructor (type)
-If @code{__is_pod (type)} is @code{true} then the trait is @code{true},
+If @code{__is_trivial (type)} is @code{true} then the trait is @code{true},
else if @code{type} is a cv-qualified class or union type (or array thereof)
with a trivial default constructor ([class.ctor]) then the trait is @code{true},
else it is @code{false}.
@@ -25163,7 +25174,7 @@ Requires: @code{type} shall be a complete type, (possibly cv-qualified)
@code{void}, or an array of unknown bound.
@item __has_trivial_destructor (type)
-If @code{__is_pod (type)} is @code{true} or @code{type} is a reference type
+If @code{__is_trivial (type)} is @code{true} or @code{type} is a reference type
then the trait is @code{true}, else if @code{type} is a cv class or union
type (or array thereof) with a trivial destructor ([class.dtor]) then
the trait is @code{true}, else it is @code{false}.
diff --git a/gcc/doc/gcov-tool.texi b/gcc/doc/gcov-tool.texi
index 5da5c9b..7f39379 100644
--- a/gcc/doc/gcov-tool.texi
+++ b/gcc/doc/gcov-tool.texi
@@ -27,6 +27,10 @@ Current gcov-tool supports the following functionalities:
merge two sets of profiles with weights.
@item
+read a stream of profiles with associated filenames and merge it with a set of
+profiles with weights.
+
+@item
read one set of profile and rewrite profile contents. One can scale or
normalize the count values.
@end itemize
@@ -39,6 +43,12 @@ them. One can specify the weight to factor in the relative importance of
each input.
@item
+Collect profiles from target systems without a filesystem (freestanding
+environments). Merge the collected profiles with associated profiles
+present on the host system. One can specify the weight to factor in the
+relative importance of each input.
+
+@item
Rewrite the profile after removing a subset of the gcda files, while maintaining
the consistency of the summary and the histogram.
@@ -89,6 +99,10 @@ gcov-tool merge [merge-options] @var{directory1} @var{directory2}
[@option{-v}|@option{--verbose}]
[@option{-w}|@option{--weight} @var{w1,w2}]
+gcov-tool merge-stream [merge-stream-options] [@var{file}]
+ [@option{-v}|@option{--verbose}]
+ [@option{-w}|@option{--weight} @var{w1,w2}]
+
gcov-tool rewrite [rewrite-options] @var{directory}
[@option{-n}|@option{--normalize} @var{long_long_value}]
[@option{-o}|@option{--output} @var{directory}]
@@ -135,6 +149,28 @@ Set the merge weights of the @var{directory1} and @var{directory2},
respectively. The default weights are 1 for both.
@end table
+@item merge-stream
+Collect profiles with associated filenames from a @emph{gcfn} and @emph{gcda}
+data stream. Read the stream from the file specified by @var{file} or from
+@file{stdin}. Merge the profiles with associated profiles in the host
+filesystem. Apply the optional weights while merging profiles.
+
+For the generation of a @emph{gcfn} and @emph{gcda} data stream on the target
+system, please have a look at the @code{__gcov_filename_to_gcfn()} and
+@code{__gcov_info_to_gcda()} functions declared in @code{#include <gcov.h>}.
+@table @gcctabopt
+
+@item -v
+@itemx --verbose
+Set the verbose mode.
+
+@item -w @var{w1},@var{w2}
+@itemx --weight @var{w1},@var{w2}
+Set the merge weights of the profiles from the @emph{gcfn} and @emph{gcda} data
+stream and the associated profiles in the host filesystem, respectively. The
+default weights are 1 for both.
+@end table
+
@item rewrite
Read the specified profile directory and rewrite to a new directory.
@table @gcctabopt
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 3d90bf9..b405534 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -14,6 +14,8 @@ test code coverage in your programs.
* Gcov and Optimization:: Using gcov with GCC optimization.
* Gcov Data Files:: The files used by gcov.
* Cross-profiling:: Data file relocation.
+* Freestanding Environments:: How to use profiling and test
+ coverage in freestanding environments.
@end menu
@node Gcov Intro
@@ -936,3 +938,390 @@ setting will name the data file @file{/target/run/build/foo.gcda}.
You must move the data files to the expected directory tree in order to
use them for profile directed optimizations (@option{-fprofile-use}), or to
use the @command{gcov} tool.
+
+@node Freestanding Environments
+@section Profiling and Test Coverage in Freestanding Environments
+
+In case your application runs in a hosted environment such as GNU/Linux, then
+this section is likely not relevant to you. This section is intended for
+application developers targeting freestanding environments (for example
+embedded systems) with limited resources. In particular, systems or test cases
+which do not support constructors/destructors or the C library file I/O. In
+this section, the @dfn{target system} runs your application instrumented for
+profiling or test coverage. You develop and analyze your application on the
+@dfn{host system}. We now provide an overview how profiling and test coverage
+can be obtained in this scenario followed by a tutorial which can be exercised
+on the host system. Finally, some system initialization caveats are listed.
+
+@subsection Overview
+
+For an application instrumented for profiling or test coverage, the compiler
+generates some global data structures which are updated by instrumentation code
+while the application runs. These data structures are called the @dfn{gcov
+information}. Normally, when the application exits, the gcov information is
+stored to @file{.gcda} files. There is one file per translation unit
+instrumented for profiling or test coverage. The function
+@code{__gcov_exit()}, which stores the gcov information to a file, is called by
+a global destructor function for each translation unit instrumented for
+profiling or test coverage. It runs at process exit. In a global constructor
+function, the @code{__gcov_init()} function is called to register the gcov
+information of a translation unit in a global list. In some situations, this
+procedure does not work. Firstly, if you want to profile the global
+constructor or exit processing of an operating system, the compiler generated
+functions may conflict with the test objectives. Secondly, you may want to
+test early parts of the system initialization or abnormal program behaviour
+which do not allow a global constructor or exit processing. Thirdly, you need
+a filesystem to store the files.
+
+The @option{-fprofile-info-section} GCC option enables you to use profiling and
+test coverage in freestanding environments. This option disables the use of
+global constructors and destructors for the gcov information. Instead, a
+pointer to the gcov information is stored in a special linker input section for
+each translation unit which is compiled with this option. By default, the
+section name is @code{.gcov_info}. The gcov information is statically
+initialized. The pointers to the gcov information from all translation units
+of an executable can be collected by the linker in a contiguous memory block.
+For the GNU linker, the below linker script output section definition can be
+used to achieve this:
+
+@smallexample
+ .gcov_info :
+ @{
+ PROVIDE (__gcov_info_start = .);
+ KEEP (*(.gcov_info))
+ PROVIDE (__gcov_info_end = .);
+ @}
+@end smallexample
+
+The linker will provide two global symbols, @code{__gcov_info_start} and
+@code{__gcov_info_end}, which define the start and end of the array of pointers
+to gcov information blocks, respectively. The @code{KEEP ()} directive is
+required to prevent a garbage collection of the pointers. They are not
+directly referenced by anything in the executable. The section may be placed
+in a read-only memory area.
+
+In order to transfer the profiling and test coverage data from the target to
+the host system, the application has to provide a function to produce a
+reliable in order byte stream from the target to the host. The byte stream may
+be compressed and encoded using error detection and correction codes to meet
+application-specific requirements. The GCC provided @file{libgcov} target
+library provides two functions, @code{__gcov_info_to_gcda()} and
+@code{__gcov_filename_to_gcfn()}, to generate a byte stream from a gcov
+information bock. The functions are declared in @code{#include <gcov.h>}. The
+byte stream can be deserialized by the @command{merge-stream} subcommand of the
+@command{gcov-tool} to create or update @file{.gcda} files in the host
+filesystem for the instrumented application.
+
+@subsection Tutorial
+
+This tutorial should be exercised on the host system. We will build a program
+instrumented for test coverage. The program runs an application and dumps the
+gcov information to @file{stderr} encoded as a printable character stream. The
+application simply decodes such character streams from @file{stdin} and writes
+the decoded character stream to @file{stdout} (warning: this is binary data).
+The decoded character stream is consumed by the @command{merge-stream}
+subcommand of the @command{gcov-tool} to create or update the @file{.gcda}
+files.
+
+To get started, create an empty directory. Change into the new directory.
+Then you will create the following three files in this directory
+
+@enumerate
+@item
+@file{app.h} - a header file included by @file{app.c} and @file{main.c},
+
+@item
+@file{app.c} - a source file which contains an example application, and
+
+@item
+@file{main.c} - a source file which contains the program main function and code
+to dump the gcov information.
+@end enumerate
+
+Firstly, create the header file @file{app.h} with the following content:
+
+@smallexample
+static const unsigned char a = 'a';
+
+static inline unsigned char *
+encode (unsigned char c, unsigned char buf[2])
+@{
+ buf[0] = c % 16 + a;
+ buf[1] = (c / 16) % 16 + a;
+ return buf;
+@}
+
+extern void application (void);
+@end smallexample
+
+Secondly, create the source file @file{app.c} with the following content:
+
+@smallexample
+#include "app.h"
+
+#include <stdio.h>
+
+/* The application reads a character stream encoded by encode() from stdin,
+ decodes it, and writes the decoded characters to stdout. Characters other
+ than the 16 characters 'a' to 'p' are ignored. */
+
+static int can_decode (unsigned char c)
+@{
+ return (unsigned char)(c - a) < 16;
+@}
+
+void
+application (void)
+@{
+ int first = 1;
+ int i;
+ unsigned char c;
+
+ while ((i = fgetc (stdin)) != EOF)
+ @{
+ unsigned char x = (unsigned char)i;
+
+ if (can_decode (x))
+ @{
+ if (first)
+ c = x - a;
+ else
+ fputc (c + 16 * (x - a), stdout);
+ first = !first;
+ @}
+ else
+ first = 1;
+ @}
+@}
+@end smallexample
+
+Thirdly, create the source file @file{main.c} with the following content:
+
+@smallexample
+#include "app.h"
+
+#include <gcov.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* The start and end symbols are provided by the linker script. We use the
+ array notation to avoid issues with a potential small-data area. */
+
+extern const struct gcov_info *const __gcov_info_start[];
+extern const struct gcov_info *const __gcov_info_end[];
+
+/* This function shall produce a reliable in order byte stream to transfer the
+ gcov information from the target to the host system. */
+
+static void
+dump (const void *d, unsigned n, void *arg)
+@{
+ (void)arg;
+ const unsigned char *c = d;
+ unsigned char buf[2];
+
+ for (unsigned i = 0; i < n; ++i)
+ fwrite (encode (c[i], buf), sizeof (buf), 1, stderr);
+@}
+
+/* The filename is serialized to a gcfn data stream by the
+ __gcov_filename_to_gcfn() function. The gcfn data is used by the
+ "merge-stream" subcommand of the "gcov-tool" to figure out the filename
+ associated with the gcov information. */
+
+static void
+filename (const char *f, void *arg)
+@{
+ __gcov_filename_to_gcfn (f, dump, arg);
+@}
+
+/* The __gcov_info_to_gcda() function may have to allocate memory under
+ certain conditions. Simply try it out if it is needed for your application
+ or not. */
+
+static void *
+allocate (unsigned length, void *arg)
+@{
+ (void)arg;
+ return malloc (length);
+@}
+
+/* Dump the gcov information of all translation units. */
+
+static void
+dump_gcov_info (void)
+@{
+ const struct gcov_info *const *info = __gcov_info_start;
+ const struct gcov_info *const *end = __gcov_info_end;
+
+ /* Obfuscate variable to prevent compiler optimizations. */
+ __asm__ ("" : "+r" (info));
+
+ while (info != end)
+ @{
+ void *arg = NULL;
+ __gcov_info_to_gcda (*info, filename, dump, allocate, arg);
+ fputc ('\n', stderr);
+ ++info;
+ @}
+@}
+
+/* The main() function just runs the application and then dumps the gcov
+ information to stderr. */
+
+int
+main (void)
+@{
+ application ();
+ dump_gcov_info ();
+ return 0;
+@}
+@end smallexample
+
+If we compile @file{app.c} with test coverage and no extra profiling options,
+then a global constructor (@code{_sub_I_00100_0} here, it may have a different
+name in your environment) and destructor (@code{_sub_D_00100_1}) is used to
+register and dump the gcov information, respectively. We also see undefined
+references to @code{__gcov_init} and @code{__gcov_exit}:
+
+@smallexample
+$ gcc --coverage -c app.c
+$ nm app.o
+0000000000000000 r a
+0000000000000030 T application
+0000000000000000 t can_decode
+ U fgetc
+ U fputc
+0000000000000000 b __gcov0.application
+0000000000000038 b __gcov0.can_decode
+0000000000000000 d __gcov_.application
+00000000000000c0 d __gcov_.can_decode
+ U __gcov_exit
+ U __gcov_init
+ U __gcov_merge_add
+ U stdin
+ U stdout
+0000000000000161 t _sub_D_00100_1
+0000000000000151 t _sub_I_00100_0
+@end smallexample
+
+Compile @file{app.c} and @file{main.c} with test coverage and
+@option{-fprofile-info-section}. Now, a read-only pointer size object is
+present in the @code{.gcov_info} section and there are no undefined references
+to @code{__gcov_init} and @code{__gcov_exit}:
+
+@smallexample
+$ gcc --coverage -fprofile-info-section -c main.c
+$ gcc --coverage -fprofile-info-section -c app.c
+$ objdump -h app.o
+
+app.o: file format elf64-x86-64
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .text 00000151 0000000000000000 0000000000000000 00000040 2**0
+ CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
+ 1 .data 00000100 0000000000000000 0000000000000000 000001a0 2**5
+ CONTENTS, ALLOC, LOAD, RELOC, DATA
+ 2 .bss 00000040 0000000000000000 0000000000000000 000002a0 2**5
+ ALLOC
+ 3 .rodata 0000003c 0000000000000000 0000000000000000 000002a0 2**3
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 4 .gcov_info 00000008 0000000000000000 0000000000000000 000002e0 2**3
+ CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
+ 5 .comment 0000004e 0000000000000000 0000000000000000 000002e8 2**0
+ CONTENTS, READONLY
+ 6 .note.GNU-stack 00000000 0000000000000000 0000000000000000 00000336 2**0
+ CONTENTS, READONLY
+ 7 .eh_frame 00000058 0000000000000000 0000000000000000 00000338 2**3
+ CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
+@end smallexample
+
+We have to customize the program link procedure so that all the
+@code{.gcov_info} linker input sections are placed in a contiguous memory block
+with a begin and end symbol. Firstly, get the default linker script using the
+following commands (we assume a GNU linker):
+
+@smallexample
+$ ld --verbose | sed '1,/^===/d' | sed '/^===/d' > linkcmds
+@end smallexample
+
+Secondly, open the file @file{linkcmds} with a text editor and place the linker
+output section definition from the overview after the @code{.rodata} section
+definition. Link the program executable using the customized linker script:
+
+@smallexample
+$ gcc --coverage main.o app.o -T linkcmds -Wl,-Map,app.map
+@end smallexample
+
+In the linker map file @file{app.map}, we see that the linker placed the
+read-only pointer size objects of our objects files @file{main.o} and
+@file{app.o} into a contiguous memory block and provided the symbols
+@code{__gcov_info_start} and @code{__gcov_info_end}:
+
+@smallexample
+$ grep -C 1 "\.gcov_info" app.map
+
+.gcov_info 0x0000000000403ac0 0x10
+ 0x0000000000403ac0 PROVIDE (__gcov_info_start = .)
+ *(.gcov_info)
+ .gcov_info 0x0000000000403ac0 0x8 main.o
+ .gcov_info 0x0000000000403ac8 0x8 app.o
+ 0x0000000000403ad0 PROVIDE (__gcov_info_end = .)
+@end smallexample
+
+Make sure no @file{.gcda} files are present. Run the program with nothing to
+decode and dump @file{stderr} to the file @file{gcda-0.txt} (first run). Run
+the program to decode @file{gcda-0.txt} and send it to the @command{gcov-tool}
+using the @command{merge-stream} subcommand to create the @file{.gcda} files
+(second run). Run @command{gcov} to produce a report for @file{app.c}. We see
+that the first run with nothing to decode results in a partially covered
+application:
+
+@smallexample
+$ rm -f app.gcda main.gcda
+$ echo "" | ./a.out 2>gcda-0.txt
+$ ./a.out <gcda-0.txt 2>gcda-1.txt | gcov-tool merge-stream
+$ gcov -bc app.c
+File 'app.c'
+Lines executed:69.23% of 13
+Branches executed:66.67% of 6
+Taken at least once:50.00% of 6
+Calls executed:66.67% of 3
+Creating 'app.c.gcov'
+
+Lines executed:69.23% of 13
+@end smallexample
+
+Run the program to decode @file{gcda-1.txt} and send it to the
+@command{gcov-tool} using the @command{merge-stream} subcommand to update the
+@file{.gcda} files. Run @command{gcov} to produce a report for @file{app.c}.
+Since the second run decoded the gcov information of the first run, we have now
+a fully covered application:
+
+@smallexample
+$ ./a.out <gcda-1.txt 2>gcda-2.txt | gcov-tool merge-stream
+$ gcov -bc app.c
+File 'app.c'
+Lines executed:100.00% of 13
+Branches executed:100.00% of 6
+Taken at least once:100.00% of 6
+Calls executed:100.00% of 3
+Creating 'app.c.gcov'
+
+Lines executed:100.00% of 13
+@end smallexample
+
+@subsection System Initialization Caveats
+
+The gcov information of a translation unit consists of several global data
+structures. For example, the instrumented code may update program flow graph
+edge counters in a zero-initialized data structure. It is safe to run
+instrumented code before the zero-initialized data is cleared to zero. The
+coverage information obtained before the zero-initialized data is cleared to
+zero is unusable. Dumping the gcov information using
+@code{__gcov_info_to_gcda()} before the zero-initialized data is cleared to
+zero or the initialized data is loaded, is undefined behaviour. Clearing the
+zero-initialized data to zero through a function instrumented for profiling or
+test coverage is undefined behaviour, since it may produce inconsistent program
+flow graph edge counters for example.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 40198f3..0a17e9f 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -284,7 +284,8 @@ section.
@item @anchor{GDC-prerequisite}GDC
In order to build GDC, the D compiler, you need a working GDC
-compiler (GCC version 9.1 or later), as the D front end is written in D.
+compiler (GCC version 9.1 or later) and D runtime library,
+@samp{libphobos}, as the D front end is written in D.
Versions of GDC prior to 12 can be built with an ISO C++11 compiler, which can
then be installed and used to bootstrap newer versions of the D front end.
@@ -300,6 +301,10 @@ front end does not make use of any GDC-specific extensions, or novel features
of the D language, if too old a GDC version is installed and
@option{--enable-languages=d} is used, the build will fail.
+On some targets, @samp{libphobos} isn't enabled by default, but compiles
+and works if @option{--enable-libphobos} is used. Specifics are
+documented for affected targets.
+
@item A ``working'' POSIX compatible shell, or GNU bash
Necessary when running @command{configure} because some
@@ -739,9 +744,9 @@ Here are the possible CPU types:
@quotation
aarch64, aarch64_be, alpha, alpha64, amdgcn, arc, arceb, arm, armeb, avr, bfin,
bpf, cr16, cris, csky, epiphany, fido, fr30, frv, ft32, h8300, hppa, hppa2.0,
-hppa64, i486, i686, ia64, iq2000, lm32, m32c, m32r, m32rle, m68k, mcore,
-microblaze, microblazeel, mips, mips64, mips64el, mips64octeon, mips64orion,
-mips64vr, mipsel, mipsisa32, mipsisa32r2, mipsisa64, mipsisa64r2,
+hppa64, i486, i686, ia64, iq2000, lm32, loongarch64, m32c, m32r, m32rle, m68k,
+mcore, microblaze, microblazeel, mips, mips64, mips64el, mips64octeon,
+mips64orion, mips64vr, mipsel, mipsisa32, mipsisa32r2, mipsisa64, mipsisa64r2,
mipsisa64r2el, mipsisa64sb1, mipsisa64sr71k, mipstx39, mmix, mn10300, moxie,
msp430, nds32be, nds32le, nios2, nvptx, or1k, pdp11, powerpc, powerpc64,
powerpc64le, powerpcle, pru, riscv32, riscv32be, riscv64, riscv64be, rl78, rx,
@@ -1152,8 +1157,9 @@ sysv, aix.
@itemx --without-multilib-list
Specify what multilibs to build. @var{list} is a comma separated list of
values, possibly consisting of a single value. Currently only implemented
-for aarch64*-*-*, arm*-*-*, riscv*-*-*, sh*-*-* and x86-64-*-linux*. The
-accepted values and meaning for each target is given below.
+for aarch64*-*-*, arm*-*-*, loongarch64-*-*, riscv*-*-*, sh*-*-* and
+x86-64-*-linux*. The accepted values and meaning for each target is given
+below.
@table @code
@item aarch64*-*-*
@@ -1234,6 +1240,14 @@ profile. The union of these options is considered when specifying both
@code{-mfloat-abi=hard}
@end multitable
+@item loongarch*-*-*
+@var{list} is a comma-separated list of the following ABI identifiers:
+@code{lp64d[/base]} @code{lp64f[/base]} @code{lp64d[/base]}, where the
+@code{/base} suffix may be omitted, to enable their respective run-time
+libraries. If @var{list} is empty or @code{default},
+or if @option{--with-multilib-list} is not specified, then the default ABI
+as specified by @option{--with-abi} or implied by @option{--target} is selected.
+
@item riscv*-*-*
@var{list} is a single ABI name. The target architecture must be either
@code{rv32gc} or @code{rv64gc}. This will build a single multilib for the
@@ -2087,17 +2101,6 @@ Until all of the libraries are converted to use IEEE 128-bit floating
point, it is not recommended to use
@option{--with-long-double-format=ieee}.
-On little endian PowerPC Linux systems, if you explicitly set the
-@code{long double} type, it will build multilibs to allow you to
-select either @code{long double} format, unless you disable multilibs
-with the @code{--disable-multilib} option. At present,
-@code{long double} multilibs are not built on big endian PowerPC Linux
-systems. If you are building multilibs, you will need to configure
-the compiler using the @option{--with-system-zlib} option.
-
-If you do not set the @code{long double} type explicitly, no multilibs
-will be generated.
-
@item --enable-fdpic
On SH Linux systems, generate ELF FDPIC code.
@@ -2288,18 +2291,6 @@ those are in separate optional packages and where the presence or absence
of those optional packages should determine the actual supported offloading
target set rather than the GCC configure-time selection.
-@item --with-hsa-runtime=@var{pathname}
-@itemx --with-hsa-runtime-include=@var{pathname}
-@itemx --with-hsa-runtime-lib=@var{pathname}
-
-If you configure GCC with offloading which uses an HSA run-time such as
-AMDGCN but do not have the HSA run-time library installed in a standard
-location then you can explicitly specify the directory where they are
-installed. The @option{--with-hsa-runtime=@/@var{hsainstalldir}} option
-is a shorthand for
-@option{--with-hsa-runtime-lib=@/@var{hsainstalldir}/lib} and
-@option{--with-hsa-runtime-include=@/@var{hsainstalldir}/include}.
-
@item --enable-cet
@itemx --disable-cet
Enable building target run-time libraries with control-flow
@@ -2330,6 +2321,21 @@ For a native build and cross compiles that have target headers, the option's
default is derived from glibc's behavior. When glibc clamps float_t to double,
GCC follows and enables the option. For other cross compiles, the default is
disabled.
+
+@item --with-zstd=@var{pathname}
+@itemx --with-zstd-include=@var{pathname}
+@itemx --with-zstd-lib=@var{pathname}
+If you do not have the @code{zstd} library installed in a standard
+location and you want to build GCC, you can explicitly specify the
+directory where it is installed (@samp{--with-zstd=@/@var{zstdinstalldir}}).
+The @option{--with-zstd=@/@var{zstdinstalldir}} option is shorthand for
+@option{--with-zstd-lib=@/@var{zstdinstalldir}/lib} and
+@option{--with-zstd-include=@/@var{zstdinstalldir}/include}. If this
+shorthand assumption is not correct, you can use the explicit
+include and lib options directly.
+
+These flags are applicable to the host platform only. When building
+a cross compiler, they will not be used to configure target libraries.
@end table
@subheading Cross-Compiler-Specific Options
@@ -3854,8 +3860,8 @@ configure GCC@ for building a CR16 uclinux cross-compiler.
@end html
@anchor{cris}
@heading CRIS
-CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
-series. These are used in embedded applications.
+CRIS is a CPU architecture in Axis Communications systems-on-a-chip, for
+example the ETRAX series. These are used in embedded applications.
@ifnothtml
@xref{CRIS Options,, CRIS Options, gcc, Using the GNU Compiler
@@ -3866,21 +3872,8 @@ See ``CRIS Options'' in the main manual
@end ifhtml
for a list of CRIS-specific options.
-There are a few different CRIS targets:
-@table @code
-@item cris-axis-elf
-Mainly for monolithic embedded systems. Includes a multilib for the
-@samp{v10} core used in @samp{ETRAX 100 LX}.
-@item cris-axis-linux-gnu
-A GNU/Linux port for the CRIS architecture, currently targeting
-@samp{ETRAX 100 LX} by default.
-@end table
-
-Pre-packaged tools can be obtained from
-@uref{ftp://ftp.axis.com/@/pub/@/axis/@/tools/@/cris/@/compiler-kit/}. More
-information about this platform is available at
-@uref{http://developer.axis.com/}.
-
+Use @samp{configure --target=cris-elf} to configure GCC@ for building
+a cross-compiler for CRIS.
@html
<hr />
@end html
@@ -4404,6 +4397,34 @@ This configuration is intended for embedded systems running uClinux.
@html
<hr />
@end html
+@anchor{loongarch}
+@heading LoongArch
+LoongArch processor.
+The following LoongArch targets are available:
+@table @code
+@item loongarch64-linux-gnu*
+LoongArch processor running GNU/Linux. This target triplet may be coupled
+with a small set of possible suffixes to identify their default ABI type:
+@table @code
+@item f64
+Uses @code{lp64d/base} ABI by default.
+@item f32
+Uses @code{lp64f/base} ABI by default.
+@item sf
+Uses @code{lp64s/base} ABI by default.
+@end table
+
+@item loongarch64-linux-gnu
+Same as @code{loongarch64-linux-gnuf64}, but may be used with
+@option{--with-abi=*} to configure the default ABI type.
+@end table
+
+More information about LoongArch can be found at
+@uref{https://github.com/loongson/LoongArch-Documentation}.
+
+@html
+<hr />
+@end html
@anchor{m32c-x-elf}
@heading m32c-*-elf
Renesas M32C processor.
@@ -4813,6 +4834,12 @@ GNU binutils. @samp{libstdc++} symbol versioning will be disabled if no
appropriate version is found. Solaris @command{c++filt} from the Solaris
Studio compilers does @emph{not} work.
+In order to build the GNU D compiler, GDC, a working @samp{libphobos} is
+needed. That library wasn't built by default in GCC 9--11 on SPARC, or
+on x86 when the Solaris assembler is used, but can be enabled by
+configuring with @option{--enable-libphobos}. Also, GDC 9.4.0 is
+required on x86, while GDC 9.3.0 is known to work on SPARC.
+
The versions of the GNU Multiple Precision Library (GMP), the MPFR
library and the MPC library bundled with Solaris 11.3 and later are
usually recent enough to match GCC's requirements. There are two
@@ -4826,6 +4853,7 @@ need to configure with @option{--with-gmp-include=/usr/include/gmp}.
@item
The version of the MPFR libary included in Solaris 11.3 is too old; you
need to provide a more recent one.
+
@end itemize
@html
@@ -5066,7 +5094,7 @@ the Win32 subsystem that provides a subset of POSIX.
@subheading Intel 64-bit versions
GCC contains support for x86-64 using the mingw-w64
-runtime library, available from @uref{https://mingw-w64.org/doku.php}.
+runtime library, available from @uref{https://www.mingw-w64.org/downloads/}.
This library should be used with the target triple x86_64-pc-mingw32.
@subheading Windows CE
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d89f264f..b09ef0e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -264,7 +264,7 @@ Objective-C and Objective-C++ Dialects}.
-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]} @gol
-fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]} @gol
-fdiagnostics-urls=@r{[}auto@r{|}never@r{|}always@r{]} @gol
--fdiagnostics-format=@r{[}text@r{|}json@r{]} @gol
+-fdiagnostics-format=@r{[}text@r{|}sarif-stderr@r{|}sarif-file@r{|}json@r{|}json-stderr@r{|}json-file@r{]} @gol
-fno-diagnostics-show-option -fno-diagnostics-show-caret @gol
-fno-diagnostics-show-labels -fno-diagnostics-show-line-numbers @gol
-fno-diagnostics-show-cwe @gol
@@ -312,6 +312,7 @@ Objective-C and Objective-C++ Dialects}.
-Wno-div-by-zero -Wdouble-promotion @gol
-Wduplicated-branches -Wduplicated-cond @gol
-Wempty-body -Wno-endif-labels -Wenum-compare -Wenum-conversion @gol
+-Wenum-int-mismatch @gol
-Werror -Werror=* -Wexpansion-to-defined -Wfatal-errors @gol
-Wfloat-conversion -Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-contains-nul -Wno-format-extra-args @gol
@@ -384,14 +385,14 @@ Objective-C and Objective-C++ Dialects}.
-fanalyzer-checker=@var{name} @gol
-fno-analyzer-feasibility @gol
-fanalyzer-fine-grained @gol
--fanalyzer-state-merge @gol
--fanalyzer-state-purge @gol
+-fno-analyzer-state-merge @gol
+-fno-analyzer-state-purge @gol
-fanalyzer-transitivity @gol
+-fno-analyzer-undo-inlining @gol
-fanalyzer-verbose-edges @gol
-fanalyzer-verbose-state-changes @gol
-fanalyzer-verbosity=@var{level} @gol
-fdump-analyzer @gol
--fdump-analyzer-stderr @gol
-fdump-analyzer-callgraph @gol
-fdump-analyzer-exploded-graph @gol
-fdump-analyzer-exploded-nodes @gol
@@ -401,7 +402,9 @@ Objective-C and Objective-C++ Dialects}.
-fdump-analyzer-feasibility @gol
-fdump-analyzer-json @gol
-fdump-analyzer-state-purge @gol
+-fdump-analyzer-stderr @gol
-fdump-analyzer-supergraph @gol
+-fdump-analyzer-untracked @gol
-Wno-analyzer-double-fclose @gol
-Wno-analyzer-double-free @gol
-Wno-analyzer-exposure-through-output-file @gol
@@ -426,6 +429,10 @@ Objective-C and Objective-C++ Dialects}.
-Wno-analyzer-use-after-free @gol
-Wno-analyzer-use-of-pointer-in-stale-stack-frame @gol
-Wno-analyzer-use-of-uninitialized-value @gol
+-Wno-analyzer-va-arg-type-mismatch @gol
+-Wno-analyzer-va-list-exhausted @gol
+-Wno-analyzer-va-list-leak @gol
+-Wno-analyzer-va-list-use-after-va-end @gol
-Wno-analyzer-write-to-const @gol
-Wno-analyzer-write-to-string-literal @gol
}
@@ -575,7 +582,7 @@ Objective-C and Objective-C++ Dialects}.
-fno-stack-limit -fsplit-stack @gol
-fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
-fvtv-counts -fvtv-debug @gol
--finstrument-functions @gol
+-finstrument-functions -finstrument-functions-once @gol
-finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
-finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}} @gol
-fprofile-prefix-map=@var{old}=@var{new}
@@ -816,12 +823,12 @@ Objective-C and Objective-C++ Dialects}.
-msim -msdata=@var{sdata-type}}
@emph{CRIS Options}
-@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
--mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol
+@gccoptlist{-mcpu=@var{cpu} -march=@var{cpu}
+-mtune=@var{cpu} -mmax-stack-frame=@var{n} @gol
-metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol
-mstack-align -mdata-align -mconst-align @gol
--m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol
--melf -maout -melinux -mlinux -sim -sim2 @gol
+-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue @gol
+-melf -maout -sim -sim2 @gol
-mmul-bug-workaround -mno-mul-bug-workaround}
@emph{CR16 Options}
@@ -958,6 +965,16 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
-msign-extend-enabled -muser-enabled}
+@emph{LoongArch Options}
+@gccoptlist{-march=@var{cpu-type} -mtune=@var{cpu-type} -mabi=@var{base-abi-type} @gol
+-mfpu=@var{fpu-type} -msoft-float -msingle-float -mdouble-float @gol
+-mbranch-cost=@var{n} -mcheck-zero-division -mno-check-zero-division @gol
+-mcond-move-int -mno-cond-move-int @gol
+-mcond-move-float -mno-cond-move-float @gol
+-memcpy -mno-memcpy -mstrict-align -mno-strict-align @gol
+-mmax-inline-memcpy-size=@var{n} @gol
+-mcmodel=@var{code-model}}
+
@emph{M32R/D Options}
@gccoptlist{-m32r2 -m32rx -m32r @gol
-mdebug @gol
@@ -1372,7 +1389,8 @@ See RS/6000 and PowerPC Options.
-msse4a -m3dnow -m3dnowa -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop @gol
-madx -mlzcnt -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mhle -mlwp @gol
-mmwaitx -mclzero -mpku -mthreads -mgfni -mvaes -mwaitpkg @gol
--mshstk -mmanual-endbr -mforce-indirect-call -mavx512vbmi2 -mavx512bf16 -menqcmd @gol
+-mshstk -mmanual-endbr -mcet-switch -mforce-indirect-call @gol
+-mavx512vbmi2 -mavx512bf16 -menqcmd @gol
-mvpclmulqdq -mavx512bitalg -mmovdiri -mmovdir64b -mavx512vpopcntdq @gol
-mavx5124fmaps -mavx512vnni -mavx5124vnniw -mprfchw -mrdpid @gol
-mrdseed -msgx -mavx512vp2intersect -mserialize -mtsxldtrk@gol
@@ -1419,7 +1437,8 @@ See RS/6000 and PowerPC Options.
-mauto-litpools -mno-auto-litpools @gol
-mtarget-align -mno-target-align @gol
-mlongcalls -mno-longcalls @gol
--mabi=@var{abi-type}}
+-mabi=@var{abi-type} @gol
+-mextra-l32r-costs=@var{cycles}}
@emph{zSeries Options}
See S/390 and zSeries Options.
@@ -3087,6 +3106,16 @@ On targets that support symbol aliases, the default is
@option{-fextern-tls-init}. On targets that do not support symbol
aliases, the default is @option{-fno-extern-tls-init}.
+@item -ffold-simple-inlines
+@itemx -fno-fold-simple-inlines
+@opindex ffold-simple-inlines
+@opindex fno-fold-simple-inlines
+Permit the C++ frontend to fold calls to @code{std::move}, @code{std::forward},
+@code{std::addressof} and @code{std::as_const}. In contrast to inlining, this
+means no debug information will be generated for such calls. Since these
+functions are rarely interesting to debug, this flag is enabled by default
+unless @option{-fno-inline} is active.
+
@item -fno-gnu-keywords
@opindex fno-gnu-keywords
@opindex fgnu-keywords
@@ -4787,7 +4816,7 @@ The default @env{GCC_COLORS} is
error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
quote=01:path=01;36:fixit-insert=32:fixit-delete=31:\
diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\
-type-diff=01;32
+type-diff=01;32:fnname=01;32:targs=35
@end smallexample
@noindent
where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
@@ -4832,6 +4861,14 @@ SGR substring for location information, @samp{file:line} or
@vindex quote GCC_COLORS @r{capability}
SGR substring for information printed within quotes.
+@item fnname=
+@vindex fnname GCC_COLORS @r{capability}
+SGR substring for names of C++ functions.
+
+@item targs=
+@vindex targs GCC_COLORS @r{capability}
+SGR substring for C++ function template parameter bindings.
+
@item fixit-insert=
@vindex fixit-insert GCC_COLORS @r{capability}
SGR substring for fix-it hints suggesting text to
@@ -5161,7 +5198,10 @@ This option provides additional information when printing control-flow paths
associated with a diagnostic.
If this is option is provided then the stack depth will be printed for
-each run of events within @option{-fdiagnostics-path-format=separate-events}.
+each run of events within @option{-fdiagnostics-path-format=inline-events}.
+If provided with @option{-fdiagnostics-path-format=separate-events}, then
+the stack depth and function declaration will be appended when printing
+each event.
This is intended for use by GCC developers and plugin developers when
debugging diagnostics that report interprocedural control flow.
@@ -5233,14 +5273,23 @@ Unicode characters. For the example above, the following will be printed:
@item -fdiagnostics-format=@var{FORMAT}
@opindex fdiagnostics-format
Select a different format for printing diagnostics.
-@var{FORMAT} is @samp{text} or @samp{json}.
+@var{FORMAT} is @samp{text}, @samp{sarif-stderr}, @samp{sarif-file},
+@samp{json}, @samp{json-stderr}, or @samp{json-file}.
+
The default is @samp{text}.
-The @samp{json} format consists of a top-level JSON array containing JSON
-objects representing the diagnostics.
+The @samp{sarif-stderr} and @samp{sarif-file} formats both emit
+diagnostics in SARIF Version 2.1.0 format, either to stderr, or to a file
+named @file{@var{source}.sarif}, respectively.
+
+The @samp{json} format is a synonym for @samp{json-stderr}.
+The @samp{json-stderr} and @samp{json-file} formats are identical, apart from
+where the JSON is emitted to - with the former, the JSON is emitted to stderr,
+whereas with @samp{json-file} it is written to @file{@var{source}.gcc.json}.
-The JSON is emitted as one line, without formatting; the examples below
-have been formatted for clarity.
+The emitted JSON consists of a top-level JSON array containing JSON objects
+representing the diagnostics. The JSON is emitted as one line, without
+formatting; the examples below have been formatted for clarity.
Diagnostics can have child diagnostics. For example, this error and note:
@@ -5689,6 +5738,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wdangling-pointer=2 @gol
-Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
-Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
+-Wenum-int-mismatch @r{(C and Objective-C only)} @gol
-Wformat @gol
-Wformat-overflow @gol
-Wformat-truncation @gol
@@ -8665,6 +8715,25 @@ Warn when a value of enumerated type is implicitly converted to a
different enumerated type. This warning is enabled by @option{-Wextra}
in C@.
+@item -Wenum-int-mismatch @r{(C and Objective-C only)}
+@opindex Wenum-int-mismatch
+@opindex Wno-enum-int-mismatch
+Warn about mismatches between an enumerated type and an integer type in
+declarations. For example:
+
+@smallexample
+enum E @{ l = -1, z = 0, g = 1 @};
+int foo(void);
+enum E foo(void);
+@end smallexample
+
+In C, an enumerated type is compatible with @code{char}, a signed
+integer type, or an unsigned integer type. However, since the choice
+of the underlying type of an enumerated type is implementation-defined,
+such mismatches may cause portability issues. In C++, such mismatches
+are an error. In C, this warning is enabled by @option{-Wall} and
+@option{-Wc++-compat}.
+
@item -Wjump-misses-init @r{(C, Objective-C only)}
@opindex Wjump-misses-init
@opindex Wno-jump-misses-init
@@ -8800,7 +8869,7 @@ such as in
void f (void);
void g (void)
@{
- if (!func) // warning: expression evaluates to false
+ if (!f) // warning: expression evaluates to false
abort ();
@}
@end smallexample
@@ -8826,7 +8895,7 @@ weak symbols), so their use in a conditional might indicate missing
parentheses in a function call or a missing dereference in an array
expression. The subset of the warning for object pointers can be
suppressed by casting the pointer operand to an integer type such
-as @code{inptr_t} or @code{uinptr_t}.
+as @code{intptr_t} or @code{uintptr_t}.
Comparisons against string literals result in unspecified behavior
and are not portable, and suggest the intent was to call @code{strcmp}.
The warning is suppressed if the suspicious expression is the result
@@ -9612,25 +9681,31 @@ Enabling this option effectively enables the following warnings:
-Wanalyzer-free-of-non-heap @gol
-Wanalyzer-malloc-leak @gol
-Wanalyzer-mismatching-deallocation @gol
--Wanalyzer-possible-null-argument @gol
--Wanalyzer-possible-null-dereference @gol
-Wanalyzer-null-argument @gol
-Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
-Wanalyzer-shift-count-negative @gol
-Wanalyzer-shift-count-overflow @gol
-Wanalyzer-stale-setjmp-buffer @gol
--Wanalyzer-tainted-allocation-size @gol
--Wanalyzer-tainted-array-index @gol
--Wanalyzer-tainted-divisor @gol
--Wanalyzer-tainted-offset @gol
--Wanalyzer-tainted-size @gol
-Wanalyzer-unsafe-call-within-signal-handler @gol
-Wanalyzer-use-after-free @gol
--Wanalyzer-use-of-uninitialized-value @gol
-Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
+-Wanalyzer-use-of-uninitialized-value @gol
+-Wanalyzer-va-arg-type-mismatch @gol
+-Wanalyzer-va-list-exhausted @gol
+-Wanalyzer-va-list-leak @gol
+-Wanalyzer-va-list-use-after-va-end @gol
-Wanalyzer-write-to-const @gol
-Wanalyzer-write-to-string-literal @gol
}
+@ignore
+-Wanalyzer-tainted-allocation-size @gol
+-Wanalyzer-tainted-array-index @gol
+-Wanalyzer-tainted-divisor @gol
+-Wanalyzer-tainted-offset @gol
+-Wanalyzer-tainted-size @gol
+@end ignore
This option is only available if GCC was configured with analyzer
support enabled.
@@ -9903,6 +9978,53 @@ to disable it.
This diagnostic warns for paths through the code in which a pointer
is dereferenced that points to a variable in a stale stack frame.
+@item -Wno-analyzer-va-arg-type-mismatch
+@opindex Wanalyzer-va-arg-type-mismatch
+@opindex Wno-analyzer-va-arg-type-mismatch
+This warning requires @option{-fanalyzer}, which enables it; use
+@option{-Wno-analyzer-va-arg-type-mismatch}
+to disable it.
+
+This diagnostic warns for interprocedural paths through the code for which
+the analyzer detects an attempt to use @code{va_arg} to extract a value
+passed to a variadic call, but uses a type that does not match that of
+the expression passed to the call.
+
+@item -Wno-analyzer-va-list-exhausted
+@opindex Wanalyzer-va-list-exhausted
+@opindex Wno-analyzer-va-list-exhausted
+This warning requires @option{-fanalyzer}, which enables it; use
+@option{-Wno-analyzer-va-list-exhausted}
+to disable it.
+
+This diagnostic warns for interprocedural paths through the code for which
+the analyzer detects an attempt to use @code{va_arg} to access the next
+value passed to a variadic call, but all of the values in the
+@code{va_list} have already been consumed.
+
+@item -Wno-analyzer-va-list-leak
+@opindex Wanalyzer-va-list-leak
+@opindex Wno-analyzer-va-list-leak
+This warning requires @option{-fanalyzer}, which enables it; use
+@option{-Wno-analyzer-va-list-leak}
+to disable it.
+
+This diagnostic warns for interprocedural paths through the code for which
+the analyzer detects that @code{va_start} or @code{va_copy} has been called
+on a @code{va_list} without a corresponding call to @code{va_end}.
+
+@item -Wno-analyzer-va-list-use-after-va-end
+@opindex Wanalyzer-va-list-use-after-va-end
+@opindex Wno-analyzer-va-list-use-after-va-end
+This warning requires @option{-fanalyzer}, which enables it; use
+@option{-Wno-analyzer-va-list-use-after-va-end}
+to disable it.
+
+This diagnostic warns for interprocedural paths through the code for which
+the analyzer detects an attempt to use a @code{va_list} after
+@code{va_end} has been called on it.
+@code{va_list}.
+
@item -Wno-analyzer-write-to-const
@opindex Wanalyzer-write-to-const
@opindex Wno-analyzer-write-to-const
@@ -9968,6 +10090,27 @@ such as the @code{taint} checker that implements
@option{-Wanalyzer-tainted-array-index}, and this option is required
to enable them.
+@emph{Note:} currently, @option{-fanalyzer-checker=taint} disables the
+following warnings from @option{-fanalyzer}:
+
+@gccoptlist{ @gol
+-Wanalyzer-double-fclose @gol
+-Wanalyzer-double-free @gol
+-Wanalyzer-exposure-through-output-file @gol
+-Wanalyzer-file-leak @gol
+-Wanalyzer-free-of-non-heap @gol
+-Wanalyzer-malloc-leak @gol
+-Wanalyzer-mismatching-deallocation @gol
+-Wanalyzer-null-argument @gol
+-Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
+-Wanalyzer-unsafe-call-within-signal-handler @gol
+-Wanalyzer-use-after-free @gol
+-Wanalyzer-va-list-leak @gol
+-Wanalyzer-va-list-use-after-va-end @gol
+}
+
@item -fno-analyzer-feasibility
@opindex fanalyzer-feasibility
@opindex fno-analyzer-feasibility
@@ -10027,6 +10170,25 @@ be suppressed, for debugging state-handling issues.
@opindex fno-analyzer-transitivity
This option enables transitivity of constraints within the analyzer.
+@item -fno-analyzer-undo-inlining
+@opindex fanalyzer-undo-inlining
+@opindex fno-analyzer-undo-inlining
+This option is intended for analyzer developers.
+
+@option{-fanalyzer} runs relatively late compared to other code analysis
+tools, and some optimizations have already been applied to the code. In
+particular function inlining may have occurred, leading to the
+interprocedural execution paths emitted by the analyzer containing
+function frames that don't correspond to those in the original source
+code.
+
+By default the analyzer attempts to reconstruct the original function
+frames, and to emit events showing the inlined calls.
+
+With @option{-fno-analyzer-undo-inlining} this attempt to reconstruct
+the original frame information can be be disabled, which may be of help
+when debugging issues in the analyzer.
+
@item -fanalyzer-verbose-edges
This option is intended for analyzer developers. It enables more
verbose, lower-level detail in the descriptions of control flow
@@ -10119,8 +10281,8 @@ diagnostic to @file{@var{file}.@var{idx}.@var{kind}.epath.txt}.
@opindex dump-analyzer-feasibility
Dump internal details about the analyzer's search for feasible paths.
The details are written in a form suitable for viewing with GraphViz
-to filenames of the form @file{@var{file}.*.fg.dot} and
-@file{@var{file}.*.tg.dot}.
+to filenames of the form @file{@var{file}.*.fg.dot},
+@file{@var{file}.*.tg.dot}, and @file{@var{file}.*.fpath.txt}.
@item -fdump-analyzer-json
@opindex fdump-analyzer-json
@@ -10144,6 +10306,10 @@ control flow graphs in the program, with interprocedural edges for
calls and returns. The second dump contains annotations showing nodes
in the ``exploded graph'' and diagnostics associated with them.
+@item -fdump-analyzer-untracked
+@opindex fdump-analyzer-untracked
+Emit custom warnings with internal details intended for analyzer developers.
+
@end table
@node Debugging Options
@@ -14034,9 +14200,6 @@ The maximum depth of a loop nest suitable for complete peeling.
@item max-unswitch-insns
The maximum number of insns of an unswitched loop.
-@item max-unswitch-level
-The maximum number of branches unswitched in a single loop.
-
@item lim-expensive
The minimum cost of an expensive expression in the loop invariant motion.
@@ -15085,6 +15248,9 @@ when evaluating outgoing edge ranges.
@item relation-block-limit
Maximum number of relations the oracle will register in a basic block.
+@item min-pagesize
+Minimum page size for warning purposes.
+
@item openacc-kernels
Specify mode of OpenACC `kernels' constructs handling.
With @option{--param=openacc-kernels=decompose}, OpenACC `kernels'
@@ -15153,6 +15319,20 @@ If this parameter is set to @var{n}, GCC will not use this heuristic
for loops that are known to execute in fewer than @var{n} Advanced
SIMD iterations.
+@item aarch64-vect-unroll-limit
+The vectorizer will use available tuning information to determine whether it
+would be beneficial to unroll the main vectorized loop and by how much. This
+parameter set's the upper bound of how much the vectorizer will unroll the main
+loop. The default value is four.
+
+@end table
+
+The following choices of @var{name} are available on i386 and x86_64 targets:
+
+@table @gcctabopt
+@item x86-stlf-window-ninsns
+Instructions number above which STFL stall penalty can be compensated.
+
@end table
@end table
@@ -15362,7 +15542,7 @@ profile information generated by @option{-fprofile-arcs} is placed in the
specified section for each translation unit. This option disables the profile
information registration through a constructor and it disables the profile
information processing through a destructor. This option is not intended to be
-used in hosted environments such as GNU/Linux. It targets free-standing
+used in hosted environments such as GNU/Linux. It targets freestanding
environments (for example embedded systems) with limited resources which do not
support constructors/destructors or the C library file I/O.
@@ -15387,14 +15567,8 @@ for example like this:
#include <stdio.h>
#include <stdlib.h>
-extern const struct gcov_info *__gcov_info_start[];
-extern const struct gcov_info *__gcov_info_end[];
-
-static void
-filename (const char *f, void *arg)
-@{
- puts (f);
-@}
+extern const struct gcov_info *const __gcov_info_start[];
+extern const struct gcov_info *const __gcov_info_end[];
static void
dump (const void *d, unsigned n, void *arg)
@@ -15405,6 +15579,12 @@ dump (const void *d, unsigned n, void *arg)
printf ("%02x", c[i]);
@}
+static void
+filename (const char *f, void *arg)
+@{
+ __gcov_filename_to_gcfn (f, dump, arg );
+@}
+
static void *
allocate (unsigned length, void *arg)
@{
@@ -15414,8 +15594,8 @@ allocate (unsigned length, void *arg)
static void
dump_gcov_info (void)
@{
- const struct gcov_info **info = __gcov_info_start;
- const struct gcov_info **end = __gcov_info_end;
+ const struct gcov_info *const *info = __gcov_info_start;
+ const struct gcov_info *const *end = __gcov_info_end;
/* Obfuscate variable to prevent compiler optimizations. */
__asm__ ("" : "+r" (info));
@@ -15430,13 +15610,18 @@ dump_gcov_info (void)
@}
int
-main()
+main (void)
@{
- dump_gcov_info();
+ dump_gcov_info ();
return 0;
@}
@end smallexample
+The @command{merge-stream} subcommand of @command{gcov-tool} may be used to
+deserialize the data stream generated by the @code{__gcov_filename_to_gcfn} and
+@code{__gcov_info_to_gcda} functions and merge the profile information into
+@file{.gcda} files on the host filesystem.
+
@item -fprofile-note=@var{path}
@opindex fprofile-note
@@ -16197,6 +16382,22 @@ cannot safely be called (perhaps signal handlers, if the profiling
routines generate output or allocate memory).
@xref{Common Function Attributes}.
+@item -finstrument-functions-once
+@opindex -finstrument-functions-once
+This is similar to @option{-finstrument-functions}, but the profiling
+functions are called only once per instrumented function, i.e. the first
+profiling function is called after the first entry into the instrumented
+function and the second profiling function is called before the exit
+corresponding to this first entry.
+
+The definition of @code{once} for the purpose of this option is a little
+vague because the implementation is not protected against data races.
+As a result, the implementation only guarantees that the profiling
+functions are called at @emph{least} once per process and at @emph{most}
+once per thread, but the calls are always paired, that is to say, if a
+thread calls the first function, then it will call the second function,
+unless it never reaches the exit of the instrumented function.
+
@item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
@opindex finstrument-functions-exclude-file-list
@@ -18829,6 +19030,7 @@ platform.
* HPPA Options::
* IA-64 Options::
* LM32 Options::
+* LoongArch Options::
* M32C Options::
* M32R/D Options::
* M680x0 Options::
@@ -19547,7 +19749,6 @@ Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
are
@table @samp
-@opindex fiji
@item fiji
Compile for GCN3 Fiji devices (gfx803).
@@ -19557,6 +19758,12 @@ Compile for GCN5 Vega 10 devices (gfx900).
@item gfx906
Compile for GCN5 Vega 20 devices (gfx906).
+@item gfx908
+Compile for CDNA1 Instinct MI100 series devices (gfx908).
+
+@item gfx90a
+Compile for CDNA2 Instinct MI200 series devices (gfx90a).
+
@end table
@item -msram-ecc=on
@@ -20982,7 +21189,8 @@ Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
@samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
@samp{neoverse-n1}, @samp{neoverse-n2}, @samp{neoverse-v1}, @samp{xscale},
@samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}, @samp{fa526}, @samp{fa626},
-@samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
+@samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}, @samp{star-mc1},
+@samp{xgene1}.
Additionally, this option can specify that GCC should tune the performance
of the code for a big.LITTLE system. Permissible names are:
@@ -21388,8 +21596,9 @@ Development Tools Engineering Specification", which can be found on
Mitigate against a potential security issue with the @code{VLLDM} instruction
in some M-profile devices when using CMSE (CVE-2021-365465). This option is
enabled by default when the option @option{-mcpu=} is used with
-@code{cortex-m33}, @code{cortex-m35p} or @code{cortex-m55}. The option
-@option{-mno-fix-cmse-cve-2021-35465} can be used to disable the mitigation.
+@code{cortex-m33}, @code{cortex-m35p}, @code{cortex-m55} or @code{star-mc1}.
+The option @option{-mno-fix-cmse-cve-2021-35465} can be used to disable
+the mitigation.
@item -mstack-protector-guard=@var{guard}
@itemx -mstack-protector-guard-offset=@var{offset}
@@ -22260,8 +22469,7 @@ These options are defined specifically for the CRIS ports.
Generate code for the specified architecture. The choices for
@var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
-Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
-@samp{v10}.
+Default is @samp{v0}.
@item -mtune=@var{architecture-type}
@opindex mtune
@@ -22345,27 +22553,13 @@ option only together with visual inspection of the compiled code: no
warnings or errors are generated when call-saved registers must be saved,
or storage for local variables needs to be allocated.
-@item -mno-gotplt
-@itemx -mgotplt
-@opindex mno-gotplt
-@opindex mgotplt
-With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
-instruction sequences that load addresses for functions from the PLT part
-of the GOT rather than (traditional on other architectures) calls to the
-PLT@. The default is @option{-mgotplt}.
-
@item -melf
@opindex melf
-Legacy no-op option only recognized with the cris-axis-elf and
-cris-axis-linux-gnu targets.
-
-@item -mlinux
-@opindex mlinux
-Legacy no-op option only recognized with the cris-axis-linux-gnu target.
+Legacy no-op option.
@item -sim
@opindex sim
-This option, recognized for the cris-axis-elf, arranges
+This option arranges
to link with input-output functions from a simulator library. Code,
initialized data and zero-initialized data are allocated consecutively.
@@ -24340,6 +24534,195 @@ Enable user-defined instructions.
@end table
+@node LoongArch Options
+@subsection LoongArch Options
+@cindex LoongArch Options
+
+These command-line options are defined for LoongArch targets:
+
+@table @gcctabopt
+@item -march=@var{cpu-type}
+@opindex -march
+Generate instructions for the machine type @var{cpu-type}. In contrast to
+@option{-mtune=@var{cpu-type}}, which merely tunes the generated code
+for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
+to generate code that may not run at all on processors other than the one
+indicated. Specifying @option{-march=@var{cpu-type}} implies
+@option{-mtune=@var{cpu-type}}, except where noted otherwise.
+
+The choices for @var{cpu-type} are:
+
+@table @samp
+@item native
+This selects the CPU to generate code for at compilation time by determining
+the processor type of the compiling machine. Using @option{-march=native}
+enables all instruction subsets supported by the local machine (hence
+the result might not run on different machines). Using @option{-mtune=native}
+produces code optimized for the local machine under the constraints
+of the selected instruction set.
+@item loongarch64
+A generic CPU with 64-bit extensions.
+@item la464
+LoongArch LA464 CPU with LBT, LSX, LASX, LVZ.
+@end table
+
+@item -mtune=@var{cpu-type}
+@opindex mtune
+Optimize the output for the given processor, specified by microarchitecture
+name.
+
+@item -mabi=@var{base-abi-type}
+@opindex mabi
+Generate code for the specified calling convention.
+@var{base-abi-type} can be one of:
+@table @samp
+@item lp64d
+Uses 64-bit general purpose registers and 32/64-bit floating-point
+registers for parameter passing. Data model is LP64, where @samp{int}
+is 32 bits, while @samp{long int} and pointers are 64 bits.
+@item lp64f
+Uses 64-bit general purpose registers and 32-bit floating-point
+registers for parameter passing. Data model is LP64, where @samp{int}
+is 32 bits, while @samp{long int} and pointers are 64 bits.
+@item lp64s
+Uses 64-bit general purpose registers and no floating-point
+registers for parameter passing. Data model is LP64, where @samp{int}
+is 32 bits, while @samp{long int} and pointers are 64 bits.
+@end table
+
+@item -mfpu=@var{fpu-type}
+@opindex mfpu
+Generate code for the specified FPU type, which can be one of:
+@table @samp
+@item 64
+Allow the use of hardware floating-point instructions for 32-bit
+and 64-bit operations.
+@item 32
+Allow the use of hardware floating-point instructions for 32-bit
+operations.
+@item none
+@item 0
+Prevent the use of hardware floating-point instructions.
+@end table
+
+@item -msoft-float
+@opindex msoft-float
+Force @option{-mfpu=none} and prevents the use of floating-point
+registers for parameter passing. This option may change the target
+ABI.
+
+@item -msingle-float
+@opindex -msingle-float
+Force @option{-mfpu=32} and allow the use of 32-bit floating-point
+registers for parameter passing. This option may change the target
+ABI.
+
+@item -mdouble-float
+@opindex -mdouble-float
+Force @option{-mfpu=64} and allow the use of 32/64-bit floating-point
+registers for parameter passing. This option may change the target
+ABI.
+
+@item -mbranch-cost=@var{n}
+@opindex -mbranch-cost
+Set the cost of branches to roughly @var{n} instructions.
+
+@item -mcheck-zero-division
+@itemx -mno-check-zero-divison
+@opindex -mcheck-zero-division
+Trap (do not trap) on integer division by zero. The default is
+@option{-mcheck-zero-division}.
+
+@item -mcond-move-int
+@itemx -mno-cond-move-int
+@opindex -mcond-move-int
+Conditional moves for integral data in general-purpose registers
+are enabled (disabled). The default is @option{-mcond-move-int}.
+
+@item -mcond-move-float
+@itemx -mno-cond-move-float
+@opindex -mcond-move-float
+Conditional moves for floating-point registers are enabled (disabled).
+The default is @option{-mcond-move-float}.
+
+@item -mmemcpy
+@itemx -mno-memcpy
+@opindex -mmemcpy
+Force (do not force) the use of @code{memcpy} for non-trivial block moves.
+The default is @option{-mno-memcpy}, which allows GCC to inline most
+constant-sized copies. Setting optimization level to @option{-Os} also
+forces the use of @code{memcpy}, but @option{-mno-memcpy} may override this
+behavior if explicitly specified, regardless of the order these options on
+the command line.
+
+@item -mstrict-align
+@itemx -mno-strict-align
+@opindex -mstrict-align
+Avoid or allow generating memory accesses that may not be aligned on a natural
+object boundary as described in the architecture specification. The default is
+@option{-mno-strict-align}.
+
+@item -msmall-data-limit=@var{number}
+@opindex -msmall-data-limit
+Put global and static data smaller than @var{number} bytes into a special
+section (on some targets). The default value is 0.
+
+@item -mmax-inline-memcpy-size=@var{n}
+@opindex -mmax-inline-memcpy-size
+Inline all block moves (such as calls to @code{memcpy} or structure copies)
+less than or equal to @var{n} bytes. The default value of @var{n} is 1024.
+
+@item -mcmodel=@var{code-model}
+Set the code model to one of:
+@table @samp
+@item tiny-static
+@itemize @bullet
+@item
+local symbol and global strong symbol: The data section must be within +/-2MiB addressing space.
+The text section must be within +/-128MiB addressing space.
+@item
+global weak symbol: The got table must be within +/-2GiB addressing space.
+@end itemize
+
+@item tiny
+@itemize @bullet
+@item
+local symbol: The data section must be within +/-2MiB addressing space.
+The text section must be within +/-128MiB
+addressing space.
+@item
+global symbol: The got table must be within +/-2GiB addressing space.
+@end itemize
+
+@item normal
+@itemize @bullet
+@item
+local symbol: The data section must be within +/-2GiB addressing space.
+The text section must be within +/-128MiB addressing space.
+@item
+global symbol: The got table must be within +/-2GiB addressing space.
+@end itemize
+
+@item large
+@itemize @bullet
+@item
+local symbol: The data section must be within +/-2GiB addressing space.
+The text section must be within +/-128GiB addressing space.
+@item
+global symbol: The got table must be within +/-2GiB addressing space.
+@end itemize
+
+@item extreme(Not implemented yet)
+@itemize @bullet
+@item
+local symbol: The data and text section must be within +/-8EiB addressing space.
+@item
+global symbol: The data got table must be within +/-8EiB addressing space.
+@end itemize
+@end table
+The default code model is @code{normal}.
+@end table
+
@node M32C Options
@subsection M32C Options
@cindex M32C options
@@ -27260,18 +27643,40 @@ These options are defined for Nvidia PTX:
Ignored, but preserved for backward compatibility. Only 64-bit ABI is
supported.
-@item -misa=@var{ISA-string}
+@item -march=@var{architecture-string}
@opindex march
-Generate code for given the specified PTX ISA (e.g.@: @samp{sm_35}). ISA
-strings must be lower-case. Valid ISA strings include @samp{sm_30} and
-@samp{sm_35}. The default ISA is sm_35.
+Generate code for the specified PTX ISA target architecture
+(e.g.@: @samp{sm_35}). Valid architecture strings are @samp{sm_30},
+@samp{sm_35}, @samp{sm_53}, @samp{sm_70}, @samp{sm_75} and
+@samp{sm_80}. The default target architecture is sm_30.
+
+This option sets the value of the preprocessor macro
+@code{__PTX_SM__}; for instance, for @samp{sm_35}, it has the value
+@samp{350}.
+
+@item -misa=@var{architecture-string}
+@opindex misa
+Alias of @option{-march=}.
+
+@item -march-map=@var{architecture-string}
+@opindex march
+Select the closest available @option{-march=} value that is not more
+capable. For instance, for @option{-march-map=sm_50} select
+@option{-march=sm_35}, and for @option{-march-map=sm_53} select
+@option{-march=sm_53}.
@item -mptx=@var{version-string}
@opindex mptx
-Generate code for given the specified PTX version (e.g.@: @samp{7.0}).
+Generate code for the specified PTX ISA version (e.g.@: @samp{7.0}).
Valid version strings include @samp{3.1}, @samp{6.0}, @samp{6.3}, and
-@samp{7.0}. The default PTX version is 6.0, unless a higher minimal
-version is required for specified PTX ISA via option @option{-misa=}.
+@samp{7.0}. The default PTX ISA version is 6.0, unless a higher
+version is required for specified PTX ISA target architecture via
+option @option{-march=}.
+
+This option sets the values of the preprocessor macros
+@code{__PTX_ISA_VERSION_MAJOR__} and @code{__PTX_ISA_VERSION_MINOR__};
+for instance, for @samp{3.1} the macros have the values @samp{3} and
+@samp{1}, respectively.
@item -mmainkernel
@opindex mmainkernel
@@ -29460,7 +29865,8 @@ system representing a certain processor type. Possible values for
@var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
@samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
@samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
-@samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13}, and @samp{native}.
+@samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13},
+@samp{z16}/@samp{arch14}, and @samp{native}.
The default is @option{-march=z900}.
@@ -31237,11 +31643,12 @@ AVX512VP2INTERSECT and KEYLOCKER instruction set support.
Intel sapphirerapids CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
SSSE3, SSE4.1, SSE4.2, POPCNT, CX16, SAHF, FXSR, AVX, XSAVE, PCLMUL, FSGSBASE,
RDRND, F16C, AVX2, BMI, BMI2, LZCNT, FMA, MOVBE, HLE, RDSEED, ADCX, PREFETCHW,
-AES, CLFLUSHOPT, XSAVEC, XSAVES, SGX, AVX512F, CLWB, AVX512VL, AVX512BW,
-AVX512DQ, AVX512CD, AVX512VNNI, AVX512BF16 MOVDIRI, MOVDIR64B,
-AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, TSXLDTRK,
-UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI and AVX512FP16 instruction set
-support.
+AES, CLFLUSHOPT, XSAVEC, XSAVES, SGX, AVX512F, AVX512VL, AVX512BW, AVX512DQ,
+AVX512CD, PKU, AVX512VBMI, AVX512IFMA, SHA, AVX512VNNI, GFNI, VAES, AVX512VBMI2
+VPCLMULQDQ, AVX512BITALG, RDPID, AVX512VPOPCNTDQ, PCONFIG, WBNOINVD, CLWB,
+MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG,
+SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16
+and AVX512BF16 instruction set support.
@item alderlake
Intel Alderlake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
@@ -31422,6 +31829,11 @@ VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
instruction set support.
(No scheduling is implemented for this chip.)
+@item lujiazui
+ZHAOXIN lujiazui CPU with x86-64, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
+SSE4.2, AVX, POPCNT, AES, PCLMUL, RDRND, XSAVE, XSAVEOPT, FSGSBASE, CX16,
+ABM, BMI, BMI2, F16C, FXSR, RDSEED instruction set support.
+
@item geode
AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
@end table
@@ -32325,6 +32737,17 @@ function attribute. This is useful when used with the option
@option{-fcf-protection=branch} to control ENDBR insertion at the
function entry.
+@item -mcet-switch
+@opindex mcet-switch
+By default, CET instrumentation is turned off on switch statements that
+use a jump table and indirect branch track is disabled. Since jump
+tables are stored in read-only memory, this does not result in a direct
+loss of hardening. But if the jump table index is attacker-controlled,
+the indirect jump may not be constrained by CET. This option turns on
+CET instrumentation to enable indirect branch track for switch statements
+with jump tables which leads to the jump targets reachable via any indirect
+jumps.
+
@item -mcall-ms2sysv-xlogues
@opindex mcall-ms2sysv-xlogues
@opindex mno-call-ms2sysv-xlogues
@@ -33086,6 +33509,14 @@ by 8 registers on entry so that its arguments are found in registers
pointer. Register window is rotated 8 registers back upon return.
When this version of the ABI is enabled the C preprocessor symbol
@code{__XTENSA_WINDOWED_ABI__} is defined.
+
+@item -mextra-l32r-costs=@var{n}
+@opindex mextra-l32r-costs
+Specify an extra cost of instruction RAM/ROM access for @code{L32R}
+instructions, in clock cycles. This affects, when optimizing for speed,
+whether loading a constant from literal pool using @code{L32R} or
+synthesizing the constant from a small one with a couple of arithmetic
+instructions. The default value is 0.
@end table
@node zSeries Options
diff --git a/gcc/doc/match-and-simplify.texi b/gcc/doc/match-and-simplify.texi
index 055a530..b33d835 100644
--- a/gcc/doc/match-and-simplify.texi
+++ b/gcc/doc/match-and-simplify.texi
@@ -19,7 +19,7 @@ tries to address several issues.
gimplifying via force_gimple_operand
@end enumerate
-To address these the project introduces a simple domain specific language
+To address these the project introduces a simple domain-specific language
to write expression simplifications from which code targeting GIMPLE
and GENERIC is auto-generated. The GENERIC variant follows the
fold_buildN API while for the GIMPLE variant and to address 2) new
@@ -40,7 +40,7 @@ APIs are introduced.
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, gimple_seq *, tree (*)(tree))
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, gimple_seq *, tree (*)(tree))
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, tree, gimple_seq *, tree (*)(tree))
-The main GIMPLE API entry to the expression simplifications mimicing
+The main GIMPLE API entry to the expression simplifications mimicking
that of the GENERIC fold_@{unary,binary,ternary@} functions.
@end deftypefn
@@ -57,7 +57,7 @@ a valueization hook:
@end deftypefn
-Ontop of these a @code{fold_buildN}-like API for GIMPLE is introduced:
+On top of these a @code{fold_buildN}-like API for GIMPLE is introduced:
@deftypefn {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree (*valueize) (tree) = NULL);
@deftypefnx {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree, tree (*valueize) (tree) = NULL);
@@ -78,9 +78,9 @@ and simplification is performed using the optional valueization hook.
@section The Language
@cindex The Language
-The language to write expression simplifications in resembles other
-domain-specific languages GCC uses. Thus it is lispy. Lets start
-with an example from the match.pd file:
+The language in which to write expression simplifications resembles
+other domain-specific languages GCC uses. Thus it is lispy. Let's
+start with an example from the match.pd file:
@smallexample
(simplify
@@ -100,7 +100,7 @@ function code names in all-caps, like @code{BUILT_IN_SQRT}.
@code{@@n} denotes a so-called capture. It captures the operand and lets
you refer to it in other places of the match-and-simplify. In the
-above example it is refered to in the replacement expression. Captures
+above example it is referred to in the replacement expression. Captures
are @code{@@} followed by a number or an identifier.
@smallexample
@@ -110,10 +110,10 @@ are @code{@@} followed by a number or an identifier.
@end smallexample
In this example @code{@@0} is mentioned twice which constrains the matched
-expression to have two equal operands. Usually matches are constraint
-to equal types. If operands may be constants and conversions are involved
+expression to have two equal operands. Usually matches are constrained
+to equal types. If operands may be constants and conversions are involved,
matching by value might be preferred in which case use @code{@@@@0} to
-denote a by value match and the specific operand you want to refer to
+denote a by-value match and the specific operand you want to refer to
in the result part. This example also introduces
operands written in C code. These can be used in the expression
replacements and are supposed to evaluate to a tree node which has to
@@ -129,7 +129,7 @@ be a valid GIMPLE operand (so you cannot generate expressions in C code).
Here @code{@@0} captures the first operand of the trunc_mod expression
which is also predicated with @code{integer_zerop}. Expression operands
may be either expressions, predicates or captures. Captures
-can be unconstrained or capture expresions or predicates.
+can be unconstrained or capture expressions or predicates.
This example introduces an optional operand of simplify,
the if-expression. This condition is evaluated after the
@@ -219,9 +219,9 @@ Captures can also be used for capturing results of sub-expressions.
@end smallexample
In the above example, @code{@@2} captures the result of the expression
-@code{(addr @@0)}. For outermost expression only its type can be captured,
-and the keyword @code{type} is reserved for this purpose. The above
-example also gives a way to conditionalize patterns to only apply
+@code{(addr @@0)}. For the outermost expression only its type can be
+captured, and the keyword @code{type} is reserved for this purpose. The
+above example also gives a way to conditionalize patterns to only apply
to @code{GIMPLE} or @code{GENERIC} by means of using the pre-defined
preprocessor macros @code{GIMPLE} and @code{GENERIC} and using
preprocessor directives.
@@ -314,9 +314,9 @@ and use them in @code{for} operator lists where they get expanded.
So this example iterates over @code{plus}, @code{minus}, @code{mult}
and @code{trunc_div}.
-Using operator lists can also remove the need to explicitely write
+Using operator lists can also remove the need to explicitly write
a @code{for}. All operator list uses that appear in a @code{simplify}
-or @code{match} pattern in operator positions will implicitely
+or @code{match} pattern in operator positions will implicitly
be added to a new @code{for}. For example
@smallexample
@@ -359,7 +359,7 @@ type of a generated expression with the @code{:type} syntax where
@code{type} needs to be an identifier that refers to the desired type.
Usually the types of the generated result expressions are
determined from the context, but sometimes like in the above case
-it is required that you specify them explicitely.
+it is required that you specify them explicitly.
Another modifier for generated expressions is @code{!} which
tells the machinery to only consider the simplification in case
@@ -402,7 +402,7 @@ The support for @code{?} marking extends to all unary operations
including predicates you declare yourself with @code{match}.
Predicates available from the GCC middle-end need to be made
-available explicitely via @code{define_predicates}:
+available explicitly via @code{define_predicates}:
@smallexample
(define_predicates
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index f3619c5..463471f 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2747,6 +2747,32 @@ Memory addressed using the small base register ($sb).
$r1h
@end table
+@item LoongArch---@file{config/loongarch/constraints.md}
+@table @code
+@item f
+A floating-point register (if available).
+@item k
+A memory operand whose address is formed by a base register and
+(optionally scaled) index register.
+@item l
+A signed 16-bit constant.
+@item m
+A memory operand whose address is formed by a base register and offset
+that is suitable for use in instructions with the same addressing mode
+as @code{st.w} and @code{ld.w}.
+@item I
+A signed 12-bit constant (for arithmetic instructions).
+@item K
+An unsigned 12-bit constant (for logic instructions).
+@item ZB
+An address that is held in a general-purpose register.
+The offset is zero.
+@item ZC
+A memory operand whose address is formed by a base register and offset
+that is suitable for use in instructions with the same addressing mode
+as @code{ll.w} and @code{sc.w}.
+@end table
+
@item MicroBlaze---@file{config/microblaze/constraints.md}
@table @code
@item d
@@ -11484,7 +11510,7 @@ This is exactly equivalent to:
[(set (match_operand:DI 0 "register_operand" "=d")
(minus:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")))]
- ""
+ "TARGET_64BIT"
"dsubu\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi
index 50674938..17ba923 100644
--- a/gcc/doc/options.texi
+++ b/gcc/doc/options.texi
@@ -175,6 +175,17 @@ used instead of the option's name and the text to the right of the
tab forms the help text. This allows you to elaborate on what type
of argument the option takes.
+There is no support for different help texts for different languages.
+If an option is supported for multiple languages, use a generic
+description that is correct for all of them.
+
+If an option has multiple option definition records (in different
+front ends' @file{*.opt} files, and/or @file{gcc/common.opt}, for
+example), convention is to not duplicate the help text for each of
+them, but instead put a comment like @code{; documented in common.opt}
+in place of the help text for all but one of the multiple option
+definition records.
+
@item
A target mask record. These records have one field of the form
@samp{Mask(@var{x})}. The options-processing script will automatically
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 613ac29..606ab85 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -27,9 +27,9 @@ distributions such as that of GNU Binutils. It also contains several
subdirectories that contain parts of GCC and its runtime libraries:
@table @file
-@item boehm-gc
-The Boehm conservative garbage collector, optionally used as part of
-the ObjC runtime library when configured with @option{--enable-objc-gc}.
+@item c++tools
+Contains the sources for the g++-mapper-server, a tool used with
+C++ modules.
@item config
Autoconf macros and Makefile fragments used throughout the tree.
@@ -55,6 +55,9 @@ language front ends, and testsuites. @xref{gcc Directory, , The
@item gnattools
Support tools for GNAT.
+@item gotools
+Support tools for Go.
+
@item include
Headers for the @code{libiberty} library.
@@ -69,6 +72,16 @@ The Ada runtime library.
The runtime support library for atomic operations (e.g.@: for @code{__sync}
and @code{__atomic}).
+@item libbacktrace
+A library that allows gcc to produce backtraces when it crashes.
+
+@item libcc1
+A library that allows gdb to make use of the compiler.
+
+@item libcody
+A compiler dynamism library to allow communication between compilers and
+build systems, for purposes such as C++ modules.
+
@item libcpp
The C preprocessor library.
@@ -103,19 +116,30 @@ The runtime support library for transactional memory.
@item libobjc
The Objective-C and Objective-C++ runtime library.
-@item libquadmath
-The runtime support library for quad-precision math operations.
+@item liboffloadmic
+A library to allow OpenMP to Intel MIC targets.
@item libphobos
The D standard and runtime library. The bulk of this library is mirrored
from the @uref{https://github.com/@/dlang, master D repositories}.
+@item libquadmath
+The runtime support library for quad-precision math operations.
+
+@item libsanitizer
+Libraries for various sanitizers. The bulk of this directory is mirrored
+from the @uref{https://github.com/google/sanitizers, Google sanitizers
+repositories}.
+
@item libssp
The Stack protector runtime library.
@item libstdc++-v3
The C++ runtime library.
+@item libvtv
+The vtable verification library.
+
@item lto-plugin
Plugin used by the linker if link-time optimizations are enabled.
@@ -1937,6 +1961,9 @@ test system can execute decimal floating point tests.
@item hard_dfp
Target generates decimal floating point instructions with current options.
+
+@item dfp_bid
+Target uses the BID format for decimal floating point.
@end table
@subsubsection ARM-specific attributes
@@ -2420,6 +2447,18 @@ PowerPC target pre-defines macro _ARCH_PWR9 which means the @code{-mcpu}
setting is Power9 or later.
@end table
+@subsection RISC-V specific attributes
+
+@table @code
+
+@item rv32
+Test system has an integer register width of 32 bits.
+
+@item rv64
+Test system has an integer register width of 64 bits.
+
+@end table
+
@subsubsection Other hardware attributes
@c Please keep this table sorted alphabetically.
@@ -3113,6 +3152,12 @@ Passes if @var{regexp} matches in Fortran module @var{module}.
@item dg-check-dot @var{filename}
Passes if @var{filename} is a valid @file{.dot} file (by running
@code{dot -Tpng} on it, and verifying the exit code is 0).
+@item scan-sarif-file @var{regexp} [@{ target/xfail @var{selector} @}]
+Passes if @var{regexp} matches text in the file generated by
+@option{-fdiagnostics-format=sarif-file}.
+@item scan-sarif-file-not @var{regexp} [@{ target/xfail @var{selector} @}]
+Passes if @var{regexp} does not match text in the file generated by
+@option{-fdiagnostics-format=sarif-file}.
@end table
@subsubsection Scan the assembly output
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index fea28b2..bddaad2 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6429,15 +6429,19 @@ access using @var{type} is known to be naturally aligned.
@end deftypefn
@c hook-end
-@deftypefn {Target Hook} bool TARGET_VECTORIZE_VEC_PERM_CONST (machine_mode @var{mode}, rtx @var{output}, rtx @var{in0}, rtx @var{in1}, const vec_perm_indices @var{&sel})
+@deftypefn {Target Hook} bool TARGET_VECTORIZE_VEC_PERM_CONST (machine_mode @var{mode}, machine_mode @var{op_mode}, rtx @var{output}, rtx @var{in0}, rtx @var{in1}, const vec_perm_indices @var{&sel})
@c hook-start:TARGET_VECTORIZE_VEC_PERM_CONST
This hook is used to test whether the target can permute up to two
-vectors of mode @var{mode} using the permutation vector @code{sel}, and
-also to emit such a permutation. In the former case @var{in0}, @var{in1}
-and @var{out} are all null. In the latter case @var{in0} and @var{in1} are
-the source vectors and @var{out} is the destination vector; all three are
-operands of mode @var{mode}. @var{in1} is the same as @var{in0} if
-@var{sel} describes a permutation on one vector instead of two.
+vectors of mode @var{op_mode} using the permutation vector @code{sel},
+producing a vector of mode @var{mode}. The hook is also used to emit such
+a permutation.
+
+When the hook is being used to test whether the target supports a permutation,
+@var{in0}, @var{in1}, and @var{out} are all null. When the hook is being used
+to emit a permutation, @var{in0} and @var{in1} are the source vectors of mode
+@var{op_mode} and @var{out} is the destination vector of mode @var{mode}.
+@var{in1} is the same as @var{in0} if @var{sel} describes a permutation on one
+vector instead of two.
Return true if the operation is possible, emitting instructions for it
if rtxes are provided.
@@ -13242,6 +13246,13 @@ This target hook emits instructions to zero the subset of @var{selected_regs}
that could conceivably contain values that are useful to an attacker.
Return the set of registers that were actually cleared.
+For most targets, the returned set of registers is a subset of
+@var{selected_regs}, however, for some of the targets (for example MIPS),
+clearing some registers that are in the @var{selected_regs} requires
+clearing other call used registers that are not in the @var{selected_regs},
+under such situation, the returned set of registers must be a subset of all
+call used registers.
+
The default implementation uses normal move instructions to zero
all the registers in @var{selected_regs}. Define this hook if the
target has more efficient ways of zeroing certain registers,