Re: [PATCH] testsuite: Improve test in dg-require-python-h

2023-08-18 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-17 at 23:30 -0300, Thiago Jung Bauermann wrote: > If GCC is tested with a sysroot which doesn't contain a Python > installation (e.g., with a command such as > "make check-gcc-c FLAGS_UNDER_TEST="--sysroot=/some/path"), but > there's > a python3-config in $PATH, then the testsuite

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-17 Thread David Malcolm via Gcc-patches
t I wanted. Please see the C diff I > > > provided > > > above to see that the ASM has a small diff that allowed me to > > > confirm > > > that the `__restrict__` attribute was correctly set. > > > > > > > If this test is meant to run at -O3 and t

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-16 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-16 at 22:06 +0200, Guillaume Gomez via Jit wrote: > My apologies, forgot to run the commit checkers. Here's the commit > with the errors fixed. > > Le mer. 16 août 2023 à 18:32, Guillaume Gomez > a écrit : > > > > Hi, Hi Guillaume, thanks for the patch. > > > > This patch

Re: [WIP RFC v2] analyzer: Add support of placement new and improved operator new [PR105948]

2023-08-16 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-16 at 14:19 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Hi, > (s/we/the analyzer/) Hi Benjamin, thanks for the updated patch. > > I've been continuing my patch of supporting operator new variants > in the analyzer, and have added a few more test cases. > >

Re: [RFC] GCC Security policy

2023-08-15 Thread David Malcolm via Gcc-patches
On Mon, 2023-08-14 at 09:26 -0400, Siddhesh Poyarekar wrote: > Hi, > > Here's the updated draft of the top part of the security policy with all > of the recommendations incorporated. > > Thanks, > Sid > > > What is a GCC security bug? > === > > A security bug is

Re: [PATCH v4 4/8] diagnostics: Support obtaining source code lines from generated data buffers

2023-08-15 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-15 at 14:15 -0400, Lewis Hyatt wrote: > On Tue, Aug 15, 2023 at 12:15:15PM -0400, David Malcolm wrote: > > On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > > > This patch enhances location_get_source_line(), which is the > > > prima

Re: [PATCH v4 3/8] diagnostics: Refactor class file_cache_slot

2023-08-15 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-15 at 13:58 -0400, Lewis Hyatt wrote: > On Tue, Aug 15, 2023 at 11:43:05AM -0400, David Malcolm wrote: > > On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > > > Class file_cache_slot in input.cc is used to query specific lines > > > of source

Re: [PATCH v4 8/8] diagnostics: Support generated data locations in SARIF output

2023-08-15 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > The diagnostics routines for SARIF output need to read the source code back > in, so that they can generate "snippet" and "content" records, so they need to > be able to cope with generated data locations.  Add support for that in >

Re: [PATCH v4 6/8] diagnostics: Full support for generated data locations

2023-08-15 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > Previous patches in this series have laid the groundwork for supporting > source code locations in memory ("generated data") rather than ordinary > files. This patch completes the support by adding awareness of such > locations to all places

Re: [PATCH v4 5/8] diagnostics: Support testing generated data in input.cc selftests

2023-08-15 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > Add selftests for the new capabilities in input.cc related to source code > locations that are stored in memory rather than ordinary files. > > gcc/ChangeLog: > > * input.cc (temp_source_file::do_linemap_add): New function. >    

Re: [PATCH v4 4/8] diagnostics: Support obtaining source code lines from generated data buffers

2023-08-15 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > This patch enhances location_get_source_line(), which is the primary > interface provided by the diagnostics infrastructure to obtain the line of > source code corresponding to a given location, so that it understands > generated data

Re: [PATCH v4 3/8] diagnostics: Refactor class file_cache_slot

2023-08-15 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > Class file_cache_slot in input.cc is used to query specific lines of source > code from a file when needed by diagnostics infrastructure. This will be > extended in a subsequent patch to support obtaining the source code from > in-memory

Re: [PATCH v2] analyzer: New option fanalyzer-show-events-in-system-headers [PR110543]

2023-08-14 Thread David Malcolm via Gcc-patches
On Mon, 2023-08-14 at 17:48 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Plenty useful, thanks David. I've adjusted some few things, especially > the artifacts of earlier versions I missed when building the commit. > > I didn't how to test for warnings within , I couldn't

Re: [PATCH v4 2/8] libcpp: diagnostics: Support generated data in expanded locations

2023-08-11 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: > The previous patch in this series introduced the concept of LC_GEN line > maps. This patch continues on the path to using them to improve _Pragma > diagnostics, by adding a new source_id SRC member to struct > expanded_location, which is

Re: [PATCH v4 1/8] libcpp: Add LC_GEN linemaps to support in-memory buffers

2023-08-11 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 18:14 -0400, Lewis Hyatt wrote: Hi Lewis, thanks for the patch... > Add a new linemap reason LC_GEN which enables encoding the location of data > that was generated during compilation and does not appear in any source file. > There could be many use cases, such as, for

[pushed] analyzer: new warning: -Wanalyzer-unterminated-string [PR105899]

2023-08-11 Thread David Malcolm via Gcc-patches
This patch adds new functions to the analyzer for checking that an argument at a callsite is a pointer to a valid null-terminated string, and uses this for the following known functions: - error (param 3, the format string) - error_at_line (param 5, the format string) - putenv - strchr (1st

Re: [PATCH] analyzer: New option fanalyzer-show-events-in-system-headers [PR110543]

2023-08-11 Thread David Malcolm via Gcc-patches
On Fri, 2023-08-11 at 13:51 +0200, priour...@gmail.com wrote: > From: benjamin priour Hi Benjamin, thanks for the patch. Overall, the patch is close to being ready, but see the various comments inline below... > > This patch introduces -fanalyzer-show-events-in-system-headers, > disabled by

Re: [PATCH v2] analyzer: More features for CPython analyzer plugin [PR107646]

2023-08-09 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-09 at 15:22 -0400, Eric Feng wrote: > Thank you for your help in getting dg-require-python-h working! I can > confirm that the FAILs are related to differences between the -- > cflags > affecting the gimple seen by the analyzer. For this reason, I have > changed it to --includes

Re: [PATCH] testsuite: Fix gcc.dg/analyzer/allocation-size-multiline-[123].c [PR 110426]

2023-08-09 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-08 at 15:01 +, Christophe Lyon wrote: > For 32-bit newlib targets (e.g. arm-eabi)  int32_t is "long int". > > Like previous patches in these tests, update the matching regexps to > match "aka (long )?int". > > Tested on arm-eabi and aarch64-linux-gnu. Sorry about this

[pushed] analyzer: remove default return value from region_model::on_call_pre

2023-08-09 Thread David Malcolm via Gcc-patches
Previously, the code for simulating calls to external functions in region_model::on_call_pre wrote a default svalue to the LHS of the call statement, which could be further overwritten by known_function subclasses. Unfortunately, this led to messy hacks, such as when the default svalue was an

Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls

2023-08-08 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-08 at 08:05 +0200, Richard Biener wrote: > On Mon, Aug 7, 2023 at 9:04 PM Bradley Lucier > wrote: > > > > Thank you for your comments.  I have a few questions. > > > > > I don't think this specific case qualifies for -Wdisabled- > > > optimization. > > > The diagnostic is for

Re: [RFC] GCC Security policy

2023-08-08 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-08 at 09:33 -0400, Paul Koning via Gcc-patches wrote: > > > > On Aug 8, 2023, at 9:01 AM, Jakub Jelinek via Gcc-patches > > wrote: > > > > On Tue, Aug 08, 2023 at 02:52:57PM +0200, Richard Biener via Gcc- > > patches wrote: > > > There's probably external tools to do this, not

Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls

2023-08-05 Thread David Malcolm via Gcc-patches
On Sun, 2023-08-06 at 02:28 +0530, Prathamesh Kulkarni via Gcc-patches wrote: > On Fri, 4 Aug 2023 at 23:28, Bradley Lucier via Gcc-patches > wrote: Hi Bradley and Prathamesh... > > > > The patch at the end adds a warning when a tail/sibling call cannot > > be > > optimized for various

[pushed] analyzer: handle function attribute "alloc_size" [PR110426]

2023-08-04 Thread David Malcolm via Gcc-patches
This patch makes -fanalyzer make 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. Successfully bootstrapped &

[pushed] analyzer: fix some svalue::dump_to_pp implementations

2023-08-04 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-3000-g187b213ddbe7ea. gcc/analyzer/ChangeLog: * svalue.cc (region_svalue::dump_to_pp): Support NULL type. (constant_svalue::dump_to_pp): Likewise. (initial_svalue::dump_to_pp): Likewise.

Re: [PATCH v2] analyzer: stash values for CPython plugin [PR107646]

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 11:28 -0400, Eric Feng wrote: > On Wed, Aug 2, 2023 at 5:09 PM David Malcolm > wrote: > > > > On Wed, 2023-08-02 at 14:46 -0400, Eric Feng wrote: > > [...snip...] > > > > >  Otherwise, please let me know if I should request write

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 15:54 +0100, Matthew Malcomson wrote: > On 8/3/23 15:09, David Malcolm wrote: > > > > Hi Matthew.  I recently touched the timevar code (in r14-2881- > > g75d623946d4b6e) to add support for serializing the timevar data in > > JSON form as part of th

[committed] testsuite, analyzer: add test case [PR108171]

2023-08-03 Thread David Malcolm via Gcc-patches
The ICE in PR analyzer/108171 appears to be a dup of the recently fixed PR analyzer/110882 and is likewise fixed by it; adding this test case. Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2957-gf80efa49b7a163. gcc/testsuite/ChangeLog: PR analyzer/108171

Re: [PATCH] mid-end: Use integral time intervals in timevar.cc

2023-08-03 Thread David Malcolm via Gcc-patches
On Thu, 2023-08-03 at 14:38 +0100, Matthew Malcomson via Gcc-patches wrote: > > > > I think this is undesriable.  With fused you mean we use FMA? > > I think you could use -ffp-contract=off for the TU instead. > > > > Note you can't use __attribute__((noinline)) literally since the > > host

[committed] analyzer: fix ICE on zero-sized arrays [PR110882]

2023-08-03 Thread David Malcolm via Gcc-patches
Successfully bootstrapped and regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2955-gc62f93d1e0383d. gcc/analyzer/ChangeLog: PR analyzer/110882 * region.cc (int_size_in_bits): Fail on zero-sized types. gcc/testsuite/ChangeLog: PR analyzer/110882 *

Re: [PATCH v2] analyzer: stash values for CPython plugin [PR107646]

2023-08-02 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-02 at 14:46 -0400, Eric Feng wrote: > On Wed, Aug 2, 2023 at 1:20 PM Marek Polacek > wrote: > > > > On Wed, Aug 02, 2023 at 12:59:28PM -0400, David Malcolm wrote: > > > On Wed, 2023-08-02 at 12:20 -0400, Eric Feng wrote: > > > [Dropping Jos

Re: [PATCH v2] analyzer: stash values for CPython plugin [PR107646]

2023-08-02 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-02 at 12:20 -0400, Eric Feng wrote: Hi Eric, thanks for the updated patch. Overall, looks good to me, although I'd drop the "Exited." from the "sorry" message (and thus from the dg-message directive), since the compiler is not exiting, it's just the particular plugin that's

Re: [PATCH] analyzer: stash values for CPython plugin [PR107646]

2023-08-01 Thread David Malcolm via Gcc-patches
On Tue, 2023-08-01 at 09:52 -0400, Eric Feng wrote: > Hi all, > > This patch adds a hook to the end of ana::on_finish_translation_unit > which calls relevant stashing-related callbacks registered during > plugin > initialization. This feature is used to stash named types and global > variables

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948]

2023-07-31 Thread David Malcolm via Gcc-patches
On Mon, 2023-07-31 at 13:46 +0200, Benjamin Priour wrote: > Hi Dave, > > On Fri, Jul 21, 2023 at 10:10 PM David Malcolm > wrote: [...snip...] > > > > I see that we have test coverage for: > >   noexcept-new.C: -fno-exceptions with new vs nothrow-new > > wh

Re: [PATCH v3 0/4] diagnostics: libcpp: Overhaul locations for _Pragma tokens

2023-07-29 Thread David Malcolm via Gcc-patches
On Sat, 2023-07-29 at 10:27 -0400, Lewis Hyatt wrote: > On Fri, Jul 28, 2023 at 6:22 PM David Malcolm > wrote: > > > > On Fri, 2023-07-21 at 19:08 -0400, Lewis Hyatt wrote: > > > Hello- > > > > > > This is an update to the v2 patch series la

Re: [PATCH v3 1/4] diagnostics: libcpp: Add LC_GEN linemaps to support in-memory buffers

2023-07-28 Thread David Malcolm via Gcc-patches
On Fri, 2023-07-21 at 19:08 -0400, Lewis Hyatt wrote: > Add a new linemap reason LC_GEN which enables encoding the location > of data > that was generated during compilation and does not appear in any > source file. > There could be many use cases, such as, for instance, referring to > the content

Re: [PATCH v3 0/4] diagnostics: libcpp: Overhaul locations for _Pragma tokens

2023-07-28 Thread David Malcolm via Gcc-patches
On Fri, 2023-07-21 at 19:08 -0400, Lewis Hyatt wrote: > Hello- > > This is an update to the v2 patch series last sent in January: > https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609473.html > > While I did not receive any feedback on the v2 patches yet, they did > need some > rebasing

[PATCH v2] SARIF and -ftime-report's output [PR109361]

2023-07-28 Thread David Malcolm via Gcc-patches
On Fri, 2023-07-28 at 08:00 +0200, Richard Biener wrote: > On Fri, Jul 28, 2023 at 12:23 AM David Malcolm via Gcc-patches > wrote: > > > > On Tue, 2023-04-11 at 08:43 +, Richard Biener wrote: > > > On Tue, 4 Apr 2023, David Malcolm wrote: > > > >

Re: [PATCH] Add -fsarif-time-report [PR109361]

2023-07-27 Thread David Malcolm via Gcc-patches
On Tue, 2023-04-11 at 08:43 +, Richard Biener wrote: > On Tue, 4 Apr 2023, David Malcolm wrote: > > > Richi, Jakub: I can probably self-approve this, but it's > > technically a > > new feature.  OK if I push this to trunk in stage 4?  I believe > > it's &g

[pushed] analyzer: add symbol base class, moving region id to there [PR104940]

2023-07-26 Thread David Malcolm via Gcc-patches
This patch introduces a "symbol" base class that region and svalue both inherit from, generalizing the ID from the region class so it's also used by svalues. This gives a way of sorting regions and svalues into creation order, which I've found useful in my experiments with adding SMT support (PR

Re: [WIP RFC] analyzer: Add optional trim of the analyzer diagnostics going too deep [PR110543]

2023-07-26 Thread David Malcolm via Gcc-patches
On Wed, 2023-07-26 at 11:27 +0200, Benjamin Priour wrote: > On Sat, Jul 22, 2023 at 12:04 AM David Malcolm > wrote: > > > On Fri, 2023-07-21 at 17:35 +0200, Benjamin Priour wrote: > > > Hi, > > > > > > Upon David's request I've joined the in pro

Re: [WIP RFC] analyzer: Add optional trim of the analyzer diagnostics going too deep [PR110543]

2023-07-21 Thread David Malcolm via Gcc-patches
gt; From: Benjamin Priour > Date: Tue, Jul 18, 2023 at 3:30 PM > Subject: [RFC] analyzer: Add optional trim of the analyzer > diagnostics > going too deep [PR110543] > To: , David Malcolm > > > Hi, > > I'd like to request comments on a patch I am writing for PR110

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948]

2023-07-21 Thread David Malcolm via Gcc-patches
On Thu, 2023-07-06 at 16:43 +0200, priour...@gmail.com wrote: > As per David's suggestion. > - Improved leading comment of "is_placement_new_p" > - "kf_operator_new::matches_call_types_p" now checks that arg 0 is of >   integral type and that arg 1, if any, is of pointer type. > - Changed

[pushed] analyzer/text-art: fix clang warnings [PR110433,PR110612]

2023-07-20 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2689-g7006f02bbc3f1d. gcc/analyzer/ChangeLog: PR analyzer/110433 PR middle-end/110612 * access-diagram.cc (class spatial_item): Add virtual dtor. gcc/ChangeLog: PR

[pushed] analyzer: avoid usage of TYPE_PRECISION on vector types [PR110455]

2023-07-20 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2690-ga4913a19d24a79. gcc/analyzer/ChangeLog: PR analyzer/110455 * region-model.cc (region_model::get_gassign_result): Only check for bad shift counts when dealing with an integral type.

[pushed] analyzer: fix ICE on certain pointer subtractions [PR110387]

2023-07-20 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2688-g5a0aff76a99804. gcc/analyzer/ChangeLog: PR analyzer/110387 * region.h (struct cast_region::key_t): Support "m_type" being null by using "m_original_region" for empty/deleted slots.

Re: [committed] Document new analyzer parameters

2023-07-20 Thread David Malcolm via Gcc-patches
On Thu, 2023-07-20 at 16:47 +0200, Martin Jambor wrote: > Hi, > > This patch documents the analyzer parameters introduced in > r14-2029-g0e466e978c7286 also in gcc/doc/invoke.texi. > > Committed as obvious after testing with make pdf and make info and > eyeballing the result. > > Thanks,

[pushed] analyzer: fix ICE on division of tainted floating-point values [PR110700]

2023-07-19 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-2658-gb86c0fe327a519. gcc/analyzer/ChangeLog: PR analyzer/110700 * region-model-manager.cc (region_model_manager::get_or_create_int_cst): Assert that we have an integral or

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948]

2023-07-05 Thread David Malcolm via Gcc-patches
On Tue, 2023-07-04 at 18:25 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Script contrib/check_GNU_style.sh complains about there being a space > before a left square bracket ("operator new []"). > Though, it is actually within a literal string, and the space  > is required to

[pushed 2/2] jit.exp: handle dwarf version mismatch in jit-check-debug-info [PR110466]

2023-06-30 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Verified fix on powerpc64le-unknown-linux-gnu (gcc112 in Compile Farm). Pushed to trunk as r14-2223-gc3c0ba5436170e. gcc/testsuite/ChangeLog: PR jit/110466 * jit.dg/jit.exp (jit-check-debug-info): Gracefully handle too early

[pushed 1/2] jit: avoid using __vector in testcase [PR110466]

2023-06-30 Thread David Malcolm via Gcc-patches
r13-4531-gd2e782cb99c311 added test coverage to libgccjit's vector support, but used __vector, which doesn't work on Power. Additionally the size param to gcc_jit_type_get_vector was wrong. Fixed thusly. Successfully regrtested on x86_64-pc-linux-gnu. Verified fix on

Re: [PATCH] analyzer: Fix regression bug after r14-1632-g9589a46ddadc8b [PR110198]

2023-06-29 Thread David Malcolm via Gcc-patches
On Thu, 2023-06-29 at 20:45 +0200, priour...@gmail.com wrote: > From: benjamin priour > > See below formatting updates on my patch. > In mail > https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623140.html, > David Malcolm says regtesting failed for him. > > So I did i

Re: [PATCH] testsuite: Use -fno-report-bug in gcc.dg/plugin/

2023-06-29 Thread David Malcolm via Gcc-patches
On Thu, 2023-06-29 at 15:03 -0400, Marek Polacek wrote: > Certain downstream compilers (for example, in Fedora) default to > -freport-bug.  The extra output breaks the following tests.  We can > use > -fno-report-bug to fix that.  Patch verified with: > > $ make check

Re: [PATCH] analyzer: Fix regression bug after r14-1632-g9589a46ddadc8b [pr110198]

2023-06-28 Thread David Malcolm via Gcc-patches
On Thu, 2023-06-22 at 21:55 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Resend with proper subject line ... > > Hi, Hi Benjamin > > Below is the fix to regression bug > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110198 > Was bootstrapped and regtested successfully on

[pushed: v2] text-art: remove explicit #include of C++ standard library headers

2023-06-23 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-23 at 16:35 +0100, Alex Coplan wrote: > Thanks for the fix! I can confirm this fixes bootstrap on > x86_64-apple-darwin for me. Thanks Alex Unfortunately the patch I posted broke the build of the plugin in the testsuite, so I had to tweak things slightly. Here's v2 of the

[pushed] c++: provide #include hint for missing includes [PR110164]

2023-06-23 Thread David Malcolm via Gcc-patches
> On Fri, 2023-06-23 at 12:08 -0400, Jason Merrill wrote: > > On 6/22/23 11:50, Marek Polacek wrote: > > > On Wed, Jun 21, 2023 at 04:44:00PM -0400, David Malcolm via Gcc-patches > > > wrote: > > > I'd like to ping this C++ FE patch for review: > > > h

[PATCH] text-art: remove explicit #include of C++ standard library headers

2023-06-23 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-23 at 12:52 +0100, Alex Coplan wrote: > Hi David, > > It looks like this patch breaks bootstrap on Darwin. I tried a > bootstrap on > x86_64-apple-darwin and got errors building selftest-run-tests.cc: > > In file included from >

PING: Re: [PATCH] c++: provide #include hint for missing includes [PR110164]

2023-06-21 Thread David Malcolm via Gcc-patches
I'd like to ping this C++ FE patch for review: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621779.html Thanks Dave On Wed, 2023-06-14 at 20:28 -0400, David Malcolm wrote: > PR c++/110164 notes that in cases where we have a forward decl > of a std library type such as: > >

PING^2: Re: [PATCH 1/3] testsuite: move handle-multiline-outputs to before check for blank lines

2023-06-20 Thread David Malcolm via Gcc-patches
Does this testsuite patch look OK? https://gcc.gnu.org/pipermail/gcc-patches/2023-May/620275.html Thanks David On Mon, 2023-06-12 at 19:11 -0400, David Malcolm wrote: > Please can someone review this testsuite patch: >   https://gcc.gnu.org/pipermail/gcc-patches/2023-May/62027

Re: [PATCH] libcpp: Improve location for macro names [PR66290]

2023-06-20 Thread David Malcolm via Gcc-patches
On Fri, 2022-08-05 at 12:04 -0400, Lewis Hyatt via Gcc-patches wrote: > > When libcpp reports diagnostics whose locus is a macro name (such as > for > -Wunused-macros), it uses the location in the cpp_macro object that > was > stored by _cpp_new_macro. This is currently set to pfile- >

[pushed] c: add name hints to c_parser_declspecs [PR107583]

2023-06-15 Thread David Malcolm via Gcc-patches
PR c/107583 notes that we weren't issuing a hint for struct foo { time_t mytime; /* missing include should trigger fixit */ }; in the C frontend. The root cause is that one of the "unknown type name" diagnostics was missing logic to emit hints, which this patch fixes. Successfully

Re: [PATCH] c++: provide #include hint for missing includes [PR110164]

2023-06-15 Thread David Malcolm via Gcc-patches
On Thu, 2023-06-15 at 01:43 +0100, Sam James wrote: > > Eric Gallager via Gcc-patches writes: > > > On Wed, Jun 14, 2023 at 8:29 PM David Malcolm via Gcc-patches > > wrote: > > > > > > PR c++/110164 notes that in cases where we have a f

[PATCH] c++: provide #include hint for missing includes [PR110164]

2023-06-14 Thread David Malcolm via Gcc-patches
PR c++/110164 notes that in cases where we have a forward decl of a std library type such as: std::array x; we omit this diagnostic: error: aggregate ‘std::array x’ has incomplete type and cannot be defined This patch adds this hint to the diagnostic: note: ‘std::array’ is defined in header

[pushed] c/c++: use positive tone in missing header notes [PR84890]

2023-06-13 Thread David Malcolm via Gcc-patches
Quoting "How a computer should talk to people" (as quoted in "Concepts Error Messages for Humans"): "Various negative tones or actions are unfriendly: being manipulative, not giving a second chance, talking down, using fashionable slang, blaming. We must not seem to blame the person. We should

PING: Re: [PATCH 1/3] testsuite: move handle-multiline-outputs to before check for blank lines

2023-06-12 Thread David Malcolm via Gcc-patches
Please can someone review this testsuite patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-May/620275.html Thanks Dave On Wed, 2023-05-31 at 14:06 -0400, David Malcolm wrote: > I have followup patches that require checking for multiline patterns > that have blank lines within th

[pushed] analyzer: add caching to globals with initializers [PR110112]

2023-06-09 Thread David Malcolm via Gcc-patches
PR analyzer/110112 notes that -fanalyzer is extremely slow on a source file with large read-only static arrays, repeatedly building the same compound_svalue representing the full initializer, and repeatedly building svalues representing parts of the the full initialiazer. This patch adds caches

Re: [PATCH 2/2] testsuite: Add more allocation size tests for conjured svalues [PR110014]

2023-06-09 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-09 at 20:28 +0200, Tim Lange wrote: > This patch adds the reproducers reported in PR 110014 as test cases. > The > false positives in those cases are already fixed with PR 109577. > > 2023-06-09  Tim Lange  > > PR analyzer/110014 > > gcc/testsuite/ChangeLog: > >    

Re: [PATCH 1/2] analyzer: Fix allocation size false positive on conjured svalue [PR109577]

2023-06-09 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-09 at 20:28 +0200, Tim Lange wrote: [...snip...] Thanks for the patch. > diff --git a/gcc/analyzer/constraint-manager.cc > b/gcc/analyzer/constraint-manager.cc > index 2c9c435527e..24cd8960098 100644 > --- a/gcc/analyzer/constraint-manager.cc > +++

Re: [PATCH] analyzer: Standalone OOB-warning [PR109437, PR109439]

2023-06-07 Thread David Malcolm via Gcc-patches
On Wed, 2023-06-07 at 13:38 +0200, Benjamin Priour wrote: > On Tue, Jun 6, 2023 at 8:37 PM David Malcolm > wrote: > > > > On Tue, 2023-06-06 at 18:05 +0200, Benjamin Priour wrote: > > [...] > > > [Looks like you droppped the mailing list from the recipie

Re: [PATCH] analyzer: Standalone OOB-warning [PR109437, PR109439]

2023-06-06 Thread David Malcolm via Gcc-patches
On Tue, 2023-06-06 at 13:48 +0200, priour...@gmail.com wrote: > From: Benjamin Priour Hi Benjamin, thanks for this patch. Overall it look great. You didn't say what testing you did on the patch. Typically when preparing a patch for the mailing list we do a bootstrap build of gcc with the

[pushed] analyzer: implement various atomic builtins [PR109015]

2023-06-02 Thread David Malcolm via Gcc-patches
This patch implements many of the __atomic_* builtins from sync-builtins.def as known_function subclasses within the analyzer. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-1497-gef768035ae8090. gcc/analyzer/ChangeLog: PR analyzer/109015 *

[pushed] analyzer: regions in different memory spaces can't alias

2023-06-02 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-1496-gb8a916726e7f4b. gcc/analyzer/ChangeLog: * store.cc (store::eval_alias_1): Regions in different memory spaces can't alias. --- gcc/analyzer/store.cc | 12 1 file changed, 12

[PATCH 0/3] Add diagram support to gcc diagnostics

2023-05-31 Thread David Malcolm via Gcc-patches
bootstrapped & regrtested on x86_64-pc-linux-gnu, both with gcc 4.8.5 and with gcc 10.3.1 Lightly tested with valgrind. OK for trunk? David Malcolm (3): testsuite: move handle-multiline-outputs to before check for blank lines diagnostics: add support for "text art" diagram

[PATCH 1/3] testsuite: move handle-multiline-outputs to before check for blank lines

2023-05-31 Thread David Malcolm via Gcc-patches
I have followup patches that require checking for multiline patterns that have blank lines within them, so this moves the handling of multiline patterns before the check for blank lines, allowing for such multiline patterns. Doing so uncovers some issues with existing multiline directives, which

[pushed] testsuite: add verify-sarif-file to some testcases that were missing it

2023-05-30 Thread David Malcolm via Gcc-patches
Pushed to trunk as r14-1420-ge4c8f7024f02d8. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/malloc-sarif-1.c: Add missing verify-sarif-file directive. * gcc.dg/analyzer/sarif-pr107366.c: Likewise. --- gcc/testsuite/gcc.dg/analyzer/malloc-sarif-1.c | 2 ++

Re: [PATCH] testsuite, analyzer: Fix testcases with fclose

2023-05-24 Thread David Malcolm via Gcc-patches
On Tue, 2023-05-23 at 09:34 +, Christophe Lyon wrote: > The gcc.dg/analyzer/data-model-4.c and > gcc.dg/analyzer/torture/conftest-1.c fail with recent glibc headers > and succeed with older headers. > > The new error message is: > warning: use of possibly-NULL 'f' where non-null expected

[PATCH] Add -fsarif-time-report [PR109361]

2023-04-04 Thread David Malcolm via Gcc-patches
d to timevar_init being called. * tree-diagnostic-client-data-hooks.cc: Include "diagnostic-format-sarif.h" and "timevar.h". (compiler_data_hooks::add_sarif_invocation_properties): New vfunc implementation. gcc/testsuite/ChangeLog: PR analy

Re: [PATCH] testsuite, analyzer: Fix up pipe-glibc.c testcase [PR107396]

2023-03-31 Thread David Malcolm via Gcc-patches
On Thu, 2023-03-30 at 10:05 +0200, Jakub Jelinek wrote: > Hi! > > The gcc.dg/analyzer/pipe-glibc.c test FAILs when using recent glibc > headers > and succeeds with older headers. > The important change is that >

Backport of 15 patches to gcc 12 branch (mostly analyzer)

2023-03-29 Thread David Malcolm via Gcc-patches
I've backported the following patches to the releases/gcc-12 branch (shown in reverse chronological order): r12-9367-g7903e0bca00384: analyzer: fix ICE on certain longjmp calls [PR109094] Cherrypicked from r13-6749-g430d7d88c1a123. r12-9366-g833d822ff0e834: analyzer: fix uninit false

[pushed] Don't emit -Wxor-used-as-pow on macro expansions [PR107002]

2023-03-28 Thread David Malcolm via Gcc-patches
xor-used-as-pow-pr107002-2.c: New test. Signed-off-by: David Malcolm --- gcc/c-family/c-common.h | 2 +- gcc/c-family/c-warn.cc| 23 +++ gcc/c/c-typeck.cc | 2 +- gcc/cp/parser.cc

[pushed] diagnostics: ensure that .sarif files are UTF-8 encoded [PR109098]

2023-03-24 Thread David Malcolm via Gcc-patches
t-paths-5.c: Likewise. * lib/scansarif.exp (verify-sarif-file): New procedure. * lib/verify-sarif-file.py: New support script. libcpp/ChangeLog: PR analyzer/109098 * charset.cc (cpp_valid_utf8_p): New function. * include/cpplib.h (cpp_valid_utf8

[pushed] docs, analyzer: improvements to "Debugging the Analyzer"

2023-03-24 Thread David Malcolm via Gcc-patches
, and rewrite in places. (Other Debugging Techniques): Add notes on how to compare two different exploded graphs. Signed-off-by: David Malcolm --- gcc/doc/analyzer.texi | 125 +++--- 1 file changed, 116 insertions(+), 9 deletions(-) diff --git a/gcc

Re: [PATCH v2] C, ObjC: Add -Wunterminated-string-initialization

2023-03-24 Thread David Malcolm via Gcc-patches
On Fri, 2023-03-24 at 18:45 +0100, Alejandro Colomar wrote: > Hi David, > > On 3/24/23 15:53, David Malcolm wrote: > > On Fri, 2023-03-24 at 14:39 +0100, Alejandro Colomar via Gcc- > > patches > > wrote: > > > Warn about the following

Re: [PATCH v2] C, ObjC: Add -Wunterminated-string-initialization

2023-03-24 Thread David Malcolm via Gcc-patches
On Fri, 2023-03-24 at 14:39 +0100, Alejandro Colomar via Gcc-patches wrote: > Warn about the following: > >     char  s[3] = "foo"; > > Initializing a char array with a string literal of the same length as > the size of the array is usually a mistake.  Rarely is the case where > one wants to

PING: Re: [PATCH] json: preserve key-insertion order [PR109163]

2023-03-24 Thread David Malcolm via Gcc-patches
I'd like to ping the following patch for review: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614165.html Thanks Dave On Fri, 2023-03-17 at 16:53 -0400, David Malcolm wrote: > PR other/109163 notes that when we write out JSON files, we traverse > the keys within each obje

[pushed] analyzer: fix false +ves from -Wanalyzer-deref-before-check due to inlining [PR109239]

2023-03-22 Thread David Malcolm via Gcc-patches
eref-before-check-pr109239-linux-bus.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/program-point.cc | 42 + gcc/analyzer/program-point.h | 3 + gcc/analyzer/sm-malloc.cc | 9 +- .../deref-before-check-pr109239-linux-bus

[PATCH] testsuite: always use UTF-8 in scan-sarif-file[-not] [PR105959]

2023-03-20 Thread David Malcolm via Gcc-patches
Treat the file as UTF-8 encoded when reading it. (scan-sarif-file-not): Likewise. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg-selftests/dg-final.exp | 22 ++--- gcc/testsuite/lib/scanasm.exp | 22 +++-- gcc/testsuite/lib/scansa

[pushed] analyzer: fix ICE on certain longjmp calls [PR109094]

2023-03-18 Thread David Malcolm via Gcc-patches
ram. gcc/testsuite/ChangeLog: PR analyzer/109094 * gcc.dg/analyzer/setjmp-pr109094.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/region-model.cc | 15 ++-- gcc/analyzer/region-model.h | 3 +- .../gcc.dg/analyzer/setjmp-pr109094.c

[PATCH] json: preserve key-insertion order [PR109163]

2023-03-17 Thread David Malcolm via Gcc-patches
on/diagnostic-format-json-4.c: Likewise. * c-c++-common/diagnostic-format-json-5.c: Rewrite regexps. * c-c++-common/diagnostic-format-json-stderr-1.c: Update comment. Signed-off-by: David Malcolm --- gcc/json.cc | 40 --- gcc/json.h

Re: [PATCH] testsuite: Handle default_packed targets in gcc.dg/plugin

2023-03-17 Thread David Malcolm via Gcc-patches
On Fri, 2023-03-17 at 17:10 +0100, Hans-Peter Nilsson wrote: > > From: David Malcolm > > Date: Thu, 16 Mar 2023 14:42:58 -0400 > > > I think I prefer the top one-liner dg-skip-if approach you > > mentioned in > > your original email; it seems simplest. >

Re: [PATCH] testsuite: Handle default_packed targets in gcc.dg/plugin

2023-03-16 Thread David Malcolm via Gcc-patches
On Thu, 2023-03-16 at 19:25 +0100, Hans-Peter Nilsson wrote: > > From: David Malcolm > > Date: Thu, 16 Mar 2023 13:55:48 -0400 > > > On Thu, 2023-03-09 at 19:56 +0100, Hans-Peter Nilsson wrote: > > > It's not obvious to me whether considered best to includ

Re: [PATCH] testsuite: Handle default_packed targets in gcc.dg/plugin

2023-03-16 Thread David Malcolm via Gcc-patches
On Thu, 2023-03-09 at 19:56 +0100, Hans-Peter Nilsson wrote: > It's not obvious to me whether considered best to include or > exclude these tests that depend on structure layout details. > If excluding, the obvious alternative to this patch is then > to add a top one-liner (to dg-skip-if the test

Re: [PATCH] diagnostics: fix crash with -fdiagnostics-format=json-file

2023-03-16 Thread David Malcolm via Gcc-patches
On Tue, 2023-01-10 at 16:10 +0100, Martin Liška wrote: > On 1/6/23 14:21, David Malcolm wrote: > > On Fri, 2023-01-06 at 12:33 +0100, Martin Liška wrote: > > > Patch can bootstrap on x86_64-linux-gnu and survives regression > > > tests. > > > > Thanks for

[pushed] diagnostics: attempt to capture crash info in SARIF output [PR109097]

2023-03-15 Thread David Malcolm via Gcc-patches
rash-test-ice-stderr.c: New test. * gcc.dg/plugin/crash-test-write-though-null-sarif.c: New test. * gcc.dg/plugin/crash-test-write-though-null-stderr.c: New test. * gcc.dg/plugin/crash_test_plugin.c: New plugin. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add t

[pushed] testsuite: add test coverage for analyzer leak false +ve [PR105906]

2023-03-13 Thread David Malcolm via Gcc-patches
: New test. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/leak-pr105906.c | 32 +++ 1 file changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/leak-pr105906.c diff --git a/gcc/testsuite/gcc.dg/analyzer/leak-pr105906.c b/gcc/testsuite/gcc.dg

[pushed] analyzer, testsuite: add test coverage for various builtins

2023-03-13 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-6639-gfa9d3aa67894c8. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/exec-1.c: New test. * gcc.dg/analyzer/snprintf-concat.c: New test. * gcc.dg/analyzer/vsnprintf-1.c: New test. Signed-off-by: David

[pushed] testsuite: add test coverage for PR analyzer/108045

2023-03-13 Thread David Malcolm via Gcc-patches
. Signed-off-by: David Malcolm --- .../leak-pr108045-with-call-summaries.c | 106 + .../leak-pr108045-without-call-summaries.c| 107 ++ 2 files changed, 213 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/leak-pr108045-with-call-summaries.c

[pushed] analyzer: fix leak false +ve seen in haproxy's cfgparse.c [PR109059]

2023-03-10 Thread David Malcolm via Gcc-patches
s): New decl. gcc/testsuite/ChangeLog: PR analyzer/109059 * gcc.dg/analyzer/flex-with-call-summaries.c: Remove xfail. * gcc.dg/analyzer/leak-pr109059-1.c: New test. * gcc.dg/analyzer/leak-pr109059-2.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/region-

[pushed] analyzer: fix deref-before-check false +ves seen in haproxy [PR108475, PR109060]

2023-03-10 Thread David Malcolm via Gcc-patches
er/deref-before-check-pr108475-1.c: New test. * gcc.dg/analyzer/deref-before-check-pr108475-haproxy-tcpcheck.c: New test. * gcc.dg/analyzer/deref-before-check-pr109060-haproxy-cfgparse.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/sm-malloc.cc

[pushed] testsuite: add various -Wanalyzer-null-dereference false +ve test cases

2023-03-09 Thread David Malcolm via Gcc-patches
-smp_fetch_ssl_fc_has_early.c: Likewise. * gcc.dg/analyzer/null-deref-pr108400-SoftEtherVPN-WebUi.c: New test, reduced from SoftEtherVPN's src/Cedar/WebUI.c. Signed-off-by: David Malcolm --- .../gcc.dg/analyzer/null-deref-pr102671-1.c | 167 +++ .../gcc.dg/analyzer

<    1   2   3   4   5   6   7   8   9   10   >