[pushed: r15-8994-g1ee9caf2f84832] libstdc++-v3 testsuite: fix malformed dg-require-static-libstdcxx directives

2025-03-27 Thread David Malcolm
I believe these don't get detected by DejaGnu's regexp. Found by dg-lint. Pushed to trunk as r15-8994-g1ee9caf2f84832. libstdc++-v3/ChangeLog: * testsuite/17_intro/shared_with_static_deps.cc: Fix malformed dg-require-static-libstdcxx directive. * testsuite/17_intro/static

[pushed: r15-8993] testsuite: fix some malformed dg-require-* directives

2025-03-27 Thread David Malcolm
Pushed to trunk as r15-8993-gc88abca94a6abb. gcc/testsuite/ChangeLog: * g++.dg/abi/pure-virtual1.C: Fix dg-require-weak directive. * g++.target/i386/mangling-alias1.C: Fix dg-require-ifunc directive. --- gcc/testsuite/g++.dg/abi/pure-virtual1.C| 2 +- gcc/testsuite

[pushed: r15-8992] v2: contrib: add dg-lint and libgdiagnostics.py [PR116163]

2025-03-27 Thread David Malcolm
ntrib/dg-lint/dg-lint create mode 100644 contrib/dg-lint/libgdiagnostics.py create mode 100644 contrib/dg-lint/test-1.c create mode 100644 contrib/dg-lint/test-2.c diff --git a/contrib/dg-lint/dg-lint b/contrib/dg-lint/dg-lint new file mode 100755 index ..01d58d7a3e95 --- /dev/null +++ b/cont

[PATCH 04/12] testsuite, aarch64: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/aarch64/atomic-inst-ldlogic.c: Add missing trailing " }" for 2 dg-final directives. * gcc.target/aarch64/saturating_arithmetic_1.c: Fix dg-do compile. * gcc.target/aarch64/saturating_arithmetic_2.c: Likewise. -

Re: [PATCH 01/12] contrib: add dg-lint and libgdiagnostics.py [PR116163]

2025-03-26 Thread David Malcolm
On Wed, 2025-03-26 at 19:59 +0100, Jakub Jelinek wrote: > On Wed, Mar 26, 2025 at 02:34:43PM -0400, David Malcolm wrote: > > Thanks for working on this. > My python is very limited, so just adding some comments rather > than doing patch review. > > > +COMMON_MISSPELL

[PATCH 06/12] testsuite, arm: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/arm/cmse/cmse-17.c: Fix missing space before trailing "}" in dg-options. * gcc.target/arm/short-vfp-1.c: Likewise for dg-final; also after leading "{", in 5 places. --- gcc/testsuite/gcc.target/arm/cmse/cmse-1

[PATCH 11/12] testsuite, riscv: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/riscv/cmo-zicbop-1.c: Fix missing space before trailing } in dg-do directive. * gcc.target/riscv/cmo-zicbop-2.c: Likewise. * gcc.target/riscv/prefetch-zicbop.c: Likewise. * gcc.target/riscv/prefetch-zih

[PATCH 01/12] contrib: add dg-lint and libgdiagnostics.py [PR116163]

2025-03-26 Thread David Malcolm
bgdiagnostics.py create mode 100644 contrib/dg-lint/test-1.c create mode 100644 contrib/dg-lint/test-2.c diff --git a/contrib/dg-lint/dg-lint b/contrib/dg-lint/dg-lint new file mode 100755 index ..20157c304137 --- /dev/null +++ b/contrib/dg-lint/dg-lint @@ -0,0 +1,210 @@ +#!/usr/bin/env pyt

[PATCH 12/12] testsuite, s390: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/s390/target-attribute/tattr-1.c: Fix missing trailing close brace on dg-do directive. * gcc.target/s390/target-attribute/tattr-2.c: Likewise. --- gcc/testsuite/gcc.target/s390/target-attribute/tattr-1.c | 2 +- gcc/te

[PATCH 10/12] testsuite, powerpc: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr70243.c: Fix missing trailing " }" in dg-do directive. * gcc.target/powerpc/pr91903.c: Likewise. --- gcc/testsuite/gcc.target/powerpc/pr70243.c | 2 +- gcc/testsuite/gcc.target/powerpc/pr91903.c | 2 +- 2 fi

[PATCH 07/12] testsuite, bfin: fix broken dg directive

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/bfin/l2.c: Fix missing space before trailing "}" in dg-bfin-processors directive. --- gcc/testsuite/gcc.target/bfin/l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/bfin/l2.c

[PATCH 09/12] testsuite, ia64: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/ia64/mfused-madd-vect.c: Fix missing trailing " }" in dg-do directive. * gcc.target/ia64/mfused-madd.c: Likewise. * gcc.target/ia64/mno-fused-madd.c: Likewise. --- gcc/testsuite/gcc.target/ia64/mfused-madd-vec

[PATCH 08/12] testsuite, i386: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/i386/addr-space-1.c: Add missing trailing } to dg-do directive. * gcc.target/i386/strub-pr118006.c: Fix ordering of dg-do and dg-require- directive so that dg-do is first. --- gcc/testsuite/gcc.target/i386/add

[PATCH 02/12] testsuite: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.dg/ipa/pr110377.c: Fix missing trailing " }" in dg-do directive. * gcc.dg/plugin/infoleak-1.c: Fix dg-bogus directive. * gcc.dg/pr101364-1.c: Fix missing trailing " }" in dg-options directive. * gcc.dg

[PATCH 05/12] testsuite, arc: fix broken dg directives

2025-03-26 Thread David Malcolm
Found by dg-lint. gcc/testsuite/ChangeLog: * gcc.target/arc/taux-1.c: Fix missing trailing '" }' from dg-options. * gcc.target/arc/taux-2.c: Likewise. --- gcc/testsuite/gcc.target/arc/taux-1.c | 2 +- gcc/testsuite/gcc.target/arc/taux-2.c | 2 +- 2 files changed, 2 inserti

[PATCH 03/12] testsuite, gomp: fix broken dg directives

2025-03-26 Thread David Malcolm
gcc/testsuite/ChangeLog: * c-c++-common/gomp/metadirective-target-device-2.c: Fix missing trailing " }" on dg-do directive. * gcc.dg/gomp/attrs-21.c: Likewise for dg-options. * gcc.dg/gomp/parallel-2.c: Drop ":" from dg-message. --- gcc/testsuite/c-c++-common/gomp/m

[PATCH 00/12] Implement a new dg-lint tool and use on our testsuite

2025-03-26 Thread David Malcolm
only tested the testsuite fixes on x86_64-pc-linux-gnu; there were some new PASSes and no regressions, but I haven't tested the tests on non-x86 archs. Thoughts? David Malcolm (12): contrib: add dg-lint and libgdiagnostics.py [PR116163] testsuite: fix broken dg directives testsuite, gomp:

[pushed: r15-8447] diagnostics: fix crash in urlifier with -Wfatal-errors [PR119366]

2025-03-19 Thread David Malcolm
diagnostic_context's dtor assumed that it owned the m_urlifier pointer and would delete it. As of r15-5988-g5a022062d22e0b this isn't always the case - auto_urlify_attributes is used in various places in the C/C++ frontends and in the middle-end to temporarily override the urlifier with an on-stac

Re: [PATCH]cobol: create new gcc/testsuite/cobol.dg/group1/check_88.cob test

2025-03-16 Thread David Malcolm
On Sat, 2025-03-15 at 16:14 -0500, Robert Dubner wrote: > This works on a x86_64-linux machine, although I had to do a complete > rebuild to make it take. > > If this meets with the approval of the global reviewers, please apply > it, > with a suitable commit message. > > The main characteristic

Re: [PATCH] analyzer: Fix ICE in cmp_csts_same_type on RAW_DATA_CST [PR119278]

2025-03-14 Thread David Malcolm
On Fri, 2025-03-14 at 15:22 +0100, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs in cmp_csts_same_type because > RAW_DATA_CST > isn't handled there.  As TREE_TYPE (cst1) in that case is > INTEGER_TYPE, > e.g. char/signed char/unsigned char, the type itself doesn't imply > the size, so

Re: [PATCH][v3] Simple cobol.dg testsuite

2025-03-13 Thread David Malcolm
On Thu, 2025-03-13 at 12:11 +0100, Simon Sobisch wrote: > Thanks for your work on adding a testsuite. Can you please explain > why > you do this when a complete testsuite exists in autoconf (autotest) > format (which roots back to decade of work in GnuCOBOL, with all > copyrights for that alread

[PATCH v2] cobol: capture source ranges for tokens, rather than just points (v2)

2025-03-12 Thread David Malcolm
Here's an updated version of this patch which adds a testcase to the DejaGnu test suite, using *<< and *>> for a multiline comment (used to express a fragment of the expected output on stderr). Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu, but I *haven't* tested this patch with th

[pushed: r15-8016] analyzer: support RAW_DATA_CST [PR117262]

2025-03-12 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-8016-g8015a72ae49640. gcc/analyzer/ChangeLog: PR analyzer/117262 * region-model-manager.cc (region_model_manager::get_or_create_constant_svalue): Use NULL_TREE for the types of con

Re: The COBOL front end, version 3, now in 14 easy pieces

2025-03-12 Thread David Malcolm
On Wed, 2025-03-12 at 12:09 +0100, Mark Wielaard wrote: > Hi David, > > On Mon, Mar 10, 2025 at 05:40:18PM -0400, David Malcolm wrote: > > FWIW gcc/cobol/lang.opt.urls has some D-specific things that look > > like > > copy-and-paste cruft, but hopefully it won'

Re: The COBOL front end, version 3, now in 14 easy pieces

2025-03-11 Thread David Malcolm
On Mon, 2025-03-10 at 19:07 +0100, Richard Biener wrote: > On Mon, Mar 10, 2025 at 5:34 PM Richard Biener > wrote: > > > > On Sat, Mar 8, 2025 at 12:12 AM Robert Dubner > > wrote: > > > > > > Richard and Jakub, and everybody else who has offered advice and > > > help > > > > > > I trust you re

Re: [PATCH/RFC] cobol: capture source ranges for tokens, rather than just points

2025-03-11 Thread David Malcolm
On Tue, 2025-03-11 at 11:47 -0400, David Malcolm wrote: > This patch changes the output on the simple test I tried from: > > $ ./gcobol -B. hello.cob -S > hello.cob:2:8: error: syntax error, unexpected NAME, expecting > FUNCTION or PROGRAM-ID >     2 |   

[PATCH/RFC] cobol: capture source ranges for tokens, rather than just points

2025-03-11 Thread David Malcolm
This patch changes the output on the simple test I tried from: $ ./gcobol -B. hello.cob -S hello.cob:2:8: error: syntax error, unexpected NAME, expecting FUNCTION or PROGRAM-ID 2 |porgram-id. hello. |^ cobol1: error: failed compiling hello.cob to: $ ./gcobol -B. hello.

Re: Allow to build libgccjit with a soname bound to the GCC major version

2025-03-05 Thread David Malcolm
On Sat, 2025-02-08 at 10:33 +0100, Matthias Klose wrote: > When configuring GCC with --program-suffix=-$(BASE_VERSION) to allow > installation multiple GCC versions in parallel, the executable of the > driver (gcc-$(BASE_VERSION)) gets recorded in the libgccjit.so.0 > library.  Assuming, that you

Re: [PATCH] simple-diagnostic-path: Inline two trivial methods [PR116143]

2025-02-26 Thread David Malcolm
On Wed, 2025-02-26 at 09:44 +0100, Jakub Jelinek wrote: > Hi! > > Various plugin tests fail with --enable-checking=release, because the > num_events and num_threads methods of simple_diagnostic_path are only > used > inside of #if CHECKING_P code inside of GCC proper and then tested > inside of >

[pushed: r15-7659] diagnostics: add comments about global_dc

2025-02-20 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-7659-g4e9ee99647ebb9. gcc/ChangeLog: * diagnostic-core.h: Add comments making clear that these functions implicitly use global_dc. Signed-off-by: David Mal

[pushed: r15-7658] sarif-replay: add testcase for empty input file

2025-02-20 Thread David Malcolm
Successfully tested on x86_64-pc-linux-gnu. Pushed to trunk as r15-7658-gc5f541e40aca2d gcc/testsuite/ChangeLog: * sarif-replay.dg/malformed-json/empty.sarif: New test. Signed-off-by: David Malcolm --- gcc/testsuite/sarif-replay.dg/malformed-json/empty.sarif | 2 ++ 1 file changed, 2

[pushed: r15-7657] sarif-replay: improve error for unescaped braces in messages (§3.11.5)

2025-02-20 Thread David Malcolm
...this. Update expected subsection in error message, and expected underline in quoted JSON. Signed-off-by: David Malcolm --- gcc/libsarifreplay.cc | 43 +-- ...er.sarif => 3.11.5-unescaped-braces.sarif} | 4 +- 2 files changed, 33 inserti

[pushed: r15-7626] analyzer: handle more IFN_UBSAN_* as no-ops [PR118300]

2025-02-19 Thread David Malcolm
* gcc.dg/analyzer/ubsan-pr118300.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/kf.cc| 22 ++- .../gcc.dg/analyzer/ubsan-pr118300.c | 15 + 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 gcc/testsui

[pushed: r15-7627] input: give file_cache_slot its own copy of the file path [PR118919]

2025-02-19 Thread David Malcolm
ache_slot::create): Store a copy of file_path if non-null. (file_cache_slot::~file_cache_slot): Free m_file_path. Signed-off-by: David Malcolm --- gcc/input.cc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/input.cc b/gcc/input.cc index f0eacf59c8e2..440

[pushed: r15-7611] analyzer: add more properties to sarif output

2025-02-18 Thread David Malcolm
* region-model.cc (poisoned_value_diagnostic::maybe_add_sarif_properties): New. Signed-off-by: David Malcolm --- gcc/analyzer/diagnostic-manager.cc | 26 +- gcc/analyzer/region-model.cc | 13 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/gcc/

[pushed: r15-7610] sarif output: fix alphabetization in sarif_scheme_handler::make_sink

2025-02-18 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r15-7610-g196e8dbddc509c. Signed-off-by: David Malcolm gcc/ChangeLog: * opts-diagnostic.cc (sarif_scheme_handler::make_sink): Put properties in alphabetical o

Re: [PATCH] COBOL 6/15 156K lex: lexer

2025-02-17 Thread David Malcolm
On Mon, 2025-02-17 at 12:42 -0500, James K. Lowden wrote: > On Sat, 15 Feb 2025 23:32:37 -0500 > David Malcolm wrote: > > > > +  free(copier); > > > > There?s a manual free of "copier" here, but there?s are various > > error- > > handling

Re: [PATCH] COBOL 6/15 156K lex: lexer

2025-02-17 Thread David Malcolm
On Mon, 2025-02-17 at 12:29 -0500, James K. Lowden wrote: > On Sat, 15 Feb 2025 23:32:37 -0500 > David Malcolm wrote: > > In defense of lack of free(3) ... > > > > +const char * > > > +esc( size_t len, const char input[] ) { > > > +  static char spaces[

Re: [PATCH] COBOL 8/15 360K cbl: parser support

2025-02-17 Thread David Malcolm
On Mon, 2025-02-17 at 12:49 -0500, James K. Lowden wrote: > On Sat, 15 Feb 2025 23:37:20 -0500 > David Malcolm wrote: > > > +const char * > > +cobol_get_sarif_source_language(const char *) > > +    { > > +    return "cobol"; > > +    } > &

Re: [PATCH] COBOL 7/15 492K par: parser

2025-02-17 Thread David Malcolm
On Mon, 2025-02-17 at 13:42 -0500, James K. Lowden wrote: > On Sat, 15 Feb 2025 23:35:16 -0500 > David Malcolm wrote: > > On better messages ... > > > +  if( ($$ & $2) == $2 ) { > > +    error_msg(@

Re: [PATCH] COBOL 8/15 360K cbl: parser support

2025-02-17 Thread David Malcolm
On Mon, 2025-02-17 at 12:42 -0500, James K. Lowden wrote: > On Sat, 15 Feb 2025 23:37:20 -0500 > David Malcolm wrote: > > > +  rich_location richloc (line_table, token_location); > > +  bool ret = global_dc->diagnostic_impl (&ric

Re: The COBOL front end, version 2, in 15-part harmony

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:00 -0500, James K. Lowden wrote: > The following 15 patches constitute 134,033 lines of code in 97 files > to build and document the COBOL front end.  The messages are > grouped by files in a more or less logical order. We have: I've replied to some of the patches with com

Re: [PATCH] COBOL 10/15 252K gen: GENERIC interface support

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:02 -0500, James K. Lowden wrote: > From 5d53920602e234e4d99ae2d502e662ee3699978e 4 Oct 2024 12:01:22 - > 0400 > From: "James K. Lowden" > Date: Sat 15 Feb 2025 12:50:53 PM EST > Subject: [PATCH] 3 new 'cobol' FE files > > gcc/cobol/ChangeLog > * gengen.cc: New file.

Re: [PATCH] COBOL 9/15 532K api: GENERIC interface

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:02 -0500, James K. Lowden wrote: > From 5d53920602e234e4d99ae2d502e662ee3699978e 4 Oct 2024 12:01:22 - > 0400 > From: "James K. Lowden" > Date: Sat 15 Feb 2025 12:50:53 PM EST > Subject: [PATCH] 2 new 'cobol' FE files > > gcc/cobol/ChangeLog > * genapi.cc: New file.

Re: [PATCH] COBOL 8/15 360K cbl: parser support

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:01 -0500, James K. Lowden wrote: > From 5d53920602e234e4d99ae2d502e662ee3699978e 4 Oct 2024 12:01:22 - > 0400 > From: "James K. Lowden" > Date: Sat 15 Feb 2025 12:50:53 PM EST > Subject: [PATCH] 9 new 'cobol' FE files > > gcc/cobol/ChangeLog > * cdf.y: New file. >

Re: [PATCH] COBOL 7/15 492K par: parser

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:01 -0500, James K. Lowden wrote: > From 5d53920602e234e4d99ae2d502e662ee3699978e 4 Oct 2024 12:01:22 - > 0400 > From: "James K. Lowden" > Date: Sat 15 Feb 2025 12:50:53 PM EST > Subject: [PATCH] 1 new 'cobol' FE file > + if( ($$ & $2) == $2 ) { +

Re: [PATCH] COBOL 6/15 156K lex: lexer

2025-02-15 Thread David Malcolm
On Sat, 2025-02-15 at 16:01 -0500, James K. Lowden wrote: > From 5d53920602e234e4d99ae2d502e662ee3699978e 4 Oct 2024 12:01:22 - > 0400 > From: "James K. Lowden" > Date: Sat 15 Feb 2025 12:50:52 PM EST > Subject: [PATCH] 3 new 'cobol' FE files > [...] > +/* > + * Replace any separators in the co

[pushed: r15-7564] sarif-replay: handle the 'fixes' property (§3.27.30)

2025-02-15 Thread David Malcolm
play.dg/2.1.0-valid/3.27.30-fixes-2.sarif: New test. * sarif-replay.dg/2.1.0-valid/3.27.30-fixes-3.sarif: New test. Signed-off-by: David Malcolm --- gcc/libsarifreplay.cc | 117 +- .../2.1.0-valid/3.27.30-fixes-1.sarif | 55 .../

[pushed: r15-7563] sarif-replay: don't add trailing " [error]"

2025-02-15 Thread David Malcolm
remove trailing " [error]". * sarif-replay.dg/2.1.0-valid/unlabelled-secondary-locations.sarif: Likewise. Signed-off-by: David Malcolm --- gcc/libsarifreplay.cc | 19 ++- .../2.1.0-valid/3.28.6-annotations-1.sarif| 3 +-- .../unlabelled-s

[pushed: r15-7561] sarif-replay: display annotations as labelled ranges (§3.28.6) [PR118881]

2025-02-15 Thread David Malcolm
flow_location_object): Pass nullptr for annotations. (sarif_replayer::handle_location_object): Handle §3.28.6 "annotations" property, using it to populate a new "out_annotations" param. gcc/testsuite/ChangeLog: PR sarif-replay/118881 * sarif-replay.dg/2

[pushed: r15-7562] sarif-replay: handle relatedLocations without messages (§3.27.22)

2025-02-15 Thread David Malcolm
relatedLocations without messages as secondary ranges within the diagnostic. Doing so requires stashing the notes until after the diagnostic has been finished, so that relatedLocations can be walked in one pass. gcc/testsuite/ChangeLog: * sarif-replay.dg/2.1

Re: [PATCH] analyzer: Handle nonnull_if_nonzero attribute [PR117023]

2025-02-14 Thread David Malcolm
On Thu, 2024-11-14 at 11:19 +0100, Jakub Jelinek wrote: > Hi! Hi; sorry for the delay in responding to this. > > On top of the > https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668554.html > patch which introduces the nonnull_if_nonzero attribute (because > C2Y is allowing NULL arguments

[pushed: r15-7515] jit: add "final override" to diagnostic sink [PR116613]

2025-02-13 Thread David Malcolm
R other/116613 * dummy-frontend.cc (jit_diagnostic_listener::on_report_diagnostic): Add "final override". Signed-off-by: David Malcolm --- gcc/jit/dummy-frontend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit

[pushed: r15-7474] sarif-replay: fix off-by-one in handling of "endColumn" (§3.30.8) [PR118792]

2025-02-11 Thread David Malcolm
quot; property. * sarif-replay.dg/2.1.0-valid/malloc-vs-local-4.c.sarif: Likewise. * sarif-replay.dg/2.1.0-valid/signal-1.c.moved.sarif: Likewise. * sarif-replay.dg/2.1.0-valid/signal-1.c.sarif: Likewise. Signed-off-by: David Malcolm --- gcc/libsarifreplay.cc | 2

Re: [PATCH v2 4/7] Add a cache of recent lines

2025-02-07 Thread David Malcolm
On Sun, 2025-02-02 at 21:47 -0800, Andi Kleen wrote: > > > > If I reading this right, calls to get_next_line lead to insertions > > into > > the ring buffer whilst the buffer is empty or the last line in the > > ring > > buffer cache is m_line_num - 1. > > > > There are a few places where we upda

[pushed: r15-7317] sarif-replay: support "cached" logical locations [§3.33.3]

2025-02-01 Thread David Malcolm
pec-example-4.sarif: Update expected output to reflect that we now find the function name for the events in the path. Signed-off-by: David Malcolm --- gcc/libsarifreplay.cc | 70 +-- .../3.33.3-index-out-of-range.sarif | 32 + ..

Re: [PATCH v3 1/2] c++: improve location of parsed RETURN_EXPRs

2025-01-30 Thread David Malcolm
On Wed, 2024-08-21 at 16:05 -0400, Jason Merrill wrote: > On 8/21/24 3:34 PM, Arsen Arsenović wrote: > > Jason Merrill writes: > > > > > On 8/21/24 1:52 PM, Arsen Arsenović wrote: > > > > For clarity, here's the entire split-up patch I intend to push, > > > > if it > > > > looks OK.  Tested on x8

Re: [PATCH v2] get source line for diagnostic from preprocessed file [PR preprocessor/79106]

2025-01-30 Thread David Malcolm
On Thu, 2025-01-30 at 12:01 +, Bader, Lucas wrote: > Thanks a lot for your detailed feedback! > I will rework my patch, especially to make the > get_source_line_preprocessed function > more readable and more efficient. > > Some comments in the mean time: > > > This may sound silly, but please

Re: [PATCH v2] wwwdocs: add a Python postprocessing script

2025-01-29 Thread David Malcolm
On Thu, 2025-01-30 at 00:31 +0800, Gerald Pfeifer wrote: > On Fri, 24 Jan 2025, David Malcolm wrote: > > Changed in v2: rather than replacing "mhc", this version runs the > > output from mhc through the Python script. > > Unless I'm missing something tha

Re: [PATCH v2] get source line for diagnostic from preprocessed file [PR preprocessor/79106]

2025-01-29 Thread David Malcolm
On Wed, 2025-01-29 at 09:16 -0500, David Malcolm wrote: > On Wed, 2025-01-29 at 13:05 +, Bader, Lucas wrote: > > Hi, > > > > as discussed, I rebased and tested my patch against current master. > > Additionally, it now has the Signed-off-by tag. > >

Re: [PATCH v2] get source line for diagnostic from preprocessed file [PR preprocessor/79106]

2025-01-29 Thread David Malcolm
On Wed, 2025-01-29 at 13:05 +, Bader, Lucas wrote: > Hi, > > as discussed, I rebased and tested my patch against current master. > Additionally, it now has the Signed-off-by tag. > Looking forward to your comments. > > Best > Lucas Thanks for the updated patch. Various notes inline througho

Re: [PATCH] get source line for diagnostic from preprocessed file / PR preprocessor/79106

2025-01-28 Thread David Malcolm
On Mon, 2019-12-16 at 11:18 +, Bader, Lucas wrote: > Hello, Hi Lucas. Thanks for the patch, and sorry for not seeing this patch before and thus the long delay in reviewing it. I started reviewing this and have various comments (mostly about introducing subroutines to simplify the logic), but

Re: [PATCH v2 2/7] Rebalance file_cache input line cache dynamically

2025-01-28 Thread David Malcolm
On Mon, 2025-01-27 at 15:26 -0500, David Malcolm wrote: [...snip..] > > > > I spent some time stepping through this to get clear in my mind how > the > new algorithm works.  FWIW I found the patch below helpful, to > clarify > in dumps about the slot index versus the

[pushed: r15-7255] sarif output: escape braces in messages [PR118675]

2025-01-28 Thread David Malcolm
ChangeLog: PR other/118675 * gcc.dg/sarif-output/bad-binary-op.py: Update expected output for escaping of braces in message text. * gcc.dg/sarif-output/missing-semicolon.py: Likewise. * gcc.dg/sarif-output/multiple-outputs.py: Likewise. Signed-off-by: David Malcolm -

Re: [PATCH v2 6/7] Enable vectorization for input.cc find_end_of_line function

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:31 -0800, Andi Kleen wrote: > From: Andi Kleen > > This is the hot function in input.cc > > The vectorizer can vectorize it now, but in a generic cpu O2 x86 > build it isn't. > Add a automatic target clone to handle it for x86 and build > that function with O3. > > The

Re: [PATCH v2 5/7] Size input line cache based on file size

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:30 -0800, Andi Kleen wrote: > From: Andi Kleen > > While the input line cache size now tunable it's better if the > compiler > auto tunes it. Otherwise large files needing random file access will > still have to search many lines to find the right lines. > > Add support

Re: [PATCH v2 4/7] Add a cache of recent lines

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:30 -0800, Andi Kleen wrote: > From: Andi Kleen > > For larger files the file_cache line index will be spread out to make > the index fit into the fixed buffer, so any access to the non latest > line > will need some skipping of lines. > > Most accesses for line are near

Re: [PATCH v2 3/7] Remove m_total_lines support from input cache

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:30 -0800, Andi Kleen wrote: > From: Andi Kleen > > With the new cache maintenance algorithm we don't need the > maximum number of lines anymore. Remove all the code for that. > > gcc/ChangeLog: > > PR preprocessor/118168 > * input.cc (total_lines_num): Remov

Re: [PATCH v2 2/7] Rebalance file_cache input line cache dynamically

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:30 -0800, Andi Kleen wrote: > From: Andi Kleen > > The input context file_cache maintains an array of anchors > to speed up accessing lines before the previous line. > The array has a fixed upper size and the algorithm relies > on the linemap reporting the maximum number

Re: [PATCH v2 1/7] Add tunables for input buffer

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:30 -0800, Andi Kleen wrote: > From: Andi Kleen > > The input machinery to read the source code independent of the lexer > has a range of hard coded maximum array sizes that can impact > performance. > Make them tunable. > > input.cc is part of libcommon so it cannot dire

Re: [PATCH v2 7/7] Add a unit test for random access in the file cache

2025-01-27 Thread David Malcolm
On Sat, 2025-01-25 at 23:31 -0800, Andi Kleen wrote: > From: Andi Kleen Thanks for writing the test case! Some nitpicks... > > gcc/ChangeLog: > > * input.cc (check_line): New. > (test_replacement): New function to test line caching. > (input_cc_tests): Call test_replacement

Re: [PATCH v2 7/7] Add a unit test for random access in the file cache

2025-01-27 Thread David Malcolm
On Mon, 2025-01-27 at 11:25 -0500, David Malcolm wrote: > On Sat, 2025-01-25 at 23:31 -0800, Andi Kleen wrote: > > From: Andi Kleen > > Thanks for writing the test case! > > Some nitpicks... > > > > > > gcc/ChangeLog: > > > > * input.cc

[PATCH v2] wwwdocs: add a Python postprocessing script

2025-01-24 Thread David Malcolm
Changed in v2: rather than replacing "mhc", this version runs the output from mhc through the Python script. I tested this via "MHC=cat", and the output appears identical to the previous build I uploaded to: https://dmalcolm.fedorapeople.org/gcc/2025-01-15/htdocs/ You can see e.g. the easily cli

[pushed: r15-7178] sarif-replay: respect prefix and suffix during installation [PR117670]

2025-01-24 Thread David Malcolm
arif-replay. Signed-off-by: David Malcolm --- gcc/Makefile.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 51c25b06e081..a8e32e25cf54 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -4215,9 +4215,10 @@ libgdiagnostics.ins

[pushed: r15-7179] jit: fix for write_reproducer [PR117886]

2025-01-24 Thread David Malcolm
test-pr117886-write-reproducer.c: New test. Signed-off-by: David Malcolm --- gcc/jit/jit-recording.cc | 10 +- gcc/testsuite/jit.dg/all-non-failing-tests.h | 10 ++ .../jit.dg/test-pr117886-write-reproducer.c | 103 ++ 3 files changed, 121 insertions(+), 2 delet

Re: [pushed: r15-7126] jit: fix startup on aarch64

2025-01-23 Thread David Malcolm
your thoughts on this? I'll take another look at PR 117886 now and see if I can implement something. Dave > > Thanks. > > Le 2025-01-22 à 08 h 38, David Malcolm a écrit : > > libgccjit fails on startup on aarch64 (and probably other archs). > > >

[pushed: r15-7126] jit: fix startup on aarch64

2025-01-22 Thread David Malcolm
r call to tree_type_to_jit_type fails. Don't abort on unknown types. (jit_langhook_pushdecl): Replace gcc_unreachable with return of NULL_TREE. Signed-off-by: David Malcolm --- gcc/jit/dummy-frontend.cc | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) di

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated

[PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-15 Thread David Malcolm
The heading elements in our website contain "id" information, but currently to find them you to look at the page source, whereas in the generated HTML for the manual we have e.g.: ¶ which shows up nicely in the browser in e.g. https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html as a pilcrow c

Re: [PATCH] wwwdocs: gcc-15: start adding notes on C23

2025-01-15 Thread David Malcolm
On Wed, 2025-01-15 at 18:22 +, Joseph Myers wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > > Here's an updated version of the patch > > > > OK to push? (we could tweak it in followups) > > This will need updating to work together with Jakub's

[pushed, wwwdocs] gcc-15/porting_to: prefer to for non-std:: types

2025-01-15 Thread David Malcolm
My tests showed the removal of internal uses of from stdlibc++ usually manifests in complaints about unqualified types like "uint8_t", rather than "std::uint8_t" (and unfortunately the fix-it hint gets this wrong; see PR c++/110930). I've taken the liberty of pushing this patch to the website to

Re: [wwwdocs, PATCH] gcc-15/porting_to: add section on new C23 keywords

2025-01-15 Thread David Malcolm
On Wed, 2025-01-15 at 18:25 +, Joseph Myers wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > > + > > +  In C99 and later you can use #include > > <stdbool.h> > > +  which provides a definition of bool compatible with > > C23. > >

Re: [PATCH] wwwdocs: gcc-15: start adding notes on C23

2025-01-15 Thread David Malcolm
On Wed, 2025-01-15 at 18:22 +, Joseph Myers wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > > Here's an updated version of the patch > > > > OK to push? (we could tweak it in followups) > > This will need updating to work together with Jakub's

[wwwdocs, PATCH] gcc-15/porting_to: add section on new C23 keywords

2025-01-15 Thread David Malcolm
OK to push? --- htdocs/gcc-15/porting_to.html | 28 1 file changed, 28 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 385fa141..53512250 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@

Re: [PATCH] wwwdocs: gcc-15: start adding notes on C23

2025-01-15 Thread David Malcolm
On Mon, 2024-12-09 at 20:58 +0100, Jakub Jelinek wrote: > On Mon, Dec 09, 2024 at 02:44:42PM -0500, David Malcolm wrote: > > +C23 brings the following changes: > > + > > +Function prototypes > > with empty params change from implicit int to > > void > > + &g

Re: [PATCH v2] c: improve UX for -Wincompatible-pointer-types [PR116871]

2025-01-13 Thread David Malcolm
On Tue, 2025-01-14 at 00:08 +, Joseph Myers wrote: > On Sun, 12 Jan 2025, David Malcolm wrote: > > > So I've dropped the takes_int_p, takes_void_p, and > > maybe_inform_empty_args_c23_transition from the patch.  Here's an > > updated version that keeps the

[PATCH v2] c: improve UX for -Wincompatible-pointer-types [PR116871]

2025-01-12 Thread David Malcolm
signment): For OPT_Wincompatible_pointer_types, move auto_diagnostic_group to cover all cases. Use %e and pp_element rather than %qT and tree to colorize the types. Capture whether a warning was emitted, and, if it was, show various notes: for a pointer to a function

[pushed: r15-6838] c: UX improvements to 'too {few, many} arguments' errors (v5) [PR118112]

2025-01-12 Thread David Malcolm
aking it to "at least" for variadic functions. gcc/testsuite/ChangeLog: PR c/118112 * gcc.dg/too-few-arguments.c: New test. * gcc.dg/too-many-arguments.c: New test. Signed-off-by: David Malcolm --- gcc/c/c-typeck.cc | 77

Re: [PATCH] c: improve UX for -Wincompatible-pointer-types and C23 [PR116871]

2025-01-11 Thread David Malcolm
On Sat, 2025-01-11 at 13:55 -0500, David Malcolm wrote: > PR c/116871 notes that our diagnostics about incompatible function > types > could be improved. > > In particular, for the case of migrating to C23 I'm seeing a lot of > build failures with signal handlers similar t

[PATCH] c: improve UX for -Wincompatible-pointer-types and C23 [PR116871]

2025-01-11 Thread David Malcolm
Capture whether a warning was emitted, and, if it was, show various notes: for a pointer to a function, show the function decl, for typedef types, show the decls, and if this appears to be a C23 transition problem, issue a note for that. gcc/testsuite/ChangeLog:

[PATCH v4] c/c++: UX improvements to 'too {few,many} arguments' errors [PR118112]

2025-01-10 Thread David Malcolm
On Thu, 2025-01-09 at 22:28 -0500, David Malcolm wrote: > On Thu, 2025-01-09 at 21:15 -0500, Jason Merrill wrote: > > On 1/9/25 7:00 PM, David Malcolm wrote: > > > On Thu, 2025-01-09 at 14:21 -0500, Jason Merrill wrote: > > > > > > Thanks for taking a look..

Re: [PATCH] c/c++: UX improvements to 'too {few,many} arguments' errors (v3) [PR118112]

2025-01-09 Thread David Malcolm
On Thu, 2025-01-09 at 21:15 -0500, Jason Merrill wrote: > On 1/9/25 7:00 PM, David Malcolm wrote: > > On Thu, 2025-01-09 at 14:21 -0500, Jason Merrill wrote: > > > > Thanks for taking a look... > > > > > > On 1/9/25 2:11 PM, David Malcolm wrot

[PATCH] c/c++: UX improvements to 'too {few, many} arguments' errors (v3) [PR118112]

2025-01-09 Thread David Malcolm
On Thu, 2025-01-09 at 14:21 -0500, Jason Merrill wrote: Thanks for taking a look... > > On 1/9/25 2:11 PM, David Malcolm wrote: > > > > @@ -4743,7 +4769,38 @@ convert_arguments (tree typelist, vec > va_gc> **values, tree fndecl, > > if (typetail

[PATCH] c/c++: UX improvements to 'too {few, many} arguments' errors (v2) [PR118112]

2025-01-09 Thread David Malcolm
quot;too few" case. gcc/testsuite/ChangeLog: PR c/118112 * c-c++-common/too-few-arguments.c: New test. * c-c++-common/too-many-arguments.c: New test. * g++.dg/cpp0x/variadic169.C: Verify the reported expected vs actual argument counts. * g++.dg/modules/ma

Re: [PING] [PATCH 1/6] Add tunables for input buffer

2025-01-08 Thread David Malcolm
On Wed, 2025-01-08 at 07:48 -0800, Andi Kleen wrote: > > I wanted to ping this patch series. Thanks. > > -Andi > Thanks for tha patches, and sorry about not getting back to you earlier (I've been focusing on analyzing many 100s of build failures with GCC 15 relative to GCC 14) Overall, the pat

Re: [PATCH] c/c++: UX improvements to 'too {few, many} arguments' errors [PR118112]

2025-01-07 Thread David Malcolm
On Tue, 2025-01-07 at 15:08 -0500, Marek Polacek wrote: > On Thu, Dec 19, 2024 at 06:40:19PM -0500, David Malcolm wrote: > > Consider this case of a bad call to a callback function (perhaps > > due to C23 changing the meaning of () in function decls): > > > > struc

Ping re C++ parts of: [PATCH] c/c++: UX improvements to 'too {few,many} arguments' errors [PR118112]

2025-01-07 Thread David Malcolm
On Thu, 2024-12-19 at 18:40 -0500, David Malcolm wrote: Jason: are the C++ changes OK? Patch can also be seen at: https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672076.html Joseph approved the C part of this in https://gcc.gnu.org/pipermail/gcc-patches/2025-January/672473.html Thanks

Re: [WIP 3/8] algol68: front-end misc files

2025-01-02 Thread David Malcolm
On Wed, 2025-01-01 at 03:09 +0100, Jose E. Marchesi wrote: > --- >  gcc/algol68/Make-lang.in |  239 + >  gcc/algol68/README   |  102 ++ >  gcc/algol68/a68-diagnostics.cc   |  450 + >  gcc/algol68/a68-lang.cc  |  549 ++ >  gcc/algol68/a

Re: [PATCH] c: special-case some "bool" errors with C23 (v2) [PR117629]

2025-01-02 Thread David Malcolm
On Thu, 2025-01-02 at 18:33 +, Joseph Myers wrote: > On Thu, 19 Dec 2024, David Malcolm wrote: > > > Here's an updated version of the patch. > > > > Changed in v2: > > - distinguish between "bool" and "_Bool" when dete

  1   2   3   4   5   6   7   8   9   10   >