Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-23 Thread David Malcolm
On Thu, 2024-05-23 at 14:03 +, Qing Zhao wrote: [...snip...] > Is “location_adhoc_data” an available data structure in current GCC? > I just searched GCC source tree, cannot find it. It's in libcpp/include/line-table.h; see the big comment at the top of that file. Dave

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-21 Thread David Malcolm
On Tue, 2024-05-21 at 15:13 +, Qing Zhao wrote: > Thanks for the comments and suggestions. > > > On May 15, 2024, at 10:00, David Malcolm > > wrote: > > > > On Tue, 2024-05-14 at 15:08 +0200, Richard Biener wrote: > > > On Mon, 13 May 2024, Qing Zh

Re: [COMMITTED] Regenerate riscv.opt.urls and i386.opt.urls

2024-05-20 Thread David Malcolm
On Mon, 2024-05-20 at 16:19 +, Jiang, Haochen wrote: > Thanks for your help! I haven't noticed this file is newly added to > GCC. > I suppose that is why the buildbot is reporting something the whole > afternoon for me. > > So just for confirm, does that mean we will always need to run >

[pushed] Regenerate common.opt.urls

2024-05-17 Thread David Malcolm
I forgot to do this for r15-636-g770657d02c986c. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-640-g4e3bb431bbf280. gcc/ChangeLog: * common.opt.urls: Regenerate to add fdiagnostics-show-event-links. Signed-off-by: David Malcolm ---

[PATCH] selftest: invoke "diff" when ASSERT_STREQ fails

2024-05-17 Thread David Malcolm
n-null strings. Signed-off-by: David Malcolm --- gcc/selftest.cc | 28 ++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/gcc/selftest.cc b/gcc/selftest.cc index 6438d86a6aa0..f58c0631908e 100644 --- a/gcc/selftest.cc +++ b/gcc/selftest.cc @@ -63,6 +63,26 @@

[pushed] diagnostics, analyzer: add CFG edge visualization to path-printing

2024-05-17 Thread David Malcolm
vent-links-color.c: New test. * gcc.dg/analyzer/event-links-disabled.c: New test. * gcc.dg/analyzer/event-links-unicode.c: New test. libcpp/ChangeLog: * include/rich-location.h (class label_effects): New forward decl. (range_label::get_effects): New v

[pushed] diagnostics: use unicode art for interprocedural depth

2024-05-15 Thread David Malcolm
Test with both ascii and unicode themes. (selftest::test_interprocedural_path_2): Likewise. (selftest::test_recursion): Likewise. Signed-off-by: David Malcolm --- .../analyzer/out-of-bounds-diagram-1-emoji.c | 26 +- .../out-of-bounds-diagram-1-unicode.c | 26 +-

[pushed] diagnostics: add warning emoji to events with VERB_danger

2024-05-15 Thread David Malcolm
agnostic_event::VERB_danger, and the theme enables emojis, then add a warning emoji between the event number and the event text. Signed-off-by: David Malcolm --- .../analyzer/out-of-bounds-diagram-1-emoji.c | 2 +- gcc/testsuite/gcc.dg/analyzer/warning-emoji.c | 29 ++ gcc/t

[pushed] diagnostics: simplify output of purely intraprocedural execution paths

2024-05-15 Thread David Malcolm
purely intraprocedural. (selftest::test_intraprocedural_path): Update expected output. Signed-off-by: David Malcolm --- gcc/diagnostic-path.h | 32 +- gcc/doc/invoke.texi | 30 +- .../analyzer/allocation-size-multiline-1.c| 68 +-

[pushed] diagnostics: handle SGR codes in line_label::m_display_width

2024-05-15 Thread David Malcolm
8): Update expected text to reflect that the labels can fit on one line if we don't get confused by SGR colorization codes. Signed-off-by: David Malcolm --- gcc/diagnostic-show-locus.cc | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --g

[pushed] analyzer: fix ICE seen with -fsanitize=undefined [PR114899]

2024-05-15 Thread David Malcolm
null. gcc/testsuite/ChangeLog: PR analyzer/114899 * c-c++-common/analyzer/out-of-bounds-diagram-pr114899.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/access-diagram.cc| 3 ++- .../analyzer/out-of-bounds-diagram-pr114899.c | 15 ++

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-15 Thread David Malcolm
g new heuristic: > > > > If > >    1. the stmt is duplicated and splitted into two conditional > > paths; > > +  2. the warning level < 2; > > +  3. the current block is not dominating the exit block > > Then not report the warning. > > > >

Re: [PATCH] testsuite: analyzer: Fix fd-glibc-byte-stream-connection-server.c on Solaris [PR107750]

2024-05-14 Thread David Malcolm
On Tue, 2024-05-14 at 14:32 +0200, Rainer Orth wrote: > gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c currently > FAILs > on Solaris: > > FAIL: gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c (test > for excess errors) > > Excess errors: >

Re: [EXTERNAL] [COMMITTED] Regenerate cygming.opt.urls and mingw.opt.urls

2024-05-13 Thread David Malcolm
On Mon, 2024-05-13 at 09:42 -0400, David Malcolm wrote: > On Mon, 2024-05-13 at 11:14 +0200, Mark Wielaard wrote: > > Hi Evgeny, > > > > Adding David to the CC, who might know the details. > > > > On Mon, May 13, 2024 at 08:44:12AM +, Evgeny Karpov

Re: [EXTERNAL] [COMMITTED] Regenerate cygming.opt.urls and mingw.opt.urls

2024-05-13 Thread David Malcolm
On Mon, 2024-05-13 at 11:14 +0200, Mark Wielaard wrote: > Hi Evgeny, > > Adding David to the CC, who might know the details. > > On Mon, May 13, 2024 at 08:44:12AM +, Evgeny Karpov wrote: > > Sunday, May 12, 2024 > > > > Thank you for reviewing our changes related to the refactoring of > >

[PATCH 21/21] diagnostics: fix corrupt json/SARIF on stderr [PR114348]

2024-05-09 Thread David Malcolm
uested one of the machine-readable diagnostic output formats on stderr. (diagnostic_output_format_init): Set output_format. Signed-off-by: David Malcolm --- gcc/diagnostic.cc | 24 1 file changed, 24 insertions(+) diff --git a/gcc/diagnostic.cc b/gcc/diagnosti

[PATCH 19/21] diagnostics: fix ICE on sarif output when source file is unreadable [PR111700]

2024-05-09 Thread David Malcolm
lookup_or_add_file failing. gcc/testsuite/ChangeLog: PR driver/111700 * c-c++-common/diagnostic-format-sarif-file-pr111700.c: New test. Signed-off-by: David Malcolm --- gcc/input.cc | 12 ++-- .../diagnostic-format-sarif-file

[PATCH 13/21] analyzer: fix defaults in compound assignments from non-zero offsets [PR112969]

2024-05-09 Thread David Malcolm
/compound-assignment-pr112969.c: New test. * gcc.dg/plugin/infoleak-pr112969.c: New test. * gcc.dg/plugin/plugin.exp: Add infoleak-pr112969.c to analyzer_kernel_plugin.c tests. Signed-off-by: David Malcolm --- gcc/analyzer/store.cc | 11

[PATCH 10/21] analyzer: fix ICE for 2 bits before the start of base region [PR112889]

2024-05-09 Thread David Malcolm
::is_empty): Likewise. gcc/testsuite/ChangeLog: PR analyzer/112889 * gcc.dg/analyzer/ice-pr112889.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/store.h | 10 +- gcc/testsuite/gcc.dg/analyzer/ice-pr112889.c | 17 + 2 files

[PATCH 15/21] analyzer: fix -Wanalyzer-va-arg-type-mismatch false +ve on int types [PR111289]

2024-05-09 Thread David Malcolm
types. (kf_va_arg::impl_call_pre): Pass arg_sval to va_arg_compatible_types_p. gcc/testsuite/ChangeLog: PR analyzer/111289 * gcc.dg/analyzer/stdarg-pr111289-int.c: New test. * gcc.dg/analyzer/stdarg-pr111289-ptr.c: New test. Signed-off-by: David Malcolm

[PATCH 18/21] analyzer: fix ICE and false positive with -Wanalyzer-deref-before-check [PR114408]

2024-05-09 Thread David Malcolm
: New test. Signed-off-by: David Malcolm --- gcc/analyzer/engine.cc| 7 ++ gcc/analyzer/kf.cc| 22 +++ .../ubsan/analyzer-ice-pr114408.c | 9 .../analyzer/deref-before-check-pr114408.c| 22

[PATCH 03/21] testsuite: Add more allocation size tests for conjured svalues [PR110014]

2024-05-09 Thread David Malcolm
. (cherry picked from commit r14-1685-g39adc5eebd61fd276f3f1ef9d7228756a35bd0cb) Signed-off-by: David Malcolm --- .../gcc.dg/analyzer/realloc-pr110014.c| 25 +++ 1 file changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/realloc-pr110014.c diff --git

[PATCH 11/21] analyzer: fix deref-before-check false positives due to inlining [PR112790]

2024-05-09 Thread David Malcolm
: Include "analyzer/inlining-iterator.h". (maybe_complain_about_deref_before_check): Reject stmts that were inlined from another function. gcc/testsuite/ChangeLog: PR analyzer/112790 * gcc.dg/analyzer/deref-before-check-pr112790.c: New test. Signed-off-by: Dav

[PATCH 20/21] Fix ICE in -fdiagnostics-generate-patch [PR112684]

2024-05-09 Thread David Malcolm
Backported from r14-8255-ge254d1224df306. gcc/ChangeLog: PR middle-end/112684 * toplev.cc (toplev::main): Don't ICE in -fdiagnostics-generate-patch when exiting after options, since no edit context will have been created. Signed-off-by: David Malcolm --- gcc

[PATCH 16/21] analyzer: fix -Wanalyzer-deref-before-check false positive seen in loop header macro [PR109251]

2024-05-09 Thread David Malcolm
. (deref_before_check::loop_header_p): New. gcc/testsuite/ChangeLog: PR analyzer/109251 * gcc.dg/analyzer/deref-before-check-pr109251-1.c: New test. * gcc.dg/analyzer/deref-before-check-pr109251-2.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/sm-malloc.cc

[PATCH 09/21] jit: dump string literal initializers correctly

2024-05-09 Thread David Malcolm
From: Vibhav Pant Signed-off-by: David Malcolm gcc/jit/ChangeLog: * jit-recording.cc (recording::global::write_to_dump): Fix dump of string literal initializers. (cherry picked from commit r14-4923-gac66744d94226a) Signed-off-by: David Malcolm --- gcc/jit/jit-recording.cc

[PATCH 08/21] testsuite, analyzer: add test case [PR108171]

2024-05-09 Thread David Malcolm
) Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pr108171.c | 31 1 file changed, 31 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr108171.c diff --git a/gcc/testsuite/gcc.dg/analyzer/pr108171.c b/gcc/testsuite/gcc.dg/analyzer/pr108171.c

[PATCH 17/21] analyzer: fix ICE due to type mismatch when replaying call summary [PR114473]

2024-05-09 Thread David Malcolm
::convert_region_from_summary_1): Add missing cast for the deref of RK_SYMBOLIC case. gcc/testsuite/ChangeLog: PR analyzer/114473 * gcc.dg/analyzer/call-summaries-pr114473.c: New test. (cherry picked from commit r14-9697-gfdd59818e2abf6) Signed-off-by: David Malcolm --- gcc/analyzer/call

[PATCH 14/21] analyzer: fix skipping of debug stmts [PR113253]

2024-05-09 Thread David Malcolm
/ChangeLog: PR analyzer/113253 * gcc.dg/analyzer/deref-before-check-pr113253.c: New test. (cherry picked from commit r14-8670-gcc7aebff74d896) Signed-off-by: David Malcolm --- gcc/analyzer/region-model.cc | 5 + gcc/analyzer/state-purge.cc | 9

[PATCH 02/21] analyzer: Fix allocation size false positive on conjured svalue [PR109577]

2024-05-09 Thread David Malcolm
test. (cherry picked from commit r14-1684-g1d57a2232575913ad1085bac0ba5e22b58185179) Signed-off-by: David Malcolm --- gcc/analyzer/constraint-manager.cc| 131 ++ gcc/analyzer/constraint-manager.h | 1 + gcc/analyzer/region-model.cc | 80

[PATCH 07/21] analyzer: fix ICE on zero-sized arrays [PR110882]

2024-05-09 Thread David Malcolm
gcc/analyzer/ChangeLog: PR analyzer/110882 * region.cc (int_size_in_bits): Fail on zero-sized types. gcc/testsuite/ChangeLog: PR analyzer/110882 * gcc.dg/analyzer/pr110882.c: New test. (cherry picked from commit r14-2955-gc62f93d1e0383d) Signed-off-by: David

[PATCH 05/21] jit.exp: handle dwarf version mismatch in jit-check-debug-info [PR110466]

2024-05-09 Thread David Malcolm
gcc/testsuite/ChangeLog: PR jit/110466 * jit.dg/jit.exp (jit-check-debug-info): Gracefully handle too early versions of gdb that don't support our dwarf version, via "unsupported". (cherry picked from commit r14-2223-gc3c0ba5436170e) Signed-off-by: Dav

[PATCH 12/21] analyzer: casting all zeroes should give all zeroes [PR113333]

2024-05-09 Thread David Malcolm
): Casting all zeroes should give all zeroes. gcc/testsuite/ChangeLog: PR analyzer/11 * gcc.dg/analyzer/calloc-1.c: Add tests. * gcc.dg/analyzer/data-model-9.c: Update expected results. * gcc.dg/analyzer/pr96639.c: Update expected results. Signed-off-by: David

[PATCH 06/21] analyzer: fix ICE on division of tainted floating-point values [PR110700]

2024-05-09 Thread David Malcolm
-integral types. gcc/testsuite/ChangeLog: PR analyzer/110700 * gcc.dg/analyzer/taint-divisor-2.c: New test. (cherry picked from commit r14-2658-gb86c0fe327a519) Signed-off-by: David Malcolm --- gcc/analyzer/region-model-manager.cc| 3 ++- gcc/analyzer/sm-taint.cc

[PATCH 04/21] jit: avoid using __vector in testcase [PR110466]

2024-05-09 Thread David Malcolm
(run_test_of_comparison): Fix size param to gcc_jit_type_get_vector. (verify_comparisons): Use a typedef rather than __vector. (cherry picked from commit r14--g6735d660839533) Co-authored-by: Marek Polacek Signed-off-by: David Malcolm --- gcc/testsuite/jit.dg/test-expressions.c | 22

[pushed 00/21] Various backports to gcc 13 (analyzer, jit, diagnostics)

2024-05-09 Thread David Malcolm
c 13: r13-8760-g2a6f99aef7c852 * [pushed] diagnostics: fix corrupt json/SARIF on stderr [PR114348] * https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648048.html * (backported from commit r14-9554-g0bf99b1b7eda2f) gcc 13: r13-8761-gb7a2697733d19a David Malcolm (18): analyzer:

[PATCH 01/21] analyzer: add caching to globals with initializers [PR110112]

2024-05-09 Thread David Malcolm
::calc_svalue_for_constructor): New decl. (decl_region::m_ctor_svalue): New field. (cherry picked from commit r14-1664-gfe9771b59f576f) Signed-off-by: David Malcolm --- gcc/analyzer/region-model.cc | 25 + gcc/analyzer/region.cc | 71 +--- gcc/analyzer

[PATCH] testsuite: fix analyzer C++ failures on Solaris [PR111475]

2024-05-03 Thread David Malcolm
ze output for C vs C++. * c-c++-common/analyzer/signal-4a.c: Move back to... * gcc.dg/analyzer/signal-4a.c: ...here, dropping attempt to generalize output for C vs C++. * c-c++-common/analyzer/signal-4b.c: Move back to... * gcc.dg/analyzer/signal-4b.c: ...here

Re: [PATCH] c++: fix source printing for "required from here" message

2024-04-25 Thread David Malcolm
On Wed, 2024-04-24 at 17:05 -0400, Patrick Palka wrote: > On Wed, 24 Apr 2024, Jason Merrill wrote: > > > On 4/24/24 13:22, Patrick Palka wrote: > > > Tested on x86_64-pc-linux-gnu, full bootstrap+regtest in > > > progress, > > > does this look OK if successful? > > > > > > -- >8 -- > > > > > >

Re: [PATCH] v2: DOCUMENTATION_ROOT_URL vs. release branches [PR114738]

2024-04-24 Thread David Malcolm
On Wed, 2024-04-24 at 11:07 +0200, Jakub Jelinek wrote: > On Tue, Apr 23, 2024 at 07:07:17PM -0400, David Malcolm wrote: > > That sounds like a better approach; thanks. > > Attached below.  Tested by checking > ../configure --disable-bootstrap --enable-languages=c --disable-

Re: [PATCH] DOCUMENTATION_ROOT_URL vs. release branches [PR114738]

2024-04-23 Thread David Malcolm
On Tue, 2024-04-23 at 17:45 +0200, Jakub Jelinek wrote: > On Tue, Apr 23, 2024 at 11:40:55AM -0400, David Malcolm wrote: > > > So, I think at least for the MAJOR.MINOR.0 releases we want to > > > use > > > URLs like above rather than the trunk ones and we can us

Re: [PATCH] DOCUMENTATION_ROOT_URL vs. release branches [PR114738]

2024-04-23 Thread David Malcolm
On Wed, 2024-04-17 at 13:16 +0200, Jakub Jelinek wrote: > Hi! > > Starting with GCC 14 we have the nice URLification of the options > printed > in diagnostics, say for in > test.c:4:23: warning: format ‘%d’ expects argument of type ‘int’, but > argument 2 has type ‘long int’ [-Wformat=] > the

[pushed] analyzer: add SARIF property bag to -Wanalyzer-infinite-recursion

2024-04-10 Thread David Malcolm
t-sarif.h". (infinite_recursion_diagnostic::maybe_add_sarif_properties): New. Signed-off-by: David Malcolm --- gcc/analyzer/infinite-recursion.cc | 13 + 1 file changed, 13 insertions(+) diff --git a/gcc/analyzer/infinite-recursion.cc b/gcc/analyzer/infinite-recu

[pushed] analyzer: fixes to internal docs

2024-04-10 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-9897-g7f6599a201be2a. gcc/ChangeLog: * doc/analyzer.texi: Various tweaks. Signed-off-by: David Malcolm --- gcc/doc/analyzer.texi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

[pushed] analyzer: fix ICE on negative values for size_t [PR114472]

2024-04-10 Thread David Malcolm
fset. * store.cc (bit_range::intersects_p): Replace assertion with test. (bit_range::exceeds_p): Likewise. (bit_range::falls_short_of_p): Likewise. gcc/testsuite/ChangeLog: * c-c++-common/analyzer/out-of-bounds-pr114472.c: New test. Signed-off-by: David Malcolm ---

[pushed] analyzer: show size in SARIF property bag for -Wanalyzer-tainted-allocation-size

2024-04-10 Thread David Malcolm
r. Signed-off-by: David Malcolm --- gcc/analyzer/sm-taint.cc | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/sm-taint.cc b/gcc/analyzer/sm-taint.cc index 1d1e208fdf49..a9c6d4db43f4 100644 --- a/gcc/analyzer/sm-taint.cc +++ b/gcc/analyzer/sm-taint.cc @@

[pushed] analyzer, testuite: comment fixes

2024-04-10 Thread David Malcolm
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-9896-g082374f6570a31. gcc/testsuite/ChangeLog: * c-c++-common/analyzer/memset-1.c: Clarify some comments. Signed-off-by: David Malcolm --- gcc/testsuite/c-c++-common/analyzer/memset-1.c | 4 ++-- 1 file changed, 2

[pushed] testsuite: add some missing -fanalyzer to plugin tests

2024-04-10 Thread David Malcolm
NULL derefs. * gcc.dg/plugin/taint-CVE-2011-0521-2.c: Likewise. * gcc.dg/plugin/taint-CVE-2011-0521-3-fixed.c: Add missing -fanalyzer to options. * gcc.dg/plugin/taint-CVE-2011-0521-3.c: Likewise. Drop xfail. Signed-off-by: David Malcolm --- gcc/tests

[pushed] analyzer: add SARIF property bag to -Wanalyzer-infinite-loop

2024-04-10 Thread David Malcolm
t-sarif.h". (infinite_loop::to_json): New. (infinite_loop_diagnostic::maybe_add_sarif_properties): New. Signed-off-by: David Malcolm --- gcc/analyzer/infinite-loop.cc | 22 ++ 1 file changed, 22 insertions(+) diff --git a/gcc/analyzer/infinite-loop.cc b/gcc/ana

[pushed] analyzer: add SARIF property bags to -Wanalyzer-overlapping-buffers

2024-04-10 Thread David Malcolm
son): New decl. (symbolic_byte_range::to_json): New decl. Signed-off-by: David Malcolm --- gcc/analyzer/call-details.cc | 33 ++--- gcc/analyzer/ranges.cc | 15 +++ gcc/analyzer/ranges.h| 4 3 files changed, 49 insertions(+), 3 deletions(

[pushed] analyzer: respect GCC_COLORS in out-of-bounds diagrams [PR114588]

2024-04-05 Thread David Malcolm
C_COLORS. * text-art/style.cc: Include "diagnostic-color.h". (text_art::get_style_from_color_cap_name): New. * text-art/types.h (get_style_from_color_cap_name): New decl. Signed-off-by: David Malcolm --- gcc/analyzer/access-diagram.cc | 8 ++-- gcc/diagnosti

[PATCH 8/9] wwwdocs: gcc-14: analyzer improvements

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 162 + 1 file changed, 162 insertions(+) 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

[PATCH 6/9] wwwdocs: gcc-14: improvements to automatic doc URLs for options

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) 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

[PATCH 4/9] wwwdocs: gcc-14: c++: note changes to source quoting in template errors

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 7 +++ 1 file changed, 7 insertions(+) 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

[PATCH 9/9] wwwdocs: gcc-14: add 'Improvements to SARIF support' section

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 22 ++ 1 file changed, 22 insertions(+) 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

[PATCH 3/9] wwwdocs: gcc-14: add null_terminated_string_arg attribute

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 7 +++ 1 file changed, 7 insertions(+) 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

[PATCH 5/9] wwwdocs: gcc-14: libgccjit changes

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) 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

[PATCH 7/9] wwwdocs: gcc-14: improvements for plugin authors

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) 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

[PATCH 2/9] wwwdocs: gcc-14: add URLs to some options

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) 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

[pushed] wwwdocs: gcc-14: various changes

2024-04-04 Thread David Malcolm
I've taken the liberty of pushing the following changes to the GCC 14 release notes. Hope they look reasonable. David Malcolm (9): gcc-14: add caveat about not using analyzer on C++ gcc-14: add URLs to some options gcc-14: add null_terminated_string_arg attribute gcc-14: c++: note

[PATCH 1/9] wwwdocs: gcc-14: add caveat about not using analyzer on C++

2024-04-04 Thread David Malcolm
Signed-off-by: David Malcolm --- htdocs/gcc-14/changes.html | 4 1 file changed, 4 insertions(+) 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

[pushed] analyzer: prevent ICEs with null types

2024-04-02 Thread David Malcolm
ypes. * region-model.cc (apply_constraints_for_gswitch): Likewise. Signed-off-by: David Malcolm --- gcc/analyzer/region-model-manager.cc | 2 ++ gcc/analyzer/region-model.cc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/region-model-manager.cc b

Re: [PATCH] Allow `gcc_jit_type_get_size` to work with pointers

2024-03-29 Thread David Malcolm
On Thu, 2024-03-28 at 23:47 +0100, Guillaume Gomez wrote: > Hi, > > Here's a little fix to allow the `gcc_jit_type_get_size` function to > work on pointer types as well. > Thanks, looks good to me. Are you able to push this, or do you want me to? Dave

[pushed] analyzer: fix ICE due to type mismatch when replaying call summary [PR114473]

2024-03-27 Thread David Malcolm
4473 * gcc.dg/analyzer/call-summaries-pr114473.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/call-summary.cc | 12 +++ .../gcc.dg/analyzer/call-summaries-pr114473.c | 31 +++ 2 files changed, 43 insertions(+) create mode 100644 gcc/tests

[pushed] analyzer: fix ICE and false positive with -Wanalyzer-deref-before-check [PR114408]

2024-03-23 Thread David Malcolm
heck-pr114408.c: New test. * c-c++-common/ubsan/analyzer-ice-pr114408.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/engine.cc| 7 ++ gcc/analyzer/kf.cc| 22 +++ .../analyzer/deref-before-check-pr1144

[pushed] analyzer: look through casts in taint sanitization [PR112974, PR112975]

2024-03-22 Thread David Malcolm
74.c and taint-pr112975.c to analyzer_kernel_plugin.c. * gcc.dg/plugin/taint-pr112974.c: New test. * gcc.dg/plugin/taint-pr112975.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/sm-taint.cc | 8 +++ gcc/testsuite/gcc.dg/plugin/plugin.exp | 2 +

[pushed] analyzer: add SARIF property bags to taint diagnostics

2024-03-22 Thread David Malcolm
tainted_offset::m_offset): New. (region_model::check_region_for_taint): Pass offset to tainted_offset ctor. Signed-off-by: David Malcolm --- gcc/analyzer/sm-taint.cc | 50 +--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/gcc/an

[pushed] analyzer: fix ignored constraints involving casts [PR113619]

2024-03-21 Thread David Malcolm
Fix cast-handling from r14-3632-ge7b267444045c5 so that if those give an unknown result, we continue trying the constraint manager. gcc/testsuite/ChangeLog: PR analyzer/113619 * c-c++-common/analyzer/taint-divisor-pr113619.c: New test. Signed-off-by: David Malcolm ---

[pushed] analyzer: fix -Wanalyzer-deref-before-check false positive seen in loop header macro [PR109251]

2024-03-20 Thread David Malcolm
heck-pr109251-2.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/sm-malloc.cc | 30 ++ .../analyzer/deref-before-check-pr109251-1.c | 60 +++ .../analyzer/deref-before-check-pr109251-2.c | 37 3 files changed, 127 insertions(+) cr

[pushed] analyzer: fix ICE due to corrupt MEM_REFs [PR113505]

2024-03-19 Thread David Malcolm
From: Jakub Jelinek Jakub wrote this patch for PR analyzer/113505. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Successful run of analyzer integration tests on x86_64-pc-linux-gnu. Pushed to trunk as r14-9555-gc87f1f3d660f41. gcc/analyzer/ChangeLog PR analyzer/113505

[pushed] diagnostics: fix corrupt json/SARIF on stderr [PR114348]

2024-03-19 Thread David Malcolm
chine_readable_stderr_p): New pure virtual function. (diagnostic_text_output_format::machine_readable_stderr_p): New. (diagnostic_context::get_output_format): New accessor. Signed-off-by: David Malcolm --- gcc/diagnostic-format-json.cc | 8 gcc/diagnostic-

Re: ping: [PATCH] diagnostics: Fix behavior of permerror options after diagnostic pop [PR111918]

2024-03-19 Thread David Malcolm
On Tue, 2024-03-19 at 09:03 -0400, Lewis Hyatt wrote: > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638692.html Sorry about the delay. The patch looks good for trunk, assuming it's passed the usual bootstrap and regression testing. Thanks Dave > > Thanks! > > On Fri, Feb 16, 2024

Re: [PATCH] analyzer: Bail out on function pointer for -Wanalyzer-allocation-size

2024-03-19 Thread David Malcolm
On Tue, 2024-03-19 at 16:10 +0100, Stefan Schulze Frielinghaus wrote: > On s390 pr94688.c is failing due to excess error > > pr94688.c:6:5: warning: allocated buffer size is not a multiple of > the pointee's size [CWE-131] [-Wanalyzer-allocation-size] > > This is because on s390 functions are by

[pushed] analyzer: fixes to __atomic_{exchange, load, store} [PR114286]

2024-03-19 Thread David Malcolm
an user-facing signature. (class kf_atomic_load): Likewise. (class kf_atomic_store): New. (register_atomic_builtins): Register kf_atomic_store. gcc/testsuite/ChangeLog: PR analyzer/114286 * c-c++-common/analyzer/atomic-builtins-pr114286.c: New test. Signed

[pushed] analyzer: fix ICEs due to sloppy types in bounds-checking [PR110902, PR110928, PR111305, PR111441]

2024-03-18 Thread David Malcolm
expected diagram output. * c-c++-common/analyzer/out-of-bounds-diagram-pr110928.c: New test. * c-c++-common/analyzer/out-of-bounds-diagram-pr111305.c: New test. * c-c++-common/analyzer/out-of-bounds-diagram-pr111441.c: New test. Signed-off-by: David Malcolm --- gcc

[pushed] analyzer: support null operands in remove_ssa_names

2024-03-18 Thread David Malcolm
TREE, such as e.g. for COMPONENT_REF's operand 2. Signed-off-by: David Malcolm --- gcc/analyzer/access-diagram.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc index 2836308c019..a9c5c899950 100644 --- a/gcc/anal

Re: [PATCH] analyzer: Fix up some -Wformat* warnings

2024-03-07 Thread David Malcolm
On Thu, 2024-03-07 at 09:30 +0100, Jakub Jelinek wrote: > Hi! > > I'm seeing warnings like > ../../gcc/analyzer/access-diagram.cc: In member function ‘void > ana::bit_size_expr::print(pretty_printer*) const’: > ../../gcc/analyzer/access-diagram.cc:399:26: warning: unknown > conversion type

Frontend access to target features (was Re: [PATCH] libgccjit: Add ability to get CPU features)

2024-03-05 Thread David Malcolm
On Thu, 2023-11-09 at 19:33 -0500, Antoni Boucher wrote: > Hi. > See answers below. > > On Thu, 2023-11-09 at 18:04 -0500, David Malcolm wrote: > > On Thu, 2023-11-09 at 17:27 -0500, Antoni Boucher wrote: > > > Hi. > > > This patch adds support for getting the

Re: CI for "Option handling: add documentation URLs"

2024-03-05 Thread David Malcolm
On Tue, 2024-03-05 at 13:06 +0100, Mark Wielaard wrote: > Hi, > > On Mon, 2024-03-04 at 08:48 -0500, David Malcolm wrote: > > > I have now regenerated the patch to also include the new avr > > > mfuse- > > > add change. It would be nice

Re: CI for "Option handling: add documentation URLs"

2024-03-04 Thread David Malcolm
On Sun, 2024-03-03 at 21:04 +0100, Mark Wielaard wrote: > Hi, > > On Sat, Feb 24, 2024 at 06:42:58PM +0100, Mark Wielaard wrote: > > On Thu, Feb 22, 2024 at 11:57:50AM +0800, YunQiang Su wrote: > > > Mark Wielaard 于2024年2月19日周一 06:58写道: > > > > So, I did try the regenerate-opt-urls locally, and

[pushed] analyzer: fix ICE in call summarization [PR114159]

2024-02-29 Thread David Malcolm
const. * function.h (function_name): Likewise. gcc/testsuite/ChangeLog: PR analyzer/114159 * c-c++-common/analyzer/call-summaries-pr114159.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/analyzer.cc | 9 ++ gcc/analyzer/analyzer.h

Re: [PATCH] developer option: -fdump-generic-nodes; initial incorporation

2024-02-28 Thread David Malcolm
On Wed, 2024-02-28 at 08:58 +0100, Richard Biener wrote: > On Tue, Feb 27, 2024 at 10:20 PM Robert Dubner > wrote: > > > > Richard, > > > > Thank you very much for your comments. > > > > When I set out to create the capability, I had a "specification" in > > mind. > > > > I didn't have a clue

[pushed] analyzer: use correct format code for string literal indices [PR110483, PR111802]

2024-02-27 Thread David Malcolm
-9199-g939439a90f234f. gcc/analyzer/ChangeLog: PR analyzer/110483 PR analyzer/111802 * access-diagram.cc (string_literal_spatial_item::add_column_for_byte): Use %wu for printing unsigned HOST_WIDE_INT. Signed-off-by: David Malcolm --- gcc/analyzer/access-

[pushed] analyzer: fix ICE on floating-point bounds [PR111881]

2024-02-27 Thread David Malcolm
sert that m_constant has integral type. (range::add_bound): Bail out on floating point constants. gcc/testsuite/ChangeLog: PR analyzer/111881 * c-c++-common/analyzer/conditionals-pr111881.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/constraint-manage

[pushed] analyzer: handle array-initialization from a string_cst [PR113999]

2024-02-20 Thread David Malcolm
uite/ChangeLog: PR analyzer/113999 * c-c++-common/analyzer/strlen-pr113999.c: New test. * gcc.dg/analyzer/strlen-1.c: More test coverage. Signed-off-by: David Malcolm --- gcc/analyzer/analyzer.h | 3 ++ gcc/analyzer/region-model-manager.cc

[pushed] analyzer: handle empty ranges in symbolic_byte_range::intersection [PR113998]

2024-02-20 Thread David Malcolm
mpty ranges. (selftest::test_intersects): Add test coverage for empty ranges. gcc/testsuite/ChangeLog: PR analyzer/113998 * c-c++-common/analyzer/overlapping-buffers-pr113998.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/ranges.cc

Re: [PATCH] libgccjit: Add option to allow special characters in function names

2024-02-20 Thread David Malcolm
On Thu, 2024-02-15 at 17:08 -0500, Antoni Boucher wrote: > Hi. > This patch adds a new option to allow special characters like . and $ > in function names. > This is useful to allow for mangling using those characters. > Thanks for the review. Thanks for the patch. > diff --git

[pushed] analyzer: fix -Wanalyzer-va-arg-type-mismatch false +ve on int types [PR111289]

2024-02-19 Thread David Malcolm
t. * c-c++-common/analyzer/stdarg-pr111289-ptr.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/varargs.cc | 38 -- .../analyzer/stdarg-pr111289-int.c| 69 +++ .../analyzer/stdarg-pr111289-ptr.c| 39 ++

[pushed] analyzer, testsuite: add regression test [PR110520]

2024-02-19 Thread David Malcolm
Tested on x86_64-pc-linux-gnu. Pushed to trunk as r14-9075-geb37ea529745c3. gcc/testsuite/ChangeLog: PR analyzer/110520 * c-c++-common/analyzer/null-deref-pr110520.c: New test. Signed-off-by: David Malcolm --- gcc/testsuite/c-c++-common/analyzer/null-deref-pr110520.c | 8

[pushed] analyzer: remove offset_region size overloads [PR111266]

2024-02-15 Thread David Malcolm
PR analyzer/111266 * c-c++-common/analyzer/out-of-bounds-pr111266.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/region.cc| 48 --- gcc/analyzer/region.h | 20 .../analyzer/out-of-bounds-pr111266.c

Re: [PATCH] libgccjit: Clear pending_assemble_externals_processed

2024-02-15 Thread David Malcolm
t; > On Thu, 2024-02-15 at 10:35 -0500, David Malcolm wrote: > > On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote: > > > Hi. > > > This patch fixes the bug 113842. > > > I cannot yet add a test with this patch since it requires using > > >

Re: [PATCH] libgccjit: Add count zeroes builtins to ensure_optimization_builtins_exist

2024-02-15 Thread David Malcolm
On Thu, 2024-02-15 at 11:32 -0500, Antoni Boucher wrote: > Hi. > This patch adds some missing builtins that can be generated by > optimizations. > I'm not sure how to add a test for this one. > Do you know the C code that can be optimized to a builtin_clz? I don't. Given a reproducer we could

Re: [PATCH] libgccjit: Clear pending_assemble_externals_processed

2024-02-15 Thread David Malcolm
On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote: > Hi. > This patch fixes the bug 113842. > I cannot yet add a test with this patch since it requires using > try/catch which is not yet merged in master. > Thanks for the review. Thanks; patch looks good for trunk, assuming you've tested it

Re: [PATCH] analyzer/pr104308.c: Avoid optimizing away the copies

2024-02-14 Thread David Malcolm
On Tue, 2022-05-03 at 17:29 -0700, Palmer Dabbelt wrote: > The test cases in analyzer/pr104308.c use uninitialized values in a > way > that doesn't plumb through to the return value of the function.  This > allows the accesses to be deleted, which can result in the diagnostic > not firing.

Re: [PATCH] coreutils-sum-pr108666.c: fix spurious LLP64 warnings

2024-02-14 Thread David Malcolm
On Fri, 2024-02-02 at 23:55 +, Jonathan Yong wrote: > Attached patch OK? Fixes the following warnings: Thanks; looks good to me. Dave > coreutils-sum-pr108666.c:17:1: warning: conflicting types for built- > in function ‘memcpy’; expected ‘void *(void *, const void *, long > long unsigned

[pushed] diagnostics: unbreak 'make gcc.pot'

2024-02-12 Thread David Malcolm
On Fri, 2024-02-09 at 16:53 +, Joseph Myers wrote: > On Fri, 1 Dec 2023, David Malcolm wrote: > > * diagnostic-core.h (emit_diagnostic_valist): New overload > decl. > > This has broken regeneration of gcc.pot (overloads can't have the > message > e

[pushed] analyzer: fix skipping of debug stmts [PR113253]

2024-01-31 Thread David Malcolm
Skip any debug stmts in the FOR_EACH_IMM_USE_FAST list. * supergraph.cc (supergraph::supergraph): Don't add debug stmts to the supernodes. gcc/testsuite/ChangeLog: PR analyzer/113253 * gcc.dg/analyzer/deref-before-check-pr113253.c: New test. Signed-off-by: D

[pushed] analyzer: handle null "var" in state_change_event::get_desc [PR113509]

2024-01-30 Thread David Malcolm
yzer/113509 * checker-event.cc (state_change_event::get_desc): Don't assume "var" is non-NULL. gcc/testsuite/ChangeLog: PR analyzer/113509 * c-c++-common/analyzer/stdarg-pr113509.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/ch

[pushed] analyzer: fix -Wanalyzer-allocation-size false +ve on Linux kernel's round_up macro [PR113654]

2024-01-30 Thread David Malcolm
le_p): New. (is_dubious_capacity): New. (region_model::check_region_size): Move usage of size_visitor into is_dubious_capacity. gcc/testsuite/ChangeLog: PR analyzer/113654 * c-c++-common/analyzer/allocation-size-pr113654-1.c: New test. Signed-off-by: D

[pushed] analyzer: add SARIF property bag to -Wanalyzer-allocation-size

2024-01-30 Thread David Malcolm
apacity svalue to dubious_allocation_size ctor. Signed-off-by: David Malcolm --- gcc/analyzer/region-model.cc | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index dbb2149dbd46..ba82f46c1887 10

  1   2   3   4   5   6   7   8   9   10   >