Reimplementation of -Wclobbered on GIMPLE SSA

2019-10-03 Thread Vladislav Ivanishin
Hi! This series implements the -Wclobbered warning on GIMPLE in place of the old RTL implementation. This cover letter contains a high-level explanation of what is going on and why. The new implementation itself is in the patch 3. I will post the details in the accompanying blurb. The most obv

[PATCH 1/3] Make gsi_next_nonvirtual_phi do what one expects

2019-10-03 Thread Vladislav Ivanishin
regstrapped this patch separately on x86_64-pc-linux-gnu. Ok? >From cbf3fa8408f54baffbec79d304d930e17aa7231c Mon Sep 17 00:00:00 2001 From: Vladislav Ivanishin Date: Thu, 29 Aug 2019 14:41:06 +0300 Subject: [PATCH 1/3] Make gsi_next_nonvirtual_phi do what one expects gcc/: * gim

[PATCH 2/3] Remove the old implementation of -Wclobbered

2019-10-03 Thread Vladislav Ivanishin
This patch removes the old implementation of the warning on RTL. Note: regstat_get_setjmp_crosses() and the associated data seems to be needed for the RA itself, so I am not touching that. >From c86a8fdc3f91d3cd33d73c7063bb9be2a7ae7e1f Mon Sep 17 00:00:00 2001 From: Vladislav Ivanishin D

[PATCH 3/3] Implementation of -Wclobbered on tree-ssa

2019-10-03 Thread Vladislav Ivanishin
What it does A fundamental limitation of the new approach is that it requires phi nodes for variables to perform the analysis it needs to issue the warning for them. No phis - no warning. In particular, it doesn't deal with register asm variables (see gcc.target/i386/attr-returns_tw

[obvious, PATCH 4/3][doc] -Wuninitialized doesn't do -Wclobbered's job

2019-10-03 Thread Vladislav Ivanishin
rom 1ddc87c39b5bf938fd4838c86d19ceeb20d518d8 Mon Sep 17 00:00:00 2001 From: Vladislav Ivanishin Date: Thu, 3 Oct 2019 17:01:48 +0300 Subject: [PATCH 4/4] [doc] -Wuninitialized doesn't do -Wclobbered's job * gcc/doc/invoke.texi (-Wuninitialized): Don't mention the clobbered

Re: [PATCH] tree-ssa-uninit: suppress more spurious warnings

2019-05-22 Thread Vladislav Ivanishin
Christophe, Rainer, Rainer Orth writes: > Hi Christophe, > >> On Fri, 17 May 2019 at 10:12, Vladislav Ivanishin wrote: >>> >> As you have probably noticed already, the new test uninit-28.c fails: >> /gcc/testsuite/gcc.dg/uninit-28-gimple.c:9:16: warning: '

Re: [PATCH] tree-ssa-uninit: suppress more spurious warnings

2019-05-23 Thread Vladislav Ivanishin
Iain Sandoe writes: >> On 22 May 2019, at 16:19, Jeff Law wrote: >> >> On 5/22/19 8:44 AM, Vladislav Ivanishin wrote: >>> Christophe, Rainer, >>> >>> Rainer Orth writes: >>> >>>> Hi Christophe, >>>> >>>

[committed, obvious] gcov-tool: Mark {merge,rewrite}_usage with noreturn attribute

2019-06-10 Thread Vladislav Ivanishin
/ChangeLog (revision 272118) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2019-06-10 Vladislav Ivanishin + + * gcov-tool.c (merge_usage, rewrite_usage): Mark with + ATTRIBUTE_NORETURN thus making consistent with overlap_usage. + 2019-06-10 Jakub Jelinek

[RFC, PATCH] Display inlining context for uninitialized warnings

2019-06-19 Thread Vladislav Ivanishin
Hi, This patch (partially) adds displaying inlining context for -W{maybe,}uninitialized warnings. This is not as trivial to enable as simply supplying the "%G" format specifier, so I have some questions below. I need this hunk void percent_K_format (text_info *text, location_t loc, tree blo

[PATCH, obvious] gdbhooks.py: rename parameters to match usage

2019-06-27 Thread Vladislav Ivanishin
Hi, The parameter names here were in the wrong order (which doesn't matter to the interpreter, but confuses the humans reading the calling code). I am going to install the following patch soon. gcc/ChangeLog: * gdbhooks.py (GdbPrettyPrinters.add_printer_for_types): Reorder param

[PATCH] make gdbhooks.py idempotent with respect to reloading

2019-06-28 Thread Vladislav Ivanishin
Hi! It is nice to be able to reload the pretty printers and convenience functions from gdbhooks.py without exiting GDB: reloading cc1 takes several seconds (plus, the debugging session is lost). Previously: (gdb) python import imp; imp.reload(gdbhooks); RuntimeError: pretty-printer already

[PATCH 1/2] gdbhooks.py: use strip_typedefs to simplify matching type names

2019-07-01 Thread Vladislav Ivanishin
Hi! GDB's Python API provides strip_typedefs method that can be instrumental for writing DRY code. Using it at least partially obviates the need for the add_printer_for_types method we have in gdbhooks.py (it takes a list of typenames to match and is usually used to deal with typedefs). I think,

[PATCH 2/2] gdbhooks.py: extend vec support in pretty printers

2019-07-01 Thread Vladislav Ivanishin
This change is threefold: - enable pretty printing of vec<>, not just vec<>* - generalize 'vec<(\S+), (\S+), (\S+)>' regex, which is limiting - extend to work for vl_ptr layout (only vl_embed was supported) The motivating example for all three is a vector of vectors in tree-ssa-uninit.c: type

Re: [PATCH 1/2] gdbhooks.py: use strip_typedefs to simplify matching type names

2019-07-02 Thread Vladislav Ivanishin
David Malcolm writes: > On Mon, 2019-07-01 at 12:50 +0300, Vladislav Ivanishin wrote: >> Hi! >> >> GDB's Python API provides strip_typedefs method that can be >> instrumental >> for writing DRY code. Using it at least partially obviates the need >>

Re: [PATCH 1/2] gdbhooks.py: use strip_typedefs to simplify matching type names

2019-07-02 Thread Vladislav Ivanishin
David Malcolm writes: > On Tue, 2019-07-02 at 14:29 +0300, Vladislav Ivanishin wrote: >> David Malcolm writes: >> >> > On Mon, 2019-07-01 at 12:50 +0300, Vladislav Ivanishin wrote: >> > > Hi! >> > > >> > > GDB's Python API p

Re: [PATCH] make gdbhooks.py idempotent with respect to reloading

2019-07-02 Thread Vladislav Ivanishin
Vladislav Ivanishin writes: > Hi! > > It is nice to be able to reload the pretty printers and convenience > functions from gdbhooks.py without exiting GDB: reloading cc1 takes > several seconds (plus, the debugging session is lost). > > Previously: > >(gdb) py

[PATCH] gdbhooks.py: dump-fn, dot-fn: cast ret values of fopen/fclose

2019-07-09 Thread Vladislav Ivanishin
Hi, Without the patch, I see these error messages with gdb 8.3: (gdb) Python Exception 'fclose@@GLIBC_2.2.5' has unknown return type; cast the call to its declared return type: (gdb) Error occurred in Python: 'fclose@@GLIBC_2.2.5' has unknown return type; cast the call to its dec

[committed] Re: [PATCH] make gdbhooks.py idempotent with respect to reloading

2019-07-23 Thread Vladislav Ivanishin
Vladislav Ivanishin writes: > Vladislav Ivanishin writes: > >> Hi! >> >> It is nice to be able to reload the pretty printers and convenience >> functions from gdbhooks.py without exiting GDB: reloading cc1 takes >> several seconds (plus, the debuggin

Ping: [RFC, PATCH] Display inlining context for uninitialized warnings

2019-07-24 Thread Vladislav Ivanishin
Hi, I'm pinging . I think, there are two subtopics to it that can be discussed separately. I would like to focus on the patch itself here. I am going to also start a subthread dedicated to dealing with representative returns. I still hav

Representative returns and location info (Re: [RFC, PATCH] Display inlining context for uninitialized warnings)

2019-07-24 Thread Vladislav Ivanishin
Jeff Law writes: > On 6/19/19 8:57 AM, Martin Sebor wrote: >> On 6/19/19 5:11 AM, Vladislav Ivanishin wrote: >>> Hi, >>> >>> This patch (partially) adds displaying inlining context for >>> -W{maybe,}uninitialized warnings.  This is not as trivial to e

Ping: [PATCH 1/2] gdbhooks.py: use strip_typedefs to simplify matching type names

2019-07-24 Thread Vladislav Ivanishin
Vladislav Ivanishin writes: > David Malcolm writes: > >> On Tue, 2019-07-02 at 14:29 +0300, Vladislav Ivanishin wrote: >>> David Malcolm writes: >>> >>> > On Mon, 2019-07-01 at 12:50 +0300, Vladislav Ivanishin wrote: >>> > > Hi! >>

[PATCH] Fix a missed case in predicate analysis of the late uninit pass

2019-04-01 Thread Vladislav Ivanishin
Hi! This is a fairly trivial change fixing a false negative in -Wmaybe-uninitialized. I am pretty sure this is simply an overlooked case (is_value_included_in() is not meant to deal with the case where both compare codes are NE_EXPRs, neither does it need to, since their handling is trivial). In

Re: [PATCH] Fix a missed case in predicate analysis of the late uninit pass

2019-04-04 Thread Vladislav Ivanishin
Richard Biener writes: > On Mon, Apr 1, 2019 at 5:36 PM Vladislav Ivanishin wrote: >> >> Hi! >> >> This is a fairly trivial change fixing a false negative in >> -Wmaybe-uninitialized. I am pretty sure this is simply an overlooked >> case (is_value_incl

Re: [PATCH] Fix a missed case in predicate analysis of the late uninit pass

2019-04-05 Thread Vladislav Ivanishin
Richard Biener writes: > On Thu, Apr 4, 2019 at 4:05 PM Vladislav Ivanishin wrote: >> >> Richard Biener writes: >> >> > On Mon, Apr 1, 2019 at 5:36 PM Vladislav Ivanishin wrote: >> >> >> >> Hi! >> >> >> >> This is

[RFC, PATCH] Don't introduce useless edge splits unless in PRE

2019-05-14 Thread Vladislav Ivanishin
make sense? >From d6d843653b82f277e780f19f2d2b3cc3125db8b5 Mon Sep 17 00:00:00 2001 From: Vladislav Ivanishin Date: Wed, 8 May 2019 20:29:34 +0300 Subject: [PATCH] Don't introduce useless edge splits unless in pre gcc/Changelog: * tree-cfg.h (split_critical_edges): Add in_pre_p p

[PATCH] Refactor away an obsolete is_unsigned distinction in is_value_included_in

2019-05-14 Thread Vladislav Ivanishin
Hi! This is just a clean-up. During the course of past refactorings, the then and else branches of `if (is_unsigned)` in is_value_included_in() became semantically equivalent and almost textually identical. This patch removes the conditional altogether. Regtested and bootstrapped with `BOOT_CFL

[PATCH] Fix PR90394, [10 Regression] ICE in is_value_included_in, at tree-ssa-uninit.c:1055

2019-05-15 Thread Vladislav Ivanishin
Hi! Here is a simple patch fixing the regression introduced in r270660. gcc/testsuite/ChangeLog: PR tree-optimization/90394 * gcc.dg/uninit-pr90394-1-gimple.c: New test. * gcc.dg/uninit-pr90394.c: New test. gcc/ChangeLog: PR tree-optimization/90394 * tree-ssa-uninit.c (is_pred_e

[PATCH] tree-ssa-uninit: suppress more spurious warnings

2019-05-17 Thread Vladislav Ivanishin
Hi! Without the patch, two of the newly added tests fail with bogus warnings: - gcc.dg/uninit-28-gimple.c (Definition guarded with NE_EXPR, use with BIT_AND_EXPR. This is an FP my previous patch [1] knowingly overlooks.) - gcc.dg/uninit-30-gimple.c (EQ_EXPR in the predicate guarding use. T

Re: [RFC, PATCH] Don't introduce useless edge splits unless in PRE

2019-05-17 Thread Vladislav Ivanishin
Richard Biener writes: > On Tue, May 14, 2019 at 3:58 PM Vladislav Ivanishin wrote: >> >> Hi! >> >> The split_critical_edges() function has multiple uses and it seems, a >> portion of its code was added to work only when called from tree-ssa-pre >> but rig

[PATCH, committed] Add myself to MAINTAINERS

2019-05-20 Thread Vladislav Ivanishin
=== --- ChangeLog (revision 271424) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2019-05-20 Vladislav Ivanishin + + * MAINTAINERS (Write After Approval): Add myself. + 2019-05-19 Peter Bergner * MAINTAINERS