Re: [PATCH] avoid using an incompletely populated struct (PR 100574)

2021-05-14 Thread Martin Sebor via Gcc-patches
On 5/13/21 10:53 PM, Bernd Edlinger wrote: On 5/14/21 12:35 AM, Martin Sebor wrote: On 5/13/21 11:36 AM, Martin Sebor wrote: On 5/13/21 11:20 AM, Bernd Edlinger wrote: On 5/13/21 3:55 AM, Martin Sebor via Gcc-patches wrote: A logic bug in the handling of PHI arguments in compute_objsize that

Re: [PATCH RFA (diagnostic)] c++: -Wdeprecated-copy and #pragma diagnostic [PR94492]

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 1:28 PM, Jason Merrill via Gcc-patches wrote: Ping. On 4/28/21 9:32 AM, Jason Merrill wrote:   -Wdeprecated-copy was depending only on the state of the warning at the point where we call the function, making it hard to use #pragma diagnostic to suppress the warning for a particular

Re: [PATCH RFA] tree-iterator: C++11 range-for and tree_stmt_iterator

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 1:26 PM, Jason Merrill via Gcc-patches wrote: Ping. On 5/1/21 12:29 PM, Jason Merrill wrote: Like my recent patch to add ovl_range and lkp_range in the C++ front end, this patch adds the tsi_range adaptor for using C++11 range-based 'for' with a STATEMENT_LIST, e.g.    for (tree s

Re: [PATCH] avoid using an incompletely populated struct (PR 100574)

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 11:36 AM, Martin Sebor wrote: On 5/13/21 11:20 AM, Bernd Edlinger wrote: On 5/13/21 3:55 AM, Martin Sebor via Gcc-patches wrote: A logic bug in the handling of PHI arguments in compute_objsize that are all null pointers lets an incompletely populated struct be used in a way that

Re: [PATCH] avoid a couple of missing -Wuninitialized (PR 98583, 93100)

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 1:03 PM, Jeff Law wrote: On 5/11/2021 1:49 PM, Martin Sebor via Gcc-patches wrote: The attached change teaches the uninitialized pass about __builtin_stack_restore and __builtin___asan_mark to avoid two classes of -Wuninitialized false negatives. Richard, you already approved the

Re: [PATCH] avoid using an incompletely populated struct (PR 100574)

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 11:20 AM, Bernd Edlinger wrote: On 5/13/21 3:55 AM, Martin Sebor via Gcc-patches wrote: A logic bug in the handling of PHI arguments in compute_objsize that are all null pointers lets an incompletely populated struct be used in a way that triggers an assertion causing an ICE. The

Re: [PATCH] attributes: target_clone expects a string argument

2021-05-13 Thread Martin Sebor via Gcc-patches
On 5/13/21 6:05 AM, Martin Liška wrote: Hello. The change is about error handling. Ready to be installed? Thanks, Martin PR middle-end/100504 gcc/c-family/ChangeLog: * c-attribs.c (handle_target_clones_attribute): Expect a string argument to target_clone argument. gcc/testsui

[PATCH] avoid using an incompletely populated struct (PR 100574)

2021-05-12 Thread Martin Sebor via Gcc-patches
A logic bug in the handling of PHI arguments in compute_objsize that are all null pointers lets an incompletely populated struct be used in a way that triggers an assertion causing an ICE. The attached patch corrects that by having compute_objsize fail when the struct isn't fully populated (when

[PATCH] avoid erroneous VLA bounds (PR 100550)

2021-05-12 Thread Martin Sebor via Gcc-patches
An erroneous VLA parameter bound in a function redeclaration causes an ICE as the -Wvla-parameter is trying to format a diagnostic after an error has already been issued. The attached change prevents such parameters from being considered. This patch is for trunk and GCC 11. Martin PR c/100550 -

[committed] avoid bogus -Wstringop-overflow with VLA (PR 100571)

2021-05-12 Thread Martin Sebor via Gcc-patches
hange fixes just the narrow problem that impacts Glibc. I have committed it to 10-branch in r10-9819. Martin commit 7b6740756c9ca64dd01097b629c19e26d3d6a504 Author: Martin Sebor Date: Wed May 12 15:45:44 2021 -0600 PR middle-end/100571 - bogus -Wstringop-overflow with VLA of elements larger

Re: [PATCH] middle-end/100464 - avoid spurious TREE_ADDRESSABLE in folding debug stmts

2021-05-12 Thread Martin Sebor via Gcc-patches
On 5/7/21 4:21 AM, Richard Biener via Gcc-patches wrote: On Fri, May 7, 2021 at 12:17 PM Richard Biener wrote: canonicalize_constructor_val was setting TREE_ADDRESSABLE on bases of ADDR_EXPRs but that's futile when we're dealing with CTOR values in debug stmts. This rips out the code which wa

Re: [PATCH 2/2] c/100547 - reject overly large vector_size attributes

2021-05-12 Thread Martin Sebor via Gcc-patches
On 5/12/21 2:47 AM, Richard Biener wrote: This rejects a number of vector components that does not fit an 'int' which is an internal limitation of RTVEC. This regresses gcc.dg/attr-vector_size.c which checks for much larger supported vectors. Not sure what to do about this - I'll also note the

[PING 2][PATCH] define auto_vec copy ctor and assignment (PR 90904)

2021-05-11 Thread Martin Sebor via Gcc-patches
Ping 2: https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568901.html On 5/3/21 3:50 PM, Martin Sebor wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568901.html On 4/27/21 9:52 AM, Martin Sebor wrote: On 4/27/21 8:04 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 3

Re: [stage 1 patch] remove unreachable code in expand_expr_real_1 (PR 21433)

2021-05-11 Thread Martin Sebor via Gcc-patches
On 2/12/21 1:55 AM, Richard Biener wrote: On Fri, Feb 12, 2021 at 1:35 AM Martin Sebor via Gcc-patches wrote: While trawling through old bugs I came across one from 2005: PR 21433 - The COMPONENT_REF case of expand_expr_real_1 is probably wrong. The report looks correct in that argument 0 in

[PATCH] avoid a couple of missing -Wuninitialized (PR 98583, 93100)

2021-05-11 Thread Martin Sebor via Gcc-patches
The attached change teaches the uninitialized pass about __builtin_stack_restore and __builtin___asan_mark to avoid two classes of -Wuninitialized false negatives. Richard, you already approved the __builtin_stack_restore change in the bug but I figured I'd submit a patch with both changes for ap

Re: [PATCH] run early sprintf warning after SSA (PR 100325)

2021-05-06 Thread Martin Sebor via Gcc-patches
On 5/6/21 8:32 AM, Aldy Hernandez wrote: On 5/5/21 9:26 AM, Richard Biener wrote: On Wed, May 5, 2021 at 1:32 AM Martin Sebor via Gcc-patches wrote: With no optimization, -Wformat-overflow and -Wformat-truncation runs early to detect a subset of simple bugs.  But as it turns out, the pass

Re: [PATCH] -Walloca-larger-than with constant sizes at -O0 (PR 100425)

2021-05-05 Thread Martin Sebor via Gcc-patches
On 5/5/21 1:32 AM, Richard Biener wrote: On Wed, May 5, 2021 at 4:20 AM Martin Sebor via Gcc-patches wrote: Even when explicitly enabled, -Walloca-larger-than doesn't run unless optimization is enabled as well. This prevents diagnosing alloca calls with constant arguments in excess o

Re: [PATCH] phiopt: Optimize (x <=> y) cmp z [PR94589]

2021-05-05 Thread Martin Sebor via Gcc-patches
On 5/4/21 1:44 AM, Jakub Jelinek via Gcc-patches wrote: Hi! genericize_spaceship genericizes i <=> j to approximately ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else c = 1; c; }) for strong ordering and ({ int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c

[PATCH] -Walloca-larger-than with constant sizes at -O0 (PR 100425)

2021-05-04 Thread Martin Sebor via Gcc-patches
Even when explicitly enabled, -Walloca-larger-than doesn't run unless optimization is enabled as well. This prevents diagnosing alloca calls with constant arguments in excess of the limit that could otherwise be flagged even at -O0, making the warning less consistent and less useful than is possi

[PATCH] run early sprintf warning after SSA (PR 100325)

2021-05-04 Thread Martin Sebor via Gcc-patches
With no optimization, -Wformat-overflow and -Wformat-truncation runs early to detect a subset of simple bugs. But as it turns out, the pass runs just a tad too early, before SSA. That causes it to miss a class of problems that can easily be detected once code is in SSA form, and I would expect m

[PING][PATCH] define auto_vec copy ctor and assignment (PR 90904)

2021-05-03 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568901.html On 4/27/21 9:52 AM, Martin Sebor wrote: On 4/27/21 8:04 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 3:59 PM Martin Sebor wrote: On 4/27/21 1:58 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 2:46 AM Martin

Re: [PATCH] lto-wrapper: Use vec data type.

2021-04-29 Thread Martin Sebor via Gcc-patches
On 4/29/21 6:22 AM, Richard Biener via Gcc-patches wrote: On Wed, Apr 21, 2021 at 11:12 AM Martin Liška wrote: Now living in the 21st century, we don't longer need using the following tuple: cl_decoded_option **decoded_options, unsigned int *decoded_options_count) but we can rather use a sta

Re: [PATCH] move pass free_lang_data to its own file

2021-04-28 Thread Martin Sebor via Gcc-patches
On 4/28/21 12:53 AM, Richard Biener wrote: On Wed, Apr 28, 2021 at 1:30 AM Martin Sebor via Gcc-patches wrote: The free_lang_data pass is defined entirely in tree.c. Its code changes only rarely (only 13% commits to tree.c), and unlike the rest of tree.c, is even more rarely read. The pass

[PATCH] clear base0 flag for pointers (PR 100307)

2021-04-28 Thread Martin Sebor via Gcc-patches
When the compute_objsize_r() function sees a pointer whose target it can't determine it sets the size of the pointed to object to the maximum but it doesn't clear the base0 flag to indicate that the offset need not be zero-based. This is done when the source is in SSA form but not before. Since

Re: [PATCH] doc/options.texi: Fix the discription of 'Negative'.

2021-04-28 Thread Martin Sebor via Gcc-patches
On 4/28/21 3:24 AM, Geng Qi via Gcc-patches wrote: gcc/ChangeLog: * doc/options.texi (Negative): Fix the discription so that it matches the code implementation of prune_options(). --- gcc/doc/options.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g

[PATCH] move pass free_lang_data to its own file

2021-04-27 Thread Martin Sebor via Gcc-patches
The free_lang_data pass is defined entirely in tree.c. Its code changes only rarely (only 13% commits to tree.c), and unlike the rest of tree.c, is even more rarely read. The pass is also right in the middle of tree.c, surrounded by various utility functions many of which do tend to be frequentl

Re: [PATCH] define auto_vec copy ctor and assignment (PR 90904)

2021-04-27 Thread Martin Sebor via Gcc-patches
On 4/27/21 8:04 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 3:59 PM Martin Sebor wrote: On 4/27/21 1:58 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 2:46 AM Martin Sebor via Gcc-patches wrote: PR 90904 notes that auto_vec is unsafe to copy and assign because the class manages

Re: [PATCH] define auto_vec copy ctor and assignment (PR 90904)

2021-04-27 Thread Martin Sebor via Gcc-patches
On 4/27/21 1:58 AM, Richard Biener wrote: On Tue, Apr 27, 2021 at 2:46 AM Martin Sebor via Gcc-patches wrote: PR 90904 notes that auto_vec is unsafe to copy and assign because the class manages its own memory but doesn't define (or delete) either special function. Since I first ran int

[PATCH] define auto_vec copy ctor and assignment (PR 90904)

2021-04-26 Thread Martin Sebor via Gcc-patches
PR 90904 notes that auto_vec is unsafe to copy and assign because the class manages its own memory but doesn't define (or delete) either special function. Since I first ran into the problem, auto_vec has grown a move ctor and move assignment from a dynamically-allocated vec but still no copy ctor

[PATCH] avoid dereferencing a null pointer (PR 100250)

2021-04-26 Thread Martin Sebor via Gcc-patches
The VLA bounds that are included by the C front end to attribute access added to functions with VLA parameters to help detect redeclaratations of function with "mismatched" VLA bounds are cleared by the free_lang_data pass before the IL reaches the middle end. The clearing was done to fix pr97172

Re: [PATCH] Use STATIC_ASSERT for OVL_OP_MAX.

2021-04-22 Thread Martin Sebor via Gcc-patches
On 4/22/21 9:41 AM, Jonathan Wakely wrote: On Thu, 22 Apr 2021 at 15:59, Martin Sebor wrote: On 4/22/21 2:52 AM, Jonathan Wakely wrote: On Thu, 22 Apr 2021, 08:47 Martin Liška, wrote: On 4/21/21 6:11 PM, Martin Sebor wrote: > On 4/21/21 2:15 AM, Martin Liška wrote: >&

Re: [PATCH] Use STATIC_ASSERT for OVL_OP_MAX.

2021-04-22 Thread Martin Sebor via Gcc-patches
On 4/22/21 2:52 AM, Jonathan Wakely wrote: On Thu, 22 Apr 2021, 08:47 Martin Liška, wrote: On 4/21/21 6:11 PM, Martin Sebor wrote: > On 4/21/21 2:15 AM, Martin Liška wrote: >> Hello. >> >> It's addressing the following Clang warning: &

Re: [PATCH v4 2/2] x86: Add general_regs_only function attribute

2021-04-21 Thread Martin Sebor via Gcc-patches
On 4/21/21 2:58 PM, H.J. Lu wrote: On Wed, Apr 21, 2021 at 10:09 AM Martin Sebor wrote: On 4/14/21 4:39 PM, H.J. Lu wrote: commit 87c753ac241f25d222d46ba1ac66ceba89d6a200 Author: H.J. Lu Date: Fri Aug 21 09:42:49 2020 -0700 x86: Add target("general-regs-only") function

Re: [PATCH v4 2/2] x86: Add general_regs_only function attribute

2021-04-21 Thread Martin Sebor via Gcc-patches
On 4/14/21 4:39 PM, H.J. Lu wrote: commit 87c753ac241f25d222d46ba1ac66ceba89d6a200 Author: H.J. Lu Date: Fri Aug 21 09:42:49 2020 -0700 x86: Add target("general-regs-only") function attribute is incomplete since it is impossible to call integer intrinsics from a function with general-re

Re: [PATCH v4 2/2] x86: Add general_regs_only function attribute

2021-04-21 Thread Martin Sebor via Gcc-patches
On 4/21/21 1:30 AM, Uros Bizjak wrote: On Thu, Apr 15, 2021 at 12:39 AM H.J. Lu wrote: commit 87c753ac241f25d222d46ba1ac66ceba89d6a200 Author: H.J. Lu Date: Fri Aug 21 09:42:49 2020 -0700 x86: Add target("general-regs-only") function attribute is incomplete since it is impossible to

Re: [PATCH] Use STATIC_ASSERT for OVL_OP_MAX.

2021-04-21 Thread Martin Sebor via Gcc-patches
On 4/21/21 2:15 AM, Martin Liška wrote: Hello. It's addressing the following Clang warning: cp/lex.c:170:45: warning: result of comparison of constant 64 with expression of type 'enum ovl_op_code' is always true [-Wtautological-constant-out-of-range-compare] Patch can bootstrap on x86_64-linu

Re: move selftests into their own files?

2021-04-19 Thread Martin Sebor via Gcc-patches
On 4/19/21 3:13 PM, Koning, Paul wrote: On Apr 19, 2021, at 4:50 PM, Martin Sebor via Gcc-patches wrote: On 4/19/21 2:03 PM, David Malcolm wrote: On Mon, 2021-04-19 at 13:47 -0600, Martin Sebor via Gcc-patches wrote: The selftests at the end of many source files are only rarely read or

Re: move selftests into their own files?

2021-04-19 Thread Martin Sebor via Gcc-patches
On 4/19/21 2:03 PM, David Malcolm wrote: On Mon, 2021-04-19 at 13:47 -0600, Martin Sebor via Gcc-patches wrote: The selftests at the end of many source files are only rarely read or modified, but they contribute to the size/complexity of the files and make moving within the rest of the code

move selftests into their own files?

2021-04-19 Thread Martin Sebor via Gcc-patches
The selftests at the end of many source files are only rarely read or modified, but they contribute to the size/complexity of the files and make moving within the rest of the code more difficult. Would anyone be opposed to moving any of them into new files of their own? E.g., those in tree.c to t

[committed] add tests for Bug 89230

2021-04-15 Thread Martin Sebor via Gcc-patches
2dbbbe893f75f587c48111ab4c97cf5e74fb91bb Author: Martin Sebor Date: Thu Apr 15 14:09:56 2021 -0600 PR middle-end/89230 - Bogus uninited usage warning with printf gcc/testsuite/ChangeLog: * gcc.dg/uninit-pr89230-1.c: New test. * gcc.dg/uninit-pr89230-2.c: Same. diff --git a/gcc/testsuite/gcc.dg

Re: [PATCH] Deprecate gimple-builder.h API

2021-04-15 Thread Martin Sebor via Gcc-patches
On 4/15/21 5:01 AM, Richard Biener wrote: This adds a deprecation note to the undocumented gimple-builder.h API only used by asan and sancov. Pushed. 2021-04-15 Richard Biener * gimple-builder.h: Add deprecation note. --- gcc/gimple-builder.h | 2 ++ 1 file changed, 2 insertions(

Re: [committed] add test for PR 86058

2021-04-14 Thread Martin Sebor via Gcc-patches
On 4/14/21 2:11 AM, Christophe Lyon wrote: On Tue, 13 Apr 2021 at 21:50, Martin Sebor via Gcc-patches wrote: The issue has been fixed so r11-8161 just adds the test case: https://gcc.gnu.org/g:8084ab15a3e300e3b2c537e56e0f3a1b00778aec Hi, This new test fails on arm (and aarch64 with

[committed] add test for PR 82800

2021-04-13 Thread Martin Sebor via Gcc-patches
The bug was fixed years ago. r11-8162 adds the test case to the test suite. https://gcc.gnu.org/g:af7128621e54f04b90589bb0c3e1ef271c239265 Martin

[committed] add test for PR 86058

2021-04-13 Thread Martin Sebor via Gcc-patches
The issue has been fixed so r11-8161 just adds the test case: https://gcc.gnu.org/g:8084ab15a3e300e3b2c537e56e0f3a1b00778aec Martin

Re: [PATCH] propagate attributes to local redeclaration (PR 99420)

2021-04-13 Thread Martin Sebor via Gcc-patches
On 4/13/21 10:07 AM, Jeff Law wrote: On 4/8/2021 4:15 PM, Martin Sebor via Gcc-patches wrote: The C front end ordinarily merges function type attributes upon the redeclaration of a function but it doesn't do that for those at local scope, unless the declaration refers to a built-in. Be

Re: [GCC 12] [PATCH v2] Add inline_ignore_target function attribute

2021-04-13 Thread Martin Sebor via Gcc-patches
On 4/12/21 7:03 PM, H.J. Lu wrote: On Mon, Apr 12, 2021 at 4:55 PM Martin Sebor wrote: On 4/12/21 3:53 PM, H.J. Lu via Gcc-patches wrote: On Mon, Apr 12, 2021 at 2:21 AM Richard Biener wrote: On Sat, Apr 10, 2021 at 5:11 PM H.J. Lu via Gcc-patches wrote: Add inline_ignore_target

Re: [GCC 12] [PATCH v2] Add inline_ignore_target function attribute

2021-04-12 Thread Martin Sebor via Gcc-patches
On 4/12/21 3:53 PM, H.J. Lu via Gcc-patches wrote: On Mon, Apr 12, 2021 at 2:21 AM Richard Biener wrote: On Sat, Apr 10, 2021 at 5:11 PM H.J. Lu via Gcc-patches wrote: Add inline_ignore_target function attribute to inform the compiler that target specific option mismatch on functions with t

[committed] add test case for PR 55288

2021-04-09 Thread Martin Sebor via Gcc-patches
The false positive warning disappeared years ago. r11-8099 adds a test but I leave the bug open since it's a request for a better suppression mechanism that what's available in GCC today. Martin

Re: [committed] libgomp: Silence false positive -Wmaybe-uninitialized warning [PR99984]

2021-04-09 Thread Martin Sebor via Gcc-patches
On 4/9/21 10:30 AM, Jakub Jelinek wrote: On Fri, Apr 09, 2021 at 10:28:47AM -0600, Martin Sebor wrote: pthread_setspecific second argument is const void *, so that one can call it even with pointers to const, but the function only stores the pointer and does nothing else, so the new assumption

Re: [committed] libgomp: Silence false positive -Wmaybe-uninitialized warning [PR99984]

2021-04-09 Thread Martin Sebor via Gcc-patches
On 4/9/21 2:25 AM, Jakub Jelinek via Gcc-patches wrote: Hi! pthread_setspecific second argument is const void *, so that one can call it even with pointers to const, but the function only stores the pointer and does nothing else, so the new assumption of -Wmaybe-uninitialized that functions taki

[PATCH] propagate attributes to local redeclaration (PR 99420)

2021-04-08 Thread Martin Sebor via Gcc-patches
The C front end ordinarily merges function type attributes upon the redeclaration of a function but it doesn't do that for those at local scope, unless the declaration refers to a built-in. Because the new -Warray-parameter warning relies on the internal access attribute on the type of the functi

fix a couple of typos (PR 99883)

2021-04-07 Thread Martin Sebor via Gcc-patches
The attached patch fixes a couple of typos. Not sure they qualify as regressions but it seems like a trivial fix worth making even now. I'll go ahead and commit it as obvious if no-one objects. Martin PR middle-end/99883 - A couple of minor misspellings gcc/c-family/ChangeLog: * c.opt (Wmism

Re: [gcc r11-7940] Make USES_COMDAT_LOCAL CIF_FINAL_NORMAL

2021-04-02 Thread Martin Sebor via Gcc-patches
On 4/2/21 9:40 AM, Jan Hubicka wrote: This breaks bootstrap on riscv64: In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool ’, inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at ../../gcc/gimple-ssa-warn-alloca.c:295:25: ../../gcc/gimple-ss

Re: RFC: Sphinx for GCC documentation

2021-04-02 Thread Martin Sebor via Gcc-patches
On 4/1/21 7:30 AM, Martin Liška wrote: Hey. I've returned to the David's project and I'm willing to finish his transition effort. I believe using Sphinx documentation can rapidly improve readability, both HTML and PDF version, of various GCC manuals ([1]). I've spent some time working on the D

[committed] add test for PR 65182

2021-03-31 Thread Martin Sebor via Gcc-patches
r11-7932 adds a test case for another ancient -Wuninitialized bug fixed eons ago: https://gcc.gnu.org/g:31199d95de1304e200554bbf98b2d8a6a7298bec Martin

[committed] add test for PR 59970

2021-03-26 Thread Martin Sebor via Gcc-patches
The bug has been fixed for a few years now. r11-7869 adds the test for it: https://gcc.gnu.org/g:980b12cc81979e52f491bf0dfe961d30c07fe864 Martin

[committed] new test for PR 55060

2021-03-25 Thread Martin Sebor via Gcc-patches
The bug was fixed in GCC 5.0 but never resolved. I've added a test case in the commit below and resolved it: https://gcc.gnu.org/g:e88ca9f42306e291d3cb2d34dd7f2b017a3c1e52 Martin

[committed] add test for PR tree-optimization/48483

2021-03-25 Thread Martin Sebor via Gcc-patches
All the test cases in the bug but one pass. The one that doesn't seems sufficiently different to track separately. I've committed a test with the test cases in r11-7840 and resolved the bug. Martin

[committed] add test for PR 44547

2021-03-25 Thread Martin Sebor via Gcc-patches
PR tree-optimization/44547 - -Wuninitialized reports false warning in nested switch statements, has been resolved for some time. In r11-7839 I've committed the test and resolved the bug as fixed. Martin

Re: Patch ping

2021-03-24 Thread Martin Sebor via Gcc-patches
On 3/24/21 10:40 AM, Jakub Jelinek wrote: On Wed, Mar 24, 2021 at 09:45:31AM -0600, Martin Sebor via Gcc-patches wrote: E.g., OEP_IGNORE_MEMBER_OFFSET or OEP_SAME_MEMBER_OFFSET (for the converse of the first) or something like that, but hopefully you get the idea. Neither of these look like a

Re: Patch ping

2021-03-24 Thread Martin Sebor via Gcc-patches
On 3/24/21 5:44 AM, Jakub Jelinek via Gcc-patches wrote: Hi! I'd like to ping the https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566821.html P1 PR99565 fix. Marek has acked the gcc/c/ and gcc/c-family/ part of that patch, but it still has gcc/cp/ and gcc/ parts that weren't acked. If you

Re: [committed] nios2: Fix format complaints and similar diagnostics

2021-03-21 Thread Martin Sebor via Gcc-patches
On 3/17/21 6:00 PM, Sandra Loosemore wrote: On 3/17/21 4:40 PM, Martin Sebor wrote: [*] Does -Wformat-diag really trigger when using older GCC to build? I thought it only triggered in stage 2 and 3 when using the same GCC to rebuild itself. I always end up hopelessly confused by anything

Re: [PING][PATCH] adjust "partly out of bounds" warning (PR 98503)

2021-03-21 Thread Martin Sebor via Gcc-patches
On 3/20/21 10:48 AM, Jeff Law via Gcc-patches wrote: On 3/18/2021 4:18 PM, Martin Sebor via Gcc-patches wrote: Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564483.html The review of this patch digressed into a design discussion of a new, more capable implementation of -Wstrict

Re: [PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-19 Thread Martin Sebor via Gcc-patches
On 3/19/21 12:49 PM, Jakub Jelinek via Gcc-patches wrote: On Fri, Mar 19, 2021 at 02:17:39PM -0400, Jason Merrill wrote: --- gcc/cp/decl.c.jj2021-03-16 21:17:41.014498713 +0100 +++ gcc/cp/decl.c 2021-03-18 19:31:22.430149523 +0100 @@ -8629,6 +8629,11 @@ cp_finish_decomp (tree decl, tre

[PING][PATCH] adjust "partly out of bounds" warning (PR 98503)

2021-03-18 Thread Martin Sebor via Gcc-patches
Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564483.html The review of this patch digressed into a design discussion of a new, more capable implementation of -Wstrict-aliasing, but the proposed patch turning just this one instance of -Warray-bounds into -Wstrict-aliasing and makin

Re: [PATCH] testsuite: Fix up strlenopt-80.c on powerpc [PR99636]

2021-03-18 Thread Martin Sebor via Gcc-patches
On 3/18/21 8:58 AM, Jeff Law via Gcc-patches wrote: On 3/18/2021 8:37 AM, Jakub Jelinek via Gcc-patches wrote: Hi! Similar issue as in strlenopt-73.c, various spots in this test rely on MOVE_MAX >= 8, this time it uses a target selector to pick up a couple of targets, and all of them but power

Re: [PATCH] RFC: come up with startswith function.

2021-03-18 Thread Martin Sebor via Gcc-patches
On 3/18/21 4:46 AM, Martin Liška wrote: Hey. Recently, I noticed a cumbersome construct we use for string startswith function (most notably in a situation when the prefix is a string literal). Commonly used patterns are: 1) strncmp (arg, "--sysroot=", 10) == 0 2) strncmp (name, "not found", s

Re: [committed] nios2: Fix format complaints and similar diagnostics

2021-03-17 Thread Martin Sebor via Gcc-patches
On 3/17/21 4:01 PM, Sandra Loosemore wrote: I've checked in this patch, after having received a report a few days ago that the nios2 back end was not building.  Most of the changes here are purely cosmetic. Swapping out my nios2 maintainer hat for the documentation maintainer one, though: the

Re: [PATCH] tighten up checking for virtual bases (PR 99502)

2021-03-17 Thread Martin Sebor via Gcc-patches
On 3/17/21 1:40 PM, Jason Merrill wrote: On 3/17/21 3:03 PM, Martin Sebor wrote: On 3/16/21 2:24 PM, Jason Merrill wrote: On 3/11/21 1:06 PM, Martin Sebor wrote: More extensive testing of the patch I just committed in r11-7563 to avoid the false positive -Warray-bounds on accesses to members

Re: [PATCH] tighten up checking for virtual bases (PR 99502)

2021-03-17 Thread Martin Sebor via Gcc-patches
On 3/16/21 2:24 PM, Jason Merrill wrote: On 3/11/21 1:06 PM, Martin Sebor wrote: More extensive testing of the patch I just committed in r11-7563 to avoid the false positive -Warray-bounds on accesses to members of virtual bases has exposed a couple of problems that cause many false negatives

Re: [PATCH] c-family: Fix up -Wduplicated-branches for union members [PR99565]

2021-03-17 Thread Martin Sebor via Gcc-patches
On 3/17/21 2:36 AM, Jakub Jelinek wrote: On Tue, Mar 16, 2021 at 06:28:46PM -0600, Martin Sebor via Gcc-patches wrote: It seems sort of "inverted:" I'd expect OEP_LEXICOGRAPHIC on its own to do a lexicographical comparison, without having to set an additional bit to ask for

Re: [PATCH] c-family: Fix up -Wduplicated-branches for union members [PR99565]

2021-03-16 Thread Martin Sebor via Gcc-patches
On 3/16/21 11:56 AM, Jakub Jelinek via Gcc-patches wrote: Hi! Honza has fairly recently changed operand_equal_p to compare DECL_FIELD_OFFSET for COMPONENT_REFs when comparing addresses. As the first testcase in this patch shows, while that is very nice for optimizations, for the -Wduplicated-bra

Re: [PATCH][pushed] analyzer: document new param

2021-03-16 Thread Martin Sebor via Gcc-patches
On 3/16/21 3:08 AM, Martin Liška wrote: On 3/15/21 9:57 PM, Martin Sebor wrote: Any plans to integrate it into the testsuite?  (That way we presumably wouldn't need to remember to run it by hand.) Likely not, I'm not so big friend with DejaGNU. Are you willing to help me with that?

Re: [PATCH][pushed] analyzer: document new param

2021-03-15 Thread Martin Sebor via Gcc-patches
On 3/12/21 7:02 AM, Martin Liška wrote: On 3/12/21 2:56 PM, David Malcolm wrote: On Fri, 2021-03-12 at 09:45 +0100, Martin Liška wrote: Identified by my check that compares documentation of params with content of --help=param output. Pushed as obvious. Martin Thanks. Which check is this, BT

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-03-13 Thread Martin Sebor via Gcc-patches
On 3/12/21 6:27 AM, Jakub Jelinek wrote: On Mon, Mar 08, 2021 at 07:37:46PM -0700, Martin Sebor via Gcc-patches wrote: Accesses to zero-length arrays continue to be diagnosed (except for trailing arrays of unknown objects), as are nonempty accesses to empty types. The warning message for (3

Re: [PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-13 Thread Martin Sebor via Gcc-patches
On 3/12/21 6:52 AM, Jakub Jelinek wrote: On Tue, Mar 09, 2021 at 03:07:38PM -0700, Martin Sebor via Gcc-patches wrote: The gimple_call_alloc_size() function is documented to "return null when STMT is not a call to a valid allocation function" but the code assumes STMT is a call

[PATCH] tighten up checking for virtual bases (PR 99502)

2021-03-11 Thread Martin Sebor via Gcc-patches
More extensive testing of the patch I just committed in r11-7563 to avoid the false positive -Warray-bounds on accesses to members of virtual bases has exposed a couple of problems that cause many false negatives for even basic bugs like: typedef struct A { int i; } A; void* g (void) {

Re: [PATCH] c: don't drop typedef information in casts

2021-03-10 Thread Martin Sebor via Gcc-patches
On 3/9/21 6:46 PM, David Lamparter wrote: On Wed, Mar 10, 2021 at 02:28:15AM +0100, David Lamparter wrote: The TYPE_MAIN_VARIANT() here was, for casts to a typedef'd type name, resulting in all information about the typedef's involvement getting lost. This drops necessary information for warnin

[PATCH] avoid assuming gimple_call_alloc_size argument is a call (PR 99489)

2021-03-09 Thread Martin Sebor via Gcc-patches
The gimple_call_alloc_size() function is documented to "return null when STMT is not a call to a valid allocation function" but the code assumes STMT is a call statement, causing the function to ICE when it isn't. The attached patch changes the function to fulfill its contract and return null als

Re: [PATCH] handle VLA of zero length arrays and vice versa (PR 99121)

2021-03-08 Thread Martin Sebor via Gcc-patches
on x86_64-linux. On 2/18/21 1:55 PM, Martin Sebor wrote: On 2/18/21 11:03 AM, Jakub Jelinek wrote: On Thu, Feb 18, 2021 at 07:00:52PM +0100, Jakub Jelinek wrote: The size of the VLA is zero regardless of its bound and accessing it is invalid so the warning is expected. Yes, some warning, but n

Re: [PATCH] c++: -Wconversion vs value-dependent expressions [PR99331]

2021-03-08 Thread Martin Sebor via Gcc-patches
On 3/5/21 3:03 PM, Jason Merrill via Gcc-patches wrote: On 3/4/21 9:37 PM, Marek Polacek wrote: This PR complains that we issue a -Wconversion warning in    template struct X {};    template X foo(); saying "conversion from 'long unsigned int' to 'int' may change value". While it's not techn

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-04 Thread Martin Sebor via Gcc-patches
On 3/3/21 10:33 PM, Jason Merrill wrote: On 3/3/21 6:20 PM, Martin Sebor wrote: ... I see what you mean, thanks, but I can't think of a test case to trigger a false negative due to the smaller offset.  Any suggestions? My only ideas involve undefined behavior, casting the address

Re: [PATCH] correct fix to avoid false positives for vectorized stores (PR 96963, 94655)

2021-03-03 Thread Martin Sebor via Gcc-patches
On 3/3/21 3:31 AM, Richard Biener wrote: On Tue, Mar 2, 2021 at 9:23 PM Martin Sebor wrote: On 3/2/21 3:39 AM, Richard Biener wrote: On Fri, Jan 22, 2021 at 12:39 AM Martin Sebor via Gcc-patches wrote: The hack I put in compute_objsize() last January for pr93200 isn't quite correct

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-03 Thread Martin Sebor via Gcc-patches
On 3/2/21 7:11 AM, Jason Merrill wrote: On 3/1/21 6:11 PM, Martin Sebor wrote: On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification

[committed] remove stray warning text (PR 99276)

2021-03-02 Thread Martin Sebor via Gcc-patches
In PR 99276 a translator points out malformed warning message newly introduced into GCC 11. In r11-7460 I have committed the attached patch to remove the stray text. Martin commit e7ca37649e4f322e7512c6d11813992c61b0a4b3 Author: Martin Sebor Date: Tue Mar 2 13:37:01 2021 -0700 PR middle

Re: [PATCH] middle-end/97855 - fix diagnostic with default pretty printer

2021-03-02 Thread Martin Sebor via Gcc-patches
On 3/2/21 9:52 AM, Jeff Law via Gcc-patches wrote: On 3/1/21 1:39 AM, Richard Biener wrote: The default diagnostic tree printer relies on dump_generic_node which for some reason manages to clobber the diagnostic pretty-printer state so we see garbled diagnostics like /home/rguenther/src/trunk

Re: [PATCH] correct fix to avoid false positives for vectorized stores (PR 96963, 94655)

2021-03-02 Thread Martin Sebor via Gcc-patches
On 3/2/21 3:39 AM, Richard Biener wrote: On Fri, Jan 22, 2021 at 12:39 AM Martin Sebor via Gcc-patches wrote: The hack I put in compute_objsize() last January for pr93200 isn't quite correct. It happened to suppress the false positive there but, due to what looks like a thinko on my

PING 5 [PATCH] correct fix to avoid false positives for vectorized stores (PR 96963, 94655)

2021-03-01 Thread Martin Sebor via Gcc-patches
Ping 5: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564059.html On 2/22/21 5:20 PM, Martin Sebor wrote: Ping 4: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564059.html On 2/14/21 5:43 PM, Martin Sebor wrote: Ping 3: https://gcc.gnu.org/pipermail/gcc-patches/2021-January

Re: [PATCH] avoid -Wnonull for dynamic_cast (PR 99251)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 3/1/21 1:33 PM, Jason Merrill wrote: On 3/1/21 12:10 PM, Martin Sebor wrote: On 2/24/21 8:13 PM, Jason Merrill wrote: On 2/24/21 5:25 PM, Martin Sebor wrote: In r11-6900 (PR 98646 - static_cast confuses -Wnonnull) we decided that issuing -Wnonnull for dereferencing the result of

Re: [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 2/25/21 4:40 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: I think the underlying problem is the same.  We're getting a size that doesn't correspond to what's actually being accessed, and it happens because of the virtual inheritance.  In pr97595 Jason sugge

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 2/24/21 5:35 PM, Jason Merrill wrote: On 2/23/21 6:07 PM, Martin Sebor wrote: On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote

[PATCH] clarify nonaliasing property of attribute malloc (PR 99295)

2021-03-01 Thread Martin Sebor via Gcc-patches
The documentation change made for pr83023 - branch probabilities pessimize malloc, introduced an ambiguity into the description of attribute malloc pointed out in pr99295. The change suggests that GCC assumes that most calls only to malloc and calloc but not to realloc return non-null. Subsequen

Re: [PATCH] avoid -Wnonull for dynamic_cast (PR 99251)

2021-03-01 Thread Martin Sebor via Gcc-patches
On 2/24/21 8:13 PM, Jason Merrill wrote: On 2/24/21 5:25 PM, Martin Sebor wrote: In r11-6900 (PR 98646 - static_cast confuses -Wnonnull) we decided that issuing -Wnonnull for dereferencing the result of dynamic_cast was helpful despite the false positives it causes when the pointer is

Re: [PATCH] clear more front end VLA bounds from IL (PR 97172)

2021-02-25 Thread Martin Sebor via Gcc-patches
On 2/25/21 9:06 AM, Christophe Lyon wrote: Hi, On Wed, 24 Feb 2021 at 09:57, Richard Biener via Gcc-patches wrote: On Tue, Feb 23, 2021 at 8:53 PM Martin Sebor via Gcc-patches wrote: Adding attribute access to declarations of functions that take VLA arguments relies on the front end

Re: [PATCH] match.pd, expand: Fold VCE from integer with [0, 1] range to bool into NOP_EXPR [PR80635]

2021-02-24 Thread Martin Sebor via Gcc-patches
On 2/24/21 5:13 AM, Jakub Jelinek via Gcc-patches wrote: On Wed, Feb 24, 2021 at 11:50:10AM +0100, Richard Biener wrote: In the PR using NOP_EXPR has been discussed as one possibility and has been rejected because at expansion it will emit a superfluous & 1 operation. I still think it is a good

[PATCH] avoid -Wnonull for dynamic_cast (PR 99251)

2021-02-24 Thread Martin Sebor via Gcc-patches
In r11-6900 (PR 98646 - static_cast confuses -Wnonnull) we decided that issuing -Wnonnull for dereferencing the result of dynamic_cast was helpful despite the false positives it causes when the pointer is guaranteed not to be null because of a prior test. The test case in PR 99251 along with the

Re: PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-23 Thread Martin Sebor via Gcc-patches
On 2/23/21 2:52 PM, Jason Merrill wrote: On 2/23/21 11:02 AM, Martin Sebor wrote: [CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2

Re: [PATCH] handle bad __dynamic_cast more gracefully (PR 99074)

2021-02-23 Thread Martin Sebor via Gcc-patches
On 2/22/21 7:03 PM, Jason Merrill wrote: On 2/22/21 8:00 PM, Martin Sebor wrote: On 2/22/21 4:08 PM, Jason Merrill wrote: On 2/13/21 7:31 PM, Martin Sebor wrote: The test case in PR 99074 invokes dynamic_cast with the this pointer in a non-static member function called on a null pointer.  The

[PATCH] clear more front end VLA bounds from IL (PR 97172)

2021-02-23 Thread Martin Sebor via Gcc-patches
Adding attribute access to declarations of functions that take VLA arguments relies on the front end adding attribute "arg spec" to each VLA parameter. Like the VLA bounds in attribute access, the same VLA bounds in attribute "arg spec" can cause trouble during LTO streaming which expects front e

PING [PATCH] avoid -Warray-bounds checks for vtable assignments (PR 98266)

2021-02-23 Thread Martin Sebor via Gcc-patches
[CC Jason for any further comments/clarification] On 2/9/21 10:49 AM, Martin Sebor wrote: On 2/8/21 4:11 PM, Jeff Law wrote: On 2/8/21 3:44 PM, Martin Sebor wrote: On 2/8/21 3:26 PM, Jeff Law wrote: On 2/8/21 2:56 PM, Martin Sebor wrote: On 2/8/21 12:59 PM, Jeff Law wrote: On 1/19/21

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