From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2209) id 7E6873858C98; Thu, 4 Apr 2024 16:37:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E6873858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712248633; bh=sODYx8H3oV/2MSXAvhqmZoBTtn1QSes92nik8Zcs+Nw=; h=To:Subject:Date:From:From; b=chjq5W6SjbTeuNwJf7s5Q4WNoFiiQPgJL9B1Gh5n9yJEAjvj9DdhPm99QYKD9ZowG oTx2Pgp9w/T0x6pwt+eLijjhctkW0m7hdLUb8jTw8hMugeQNbK9GmVjy83rvTlEUNq ON3zE29+a+5MbPxjf8eBXnvbVsCY0/H1u8JfWoHc= To: gcc-cvs-wwwdocs@gcc.gnu.org Subject: gcc-wwwdocs branch master updated. a33ad5c5681a0ce2dfba0a90b4043f399b7a7d55 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5355f9e63f8240f6a3753a6f9ae10133d0c34e38 X-Git-Newrev: a33ad5c5681a0ce2dfba0a90b4043f399b7a7d55 Message-Id: <20240404163713.7E6873858C98@sourceware.org> Date: Thu, 4 Apr 2024 16:37:13 +0000 (GMT) From: David Malcolm List-Id: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gcc-wwwdocs". The branch, master has been updated via a33ad5c5681a0ce2dfba0a90b4043f399b7a7d55 (commit) via 00e45d6100ab1e8bb1c6f8e3a90ac6ba1281336d (commit) via fb40537f9b2779f853277ee3299a41b9cb792edb (commit) via fa7ec7fcb46b79640581aa6382d15ef7bb213c28 (commit) via e94f99b63102cd8df716c4d0e1d820f9d1483562 (commit) via 19d501ff0cf4b28dc7b93c5492912790c34bbc6d (commit) via d21d1e5bb3864171edbcdfbc3cc5a154cda8de0c (commit) via 899346397e3bf93d282156969c72faa85cce29f1 (commit) via 0365f758c3c7be1991524b103594c57d6666b1ca (commit) from 5355f9e63f8240f6a3753a6f9ae10133d0c34e38 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a33ad5c5681a0ce2dfba0a90b4043f399b7a7d55 Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: add 'Improvements to SARIF support' section Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index d782c334..934cd1ad 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -922,6 +922,28 @@ it emits: + +

Improvements to SARIF support

+
    +
  • + + The SARIF output from + -fdiagnostics-format= + now adds indentation and newlines to reflect the logical JSON structure of the data. The previous compact behavior can be restored via the new option + -fno-diagnostics-json-formatting. + This also applies to the older output format named "json". +
  • +
  • + + If profiling information about the compiler itself is requested via + -ftime-report, + and a SARIF output format is requested via + -fdiagnostics-format=, + then the timing and memory usage data is now written in JSON form into + the SARIF output, rather than as plain text to stderr. +
  • +
+

Improvements for plugin authors

    commit 00e45d6100ab1e8bb1c6f8e3a90ac6ba1281336d Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: analyzer improvements Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 8b72bc20..d782c334 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -760,6 +760,168 @@ __asm (".global __flmap_lock" "\n\t"
+ +

Improvements to Static Analyzer

+
    +
  • + New warnings: + +
  • +
  • + + Previously, the analyzer's "taint" tracking to be explicitly enabled via + -fanalyzer-checker=taint + (along with + -fanalyzer). + This is now enabled by default when + -fanalyzer + is selected, thus also enabling the 6 taint-based warnings: + +
  • +
  • + + The analyzer will now simulate API calls that expect null-terminated + string arguments, and will warn about code paths in which such a call + is made with a buffer that isn't properly terminated, either due to + a read of an uninitialized byte or an out-of-range accesses seen + before any zero byte is seen. + This applies to functions that use the new + null_terminated_string_arg(PARAM_IDX) + attribute, + functions that use the + format + attribute, + and to the library functions + error (parameter 3), + error_at_line (parameter 5), + putenv, + strchr (parameter 1), and + strcpy (parameter 2). +
  • +
  • + + The analyzer now makes use of the function attribute + alloc_size + allowing + -fanalyzer + to emit + -Wanalyzer-allocation-size, + -Wanalyzer-out-of-bounds, + and + -Wanalyzer-tainted-allocation-size + on execution paths involving allocations using such functions. +
  • +
  • + The analyzer's knowledge about the behavior of the standard library has been extended to cover + fopen, + strcat, + strncpy, and + strstr. + The analyzer will also more precisely model the behavior of + memcpy, + memmove, + strcpy, + strdup, + strlen, + and of various atomic built-in functions. +
  • +
  • + +

    The warning + -Wanalyzer-out-of-bounds + has been extended so that, where possible, it will emit a text-based + diagram visualizing the spatial relationship between +

      +
    1. the memory region that the analyzer predicts would be + accessed, versus
    2. +
    3. the range of memory that is valid to access
    4. +
    + whether they overlap, are touching, are close or far apart; + which one is before or after in memory, the relative sizes involved, + the direction of the access (read vs write), and, in some cases, + the values of data involved.

    +

    Such "text art" diagrams can be controlled (or suppressed) via a new + -fdiagnostics-text-art-charset= option. +

    For example, given the out-of-bounds write in strcat in: + +

    +void test (void)
    +{
    +   char buf[10];
    +   strcpy (buf, "hello");
    +   strcat (buf, " world!");
    +}
    +
    +it emits: +
    +                                 ┌────┬────┬────┬────┬────┐┌─────┬─────┬─────┐
    +                                 │[0] │[1] │[2] │[3] │[4] ││ [5] │ [6] │ [7] │
    +                                 ├────┼────┼────┼────┼────┤├─────┼─────┼─────┤
    +                                 │' ' │'w' │'o' │'r' │'l' ││ 'd' │ '!' │ NUL │
    +                                 ├────┴────┴────┴────┴────┴┴─────┴─────┴─────┤
    +                                 │     string literal (type: 'char[8]')      │
    +                                 └───────────────────────────────────────────┘
    +                                   │    │    │    │    │      │     │     │
    +                                   │    │    │    │    │      │     │     │
    +                                   v    v    v    v    v      v     v     v
    +      ┌─────┬────────────────────┬────┬──────────────┬────┐┌─────────────────┐
    +      │ [0] │        ...         │[5] │     ...      │[9] ││                 │
    +      ├─────┼────┬────┬────┬────┬┼────┼──────────────┴────┘│                 │
    +      │ 'h' │'e' │'l' │'l' │'o' ││NUL │                    │after valid range│
    +      ├─────┴────┴────┴────┴────┴┴────┴───────────────────┐│                 │
    +      │             'buf' (type: 'char[10]')              ││                 │
    +      └───────────────────────────────────────────────────┘└─────────────────┘
    +      ├─────────────────────────┬─────────────────────────┤├────────┬────────┤
    +                                │                                   │
    +                      ╭─────────┴────────╮                ╭─────────┴─────────╮
    +                      │capacity: 10 bytes│                │overflow of 3 bytes│
    +                      ╰──────────────────╯                ╰───────────────────╯
    +
    + showing that the overflow occurs partway through the second string + fragment. +
  • +
  • + + The analyzer will now attempt to track execution paths involving + computed gotos, whereas previously it gave up on such paths. +
  • +
+

Improvements for plugin authors

    commit fb40537f9b2779f853277ee3299a41b9cb792edb Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: improvements for plugin authors Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 0701dc29..8b72bc20 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -761,7 +761,28 @@ __asm (".global __flmap_lock" "\n\t"
- +

Improvements for plugin authors

+
    +
  • + + GCC diagnostics have been able to have execution paths associated + with them since GCC 10, but previously these were required to be + single-threaded. + As of GCC 14, these execution paths can have multipled named threads + associated with them, with each event being associated with one of the + threads. + No existing GCC diagnostics take advantage of this, but GCC plugins + may find this useful for their own diagnostics; an + example + is provided in the testsuite. +
  • +
  • + + GCC's diagnostics can now optionally add per-diagnostic property + bags to the SARIF output, allowing plugins to capture custom data + as needed with their diagnostics. +
  • +

Other significant improvements

commit fa7ec7fcb46b79640581aa6382d15ef7bb213c28 Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: improvements to automatic doc URLs for options Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 2dc7e598..0701dc29 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -745,7 +745,20 @@ __asm (".global __flmap_lock" "\n\t" - +

Documentation improvements

+
    +
  • + + + + + + GCC's ability to provide clickable hyperlinks to the documentation + has been extended, so that whenever GCC refers to a command-line + option in quotes in a diagnostic message, the option is a clickable + hyperlink (assuming a suitably capable terminal). +
  • +
commit e94f99b63102cd8df716c4d0e1d820f9d1483562 Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: libgccjit changes Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 95ed00c9..2dc7e598 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -360,7 +360,36 @@ a work-in-progress.

- +

libgccjit

+

New Targets and Target Specific Improvements

commit 19d501ff0cf4b28dc7b93c5492912790c34bbc6d Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: c++: note changes to source quoting in template errors Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index f9ce4fe5..95ed00c9 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -262,6 +262,13 @@ a work-in-progress.

constinit and optimized dynamic initialization +
  • + + When a diagnostic occurrs involving a C++ template, + GCC will now quote the source code of the context at which + the template is instantiated ("required from here"), + rather than just print filename and line/column numbers. +
  • Runtime Library (libstdc++)

    commit d21d1e5bb3864171edbcdfbc3cc5a154cda8de0c Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: add null_terminated_string_arg attribute Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 397458d5..f9ce4fe5 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -191,6 +191,13 @@ a work-in-progress.

    not an optimization, to avoid relying on library implementations. +
  • + + New function attribute + null_terminated_string_arg(PARAM_IDX) + for indicating parameters that are expected to be null-terminated + strings. +
  • New Languages and Language specific improvements

    commit 899346397e3bf93d282156969c72faa85cce29f1 Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: add URLs to some options Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 5cc729c5..397458d5 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -149,26 +149,33 @@ a work-in-progress.

    to enable additional hardening.
  • - New option -fhardened, an umbrella option that enables a set - of hardening flags. The options it enables can be displayed using the + New option + -fhardened, + an umbrella option that enables a set of hardening flags. + The options it enables can be displayed using the --help=hardened option.
  • - New option -fharden-control-flow-redundancy, to - verify, at the end of functions, that the visited basic blocks + New option + -fharden-control-flow-redundancy, + to verify, at the end of functions, that the visited basic blocks correspond to a legitimate execution path, so as to detect and prevent attacks that transfer control into the middle of functions.
  • - New type attribute hardbool, for C and Ada. Hardened + New type attribute + hardbool, + for C and Ada. Hardened booleans take user-specified representations for true and false, presumably with higher hamming distance than standard booleans, and get verified at every use, detecting memory corruption and some malicious attacks.
  • - New type attribute strub to control stack scrubbing + New type attribute + strub + to control stack scrubbing properties of functions and variables. The stack frame used by functions marked with the attribute gets zeroed-out upon returning or exception escaping. Scalar variables marked with the attribute @@ -176,7 +183,9 @@ a work-in-progress.

    enabled implicitly.
  • - New option -finline-stringops, to force inline + New option + -finline-stringops, + to force inline expansion of memcmp, memcpy, memmove and memset, even when that is not an optimization, to avoid relying on library commit 0365f758c3c7be1991524b103594c57d6666b1ca Author: David Malcolm Date: Thu Apr 4 12:37:01 2024 -0400 gcc-14: add caveat about not using analyzer on C++ Signed-off-by: David Malcolm diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 9fd224c1..5cc729c5 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -49,6 +49,10 @@ a work-in-progress.

    unmaintained for quite a while has been declared obsolete in GCC 14. The next release of GCC will have their sources permanently removed.
  • +
  • -fanalyzer + is still only suitable for analyzing C code. + In particular, using it on C++ is unlikely to give meaningful output. +
  • ----------------------------------------------------------------------- Summary of changes: htdocs/gcc-14/changes.html | 294 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 284 insertions(+), 10 deletions(-) hooks/post-receive -- gcc-wwwdocs