Re: [PATCH 00/13] Remove remaining cfun-using macros from basic-block.h

2013-12-09 Thread David Malcolm
On Fri, 2013-12-06 at 16:41 +0100, Richard Biener wrote: > David Malcolm wrote: > >I have a series of 13 follow-up patches which remove the remaining > >"cfun"-using macros from basic-block.h > > > >Successfully bootstrapped®tested on x86_64-unknown-linux-g

Re: PATCH to add input_line macro to gdbinit.in

2013-12-13 Thread David Malcolm
On Thu, 2013-12-12 at 22:51 -0500, Jason Merrill wrote: > I often use input_line in breakpoint conditions when debugging the > compiler, and losing the macro complicates that. Any objection to > adding it to gdbinit.in? Fine by me.

[PATCH 01/16] Const-correctness fixes for some gimple accessors

2013-12-13 Thread David Malcolm
gcc/ * gimple.h (gimple_assign_single_p): Accept a const_gimple rather than a gimple. (gimple_store_p): Likewise. (gimple_assign_load_p): Likewise. (gimple_assign_cast_p): Likewise. (gimple_clobber_p): Likewise. --- gcc/gimple.h | 10 +- 1 fi

[RFC for next stage1 00/16] Compile-time gimple-checking

2013-12-13 Thread David Malcolm
other than gimple assign): gengtype's inheritance-handling requires every type in an inheritance hierarchy to have a tag specified, or it can silently fail to mark instances of such types; as of r205428 it can handle duplicate values for the type tag within one hierarchy, so it's OK for th

[PATCH 03/16] Introduce gimple_bind and use it for accessors.

2013-12-13 Thread David Malcolm
This updates all of the gimple_bind_* accessors in gimple.h from taking a plain gimple to taking a gimple_bind (or const_gimple_bind), with the checking happening at the point of cast. Various other types are strengthened from gimple to gimple_bind, and from plain vec to vec. gcc/ * coret

[PATCH 05/16] Introduce gimple_assign and use it in various places

2013-12-13 Thread David Malcolm
gcc/ * coretypes.h (gimple_assign): New typedef. (const_gimple_assign): New typedef. * gimple.h (struct gimple_statement_assign): New subclass of gimple_statement_with_memory_ops, adding the invariant that stmt->code == GIMPLE_ASSIGN. (gimple_stateme

[PATCH 02/16] Introduce gimple_switch and use it in various places

2013-12-13 Thread David Malcolm
gcc/ * gimple.h (gimple_statement_switch): New subclass of gimple_statement_with_ops, adding the invariant that stmt->code == GIMPLE_SWITCH. (gimple_statement_base::as_a_gimple_switch): New. (gimple_statement_base::dyn_cast_gimple_switch): New. (is_a_

[PATCH 06/16] Introduce gimple_label and use it in a few places

2013-12-13 Thread David Malcolm
gcc/ * coretypes.h (gimple_label): New typedef. (const_gimple_label): New typedef. * gimple.h (struct gimple_statement_label): New subclass of gimple_statement_with_ops, adding the invariant that stmt->code == GIMPLE_LABEL. (gimple_statement_base::as

[PATCH 07/16] Introduce gimple_debug and use it in a few places

2013-12-13 Thread David Malcolm
gcc/ * coretypes.h (gimple_debug): New typedef. (const_gimple_debug): New typedef. * gimple.h (struct gimple_statement_debug): New subclass of gimple_statement_with_ops, adding the invariant that stmt->code == GIMPLE_DEBUG. (gimple_statement_base::as

[PATCH 04/16] Introduce gimple_cond and use it in various places

2013-12-13 Thread David Malcolm
gcc/ * coretypes.h (gimple_cond): New typedef. (const_gimple_cond): Likewise. * gimple.h (struct gimple_statement_cond): New subclass of gimple_statement_with_ops, adding the invariant that stmt->code == GIMPLE_COND. (gimple_statement_base::as_a_gimp

[PATCH 16/16] tree-ssa-loop-ivopts.c: use gimple_phi in a few places

2013-12-13 Thread David Malcolm
gcc/ * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi. (find_bivs): Convert local "phi" into a gimple_phi. (mark_bivs): Likewise. --- gcc/tree-ssa-loop-ivopts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/tree-ssa-loop-iv

[PATCH 10/16] Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi

2013-12-13 Thread David Malcolm
gcc/ * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen type of parameter from gimple to gimple_phi. * tree-complex.c (complex_visit_phi): Update signature of callback implementation accordingly. * tree-ssa-ccp.c (ccp_visit_phi_node): Likewis

[PATCH 11/16] tree-parloops.c: use gimple_phi in various places

2013-12-13 Thread David Malcolm
gcc/ * tree-parloops.c (struct reduction_info): Strengthen field "new_phi" from gimple to gimple_phi. (create_phi_for_local_result): Convert local "new_phi" to gimple_phi. (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple. (gather_scalar_

[PATCH 14/16] tree-ssa-loop-niter.c: use gimple_phi in a few places

2013-12-13 Thread David Malcolm
gcc/ * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi rather than a gimple. (get_base_for): Likewise; convert local "phi" to be a gimple_phi. (loop_niter_by_eval): Convert local "phi" to be a gimple_phi. --- gcc/tree-ssa-loop-niter.c | 11 ++---

[PATCH 13/16] tree-ssa-phiprop.c: use gimple_phi

2013-12-13 Thread David Malcolm
gcc/ * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of parameter "phi" and local "new_phi" from gimple to gimple_phi. --- gcc/tree-ssa-phiprop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c inde

[PATCH 15/16] tree-ssa-loop-manip.c: use gimple_phi in three places

2013-12-13 Thread David Malcolm
gcc/ * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a gimple_phi. (split_loop_exit_edge): Likewise for "phi" and "new_phi". --- gcc/tree-ssa-loop-manip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-loop-manip.c b/g

[PATCH 08/16] Introduce gimple_phi and use it in various places

2013-12-13 Thread David Malcolm
gcc/ * coretypes.h (gimple_phi): New typedef. (const_gimple_phi): New typedef. * gimple.h (gimple_statement_base::as_a_gimple_phi): New. (gimple_statement_base::dyn_cast_gimple_phi): New. * gdbhooks.py (build_pretty_printer): Add gimple_phi and its

[PATCH 12/16] tree-predcom.c: use gimple_phi in various places

2013-12-13 Thread David Malcolm
gcc/ * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather than just a gimple. (insert_looparound_copy): Require a gimple_phi rather than just a gimple. (add_looparound_copies): Convert local "phi" to be a gimple_phi. (initialize_root_var

Re: [PATCH 14/16] tree-ssa-loop-niter.c: use gimple_phi in a few places

2013-12-23 Thread David Malcolm
On Fri, 2013-12-13 at 12:13 -0500, Andrew MacLeod wrote: > On 12/13/2013 10:58 AM, David Malcolm wrote: > > { > > gimple stmt = SSA_NAME_DEF_STMT (x); > > @@ -2162,7 +2162,7 @@ chain_of_csts_start (struct loop *loop, tree x) > > if (gimpl

Re: PATCH trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...

2015-07-15 Thread David Malcolm
On Wed, 2015-07-15 at 20:19 +0200, Basile Starynkevitch wrote: > Hello All and David Malcolm > > The attached patch (relative to trunk r224842) is adding > gcc_jit_context_new_rvalue_from_long_long and similar functions to > GCCJIT. Thanks. [CCing the jit mailing list; pl

Re: PATCH trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...

2015-07-15 Thread David Malcolm
On Wed, 2015-07-15 at 21:15 +0200, Basile Starynkevitch wrote: > On 07/15/2015 20:52, David Malcolm wrote: > > On Wed, 2015-07-15 at 20:19 +0200, Basile Starynkevitch wrote: > >> Hello All and David Malcolm > >> > >> The attached patch (

Re: PATCH trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...

2015-07-15 Thread David Malcolm
On Wed, 2015-07-15 at 21:37 +0200, Basile Starynkevitch wrote: > On 07/15/2015 20:52, David Malcolm wrote: > > On Wed, 2015-07-15 at 20:19 +0200, Basile Starynkevitch wrote: > >> Hello All and David Malcolm > >> > >> The attached patch (

[PATCH, committed] jit: Add guide for submitting patches to jit docs

2015-07-16 Thread David Malcolm
Committed to trunk as r225905. gcc/jit/ChangeLog: * docs/internals/index.rst (Overview of code structure): Add note that the implementation is in C++, despite the .c extension. (Submitting patches): New subsection. * docs/_build/texinfo/libgccjit.texi: Regenerate. -

Re: PATCH (v2) trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...

2015-07-17 Thread David Malcolm
On Thu, 2015-07-16 at 11:00 +0200, Basile Starynkevitch wrote: > On 07/15/2015 21:16, David Malcolm wrote: > > Perhaps, but note that nothing in a regular gcc bootstrap uses > > libgccjit, so you *might* still have a latent linking error that > shows > > up only at run

Re: PATCH (v2) trunk GCCJIT: adding gcc_jit_context_new_rvalue_from_long_long, etc...

2015-07-17 Thread David Malcolm
On Fri, 2015-07-17 at 09:40 -0400, David Malcolm wrote: > On Thu, 2015-07-16 at 11:00 +0200, Basile Starynkevitch wrote: (snip) > > + > > +/* Specialization of making an rvalue from a const, for host > long>. */ > > + > > +template <> > > +rvalu

Re: [patch] Include reduction on libackend.a and language source files

2015-07-23 Thread David Malcolm
On Wed, 2015-07-22 at 20:50 -0400, Andrew MacLeod wrote: (snip) > I then ran it through an ordering tool, (which I will eventually put in > contrib). This tool looks at include files, and puts them in a > "standard" order, and removes duplicates that have already been > included.. even if it

[PATCH, committed] jit: supply MULTILIB_DEFAULTS as arguments when invoking driver

2015-07-23 Thread David Malcolm
32-bit and 64-bit multilib peer builds of libgccjit.so could share a driver binary. When such a libgccjit invokes the driver (e.g. to convert .s to .so) it needs to pass in options to the shared driver to get the appropriate assembler/linker options. The simplest way to do this is for libgccjit t

Re: [PATCH 3/4] Add libgomp plugin for Intel MIC

2015-07-24 Thread David Malcolm
On Fri, 2015-07-24 at 10:01 +0200, Jakub Jelinek wrote: > #!/usr/bin/python > import sys > with open(sys.argv[1],"rb") as f: > nextblock = f.read(12) > while 1: > block = nextblock > nextblock = f.read(12) > if block == "": > break > str = "" >

[PATCH 1/2] gcc parts of timer refactoring

2015-07-31 Thread David Malcolm
In r223092 (aka dd4d567f4b6b498242097c41d63666bdae320ac1) I moved the state of timevar.c from being global data into a "class timer" with a global instance "g_timer". This followup patch generalizes the timing within toplev so that an external "timer" instance can (optionally) be passed in; this i

[PATCH 0/2] Refactoring of timevar API

2015-07-31 Thread David Malcolm
14 passes. Are the non-jit parts OK for trunk? [1] I ran into: a-chlat1.ads:16:08: warning: unrecognized pragma "Compiler_Unit_Warning" on ada, which is apparently unrelated. David Malcolm (2): gcc parts of timer refactoring jit: add timing API gcc/jit/docs/topics/compatibility.r

[PATCH 2/2] jit: add timing API

2015-07-31 Thread David Malcolm
Free Software Foundation, Inc. + Originally contributed by David Malcolm + + This is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your opt

Re: [PATCH 3/4] Add libgomp plugin for Intel MIC

2015-08-04 Thread David Malcolm
mental : > > Applied the idea with python script alternative. Review, please. > > > > 2015-07-24 17:18 GMT+03:00 David Malcolm : > >> On Fri, 2015-07-24 at 10:01 +0200, Jakub Jelinek wrote: > >>> #!/usr/bin/python > >>> import sys > >>>

Re: [PATCH 4/4] define ASM_OUTPUT_LABEL to the name of a function

2015-08-05 Thread David Malcolm
On Wed, 2015-08-05 at 13:47 +0200, Richard Biener wrote: > On Wed, Aug 5, 2015 at 12:57 PM, Trevor Saunders > wrote: > > On Mon, Jul 27, 2015 at 11:06:58AM +0200, Richard Biener wrote: > >> On Sat, Jul 25, 2015 at 4:37 AM, wrote: > >> > From: Trevor Saunders > >> > > >> > * config/arc/

Re: [PATCH 4/4] define ASM_OUTPUT_LABEL to the name of a function

2015-08-05 Thread David Malcolm
On Wed, 2015-08-05 at 11:28 -0400, David Malcolm wrote: > On Wed, 2015-08-05 at 13:47 +0200, Richard Biener wrote: > > On Wed, Aug 5, 2015 at 12:57 PM, Trevor Saunders > > wrote: > > > On Mon, Jul 27, 2015 at 11:06:58AM +0200, Richard Biener wrote: > > >> On S

[PATCH 0/2] Embed driver within libgccjit

2015-08-06 Thread David Malcolm
1) and the jit-specific part (patch 2) for ease of review. Successfully bootstrapped and regression-tested the combination of the two patches on x86_64-pc-linux-gnu. OK for trunk? David Malcolm (2): driver: support state cleanup jit: use an embedded copy of the driver

[PATCH 2/2] jit: use an embedded copy of the driver

2015-08-06 Thread David Malcolm
This patch requires the previous one, and would be committed with it; I've split them up for ease of review. This is an updated version of the second part of: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00123.html with various cleanups; in particular, providing a boolean option to support reve

[PATCH 1/2] driver: support state cleanup

2015-08-06 Thread David Malcolm
This patch implements enough state cleanup with the driver to allow it to be linked within libgccjit.so and repeatedly run in-process. The state cleanup is optional and is only performed by libgccjit. When run within the driver executables, the code does the same as before. This corresponds to th

Re: [PATCH 4/4] define ASM_OUTPUT_LABEL to the name of a function

2015-08-06 Thread David Malcolm
On Wed, 2015-08-05 at 16:22 -0400, Trevor Saunders wrote: > On Wed, Aug 05, 2015 at 11:34:28AM -0400, David Malcolm wrote: > > On Wed, 2015-08-05 at 11:28 -0400, David Malcolm wrote: > > > On Wed, 2015-08-05 at 13:47 +0200, Richard Biener wrote: > > > > On Wed, A

[PATCH, committed] jit.dg/test-benchmark.c: add a summary of timings

2015-08-06 Thread David Malcolm
Committed to trunk as r226697. Backported to gcc-5-branch as r226698. gcc/testsuite/ChangeLog: * jit.dg/test-benchmark.c (main): Record all elapsed times at each optimization level, and print a summary at the end. --- gcc/testsuite/jit.dg/test-benchmark.c | 18 +++---

Re: [PATCH 01/22] Change of location_get_source_line signature

2015-09-15 Thread David Malcolm
On Mon, 2015-09-14 at 13:26 -0600, Jeff Law wrote: > On 09/10/2015 02:28 PM, David Malcolm wrote: > > location_get_source_line takes an expanded_location, but the column > > is irrelevant; it just needs a filename and line number. > > > > This change is used by,

Re: dejagnu version update?

2015-09-15 Thread David Malcolm
On Tue, 2015-09-15 at 10:39 -0700, Mike Stump wrote: > On Sep 14, 2015, at 3:37 PM, Jeff Law wrote: > >> Maybe GCC-6 can bump the required > >> dejagnu version to allow for getting rid of all these superfluous > >> load_gcc_lib? *blink* :) > > I'd support that as a direction. > > > > Certainly dr

Re: dejagnu version update?

2015-09-16 Thread David Malcolm
On Wed, 2015-09-16 at 10:36 -0600, Jeff Law wrote: > On 09/16/2015 10:25 AM, Ramana Radhakrishnan wrote: > > > > > > On 16/09/15 17:14, Mike Stump wrote: > >> On Sep 16, 2015, at 12:29 AM, Andreas Schwab > >> wrote: > >>> Mike Stump writes: > >>> > The software presently works with 1.4.4 and

Re: (patch,rfc) s/gimple/gimple */

2015-09-16 Thread David Malcolm
On Wed, 2015-09-16 at 09:16 -0400, Trevor Saunders wrote: > Hi, > > I gave changing from gimple to gimple * a shot last week. It turned out > to be not too hard. As you might expect the patch is huge so its > attached compressed. > > patch was bootstrapped + regtested on x86_64-linux-gnu, and r

Re: [PATCH 07/22] Implement token range tracking within libcpp and C/C++ FEs

2015-09-16 Thread David Malcolm
On Tue, 2015-09-15 at 12:48 +0200, Jakub Jelinek wrote: > On Tue, Sep 15, 2015 at 12:33:58PM +0200, Richard Biener wrote: > > On Tue, Sep 15, 2015 at 12:20 PM, Jakub Jelinek wrote: > > > On Tue, Sep 15, 2015 at 12:14:22PM +0200, Richard Biener wrote: > > >> > diff --git a/gcc/cp/parser.h b/gcc/cp/

Re: [PATCH 07/22] Implement token range tracking within libcpp and C/C++ FEs

2015-09-17 Thread David Malcolm
On Wed, 2015-09-16 at 16:21 -0400, David Malcolm wrote: > On Tue, 2015-09-15 at 12:48 +0200, Jakub Jelinek wrote: > > On Tue, Sep 15, 2015 at 12:33:58PM +0200, Richard Biener wrote: > > > On Tue, Sep 15, 2015 at 12:20 PM, Jakub Jelinek wrote: > > > > On Tue, Se

Re: [PATCH WIP] Use Levenshtein distance for various misspellings in C frontend v2

2015-09-17 Thread David Malcolm
On Thu, 2015-09-17 at 13:31 -0600, Jeff Law wrote: > On 09/16/2015 02:34 AM, Richard Biener wrote: > > > > Btw, this looks quite expensive - I'm sure we want to limit the effort > > here a bit. > A limiter is reasonable, though as it's been pointed out this only fires > during error processing, so

Re: [PATCH 07/22] Implement token range tracking within libcpp and C/C++ FEs

2015-09-17 Thread David Malcolm
On Thu, 2015-09-17 at 13:14 -0600, Jeff Law wrote: > On 09/17/2015 10:49 AM, David Malcolm wrote: > > > FWIW, I have a (very messy) implementation of this working for the C > > frontend, which gives us source ranges on expressions without needing to > > add any new tree

Re: [PATCH 03/22] Move diagnostic_show_locus and friends out into a new source file

2015-09-18 Thread David Malcolm
On Mon, 2015-09-14 at 13:35 -0600, Jeff Law wrote: > On 09/10/2015 02:28 PM, David Malcolm wrote: > > The function "diagnostic_show_locus" gains new functionality in the > > next patch, so this preliminary patch breaks it out into a new source > > file, diagnostic-sh

[PATCH 0/5] RFC: Overhaul of diagnostics (v2)

2015-09-22 Thread David Malcolm
r227562) Thoughts? Dave [BTW, I'm going to be on vacation and away from email from this Saturday, the 26th through to October 5th] David Malcolm (5): Testsuite: add dg-{begin|end}-multiline-output commands Reimplement diagnostic_show_locus, introducing rich_location classes

[PATCH 1/5] Testsuite: add dg-{begin|end}-multiline-output commands

2015-09-22 Thread David Malcolm
This patch is essentially identical to v1 here: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00729.html The only change is in the ChangeLog, moving the libgo.exp ChangeLog entry into gcc/testsuite/ChangeLog, analogous to where Ian put it when introducing the file in r167407. OK for trunk? Blur

[PATCH 3/5] Implement token range tracking within libcpp and the C FE (v2)

2015-09-22 Thread David Malcolm
This is an updated version of: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00736.html Changes in V2 of the patch: * c_lex_with_flags: don't write through the range ptr if it's NULL * don't add any fields to the C++ frontend's cp_token for now * libcpp/lex.c: prevent usage of stale/uninit

[PATCH 5/5] Add plugin to recursively dump the source-ranges in a tree (v2)

2015-09-22 Thread David Malcolm
This patch adds a test plugin that recurses down an expression tree, printing diagnostics showing the ranges of each node in the tree. It corresponds to: [PATCH 15/22] Add plugin to recursively dump the source-ranges in a tree https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00741.html from v1

[PATCH 4/5] Implement tree expression tracking in C FE (v2)

2015-09-22 Thread David Malcolm
This is a combination of various patches from v1 of the kit, including: 12/22: Add source-ranges for trees 13/22: gcc-rich-location.[ch]: add methods for working with tree ranges 14/22: C: capture tree ranges for various expressions The implementation of how ranges are stored has completely

[PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2)

2015-09-22 Thread David Malcolm
This is v2 of this patch; an earlier version was sent as: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00737.html Thanks for the comments so far. Changes in v2: * Added a big descriptive comment for class rich_location in libcpp/include/line-map.h. * Implemented x-offset support for very long

Re: [PATCH 0/5] RFC: Overhaul of diagnostics (v2)

2015-09-23 Thread David Malcolm
On Wed, 2015-09-23 at 15:36 +0200, Richard Biener wrote: > On Wed, Sep 23, 2015 at 3:19 PM, Michael Matz wrote: > > Hi, > > > > On Tue, 22 Sep 2015, David Malcolm wrote: > > > >> The drawback is that it could bloat the ad-hoc table. Can the ad-hoc > >

Re: [PATCH 3/5] Implement token range tracking within libcpp and the C FE (v2)

2015-09-25 Thread David Malcolm
On Fri, 2015-09-25 at 11:13 +0200, Dodji Seketeli wrote: > Hello, > > David Malcolm a écrit: > > > This is an updated version of: > > https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00736.html > > > > Changes in V2 of the patch: > > * c_lex_with_f

Re: [PATCH 4/5] Implement tree expression tracking in C FE (v2)

2015-09-25 Thread David Malcolm
On Fri, 2015-09-25 at 16:06 +0200, Dodji Seketeli wrote: > Hello, > > Similarly to a comment I made on the previous patch of the series, > > +++ b/libcpp/include/line-map.h > > [...] > > struct GTY(()) location_adhoc_data { >source_location locus; > + source_range src_range; >

[PATCH] v3 of diagnostic_show_locus and rich_location (was Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2))

2015-09-25 Thread David Malcolm
that for warnings before the logic to ignore them. So there may be some extra calls there that aren't present in trunk, for discarded warnings. I don't expect that to affect the speed of the compiler though (I expect it to be lost in the noise). Updated patch attached. It compiles; a boo

Re: [PATCH] v3 of diagnostic_show_locus and rich_location (was Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2))

2015-09-25 Thread David Malcolm
On Fri, 2015-09-25 at 22:39 +0200, Manuel López-Ibáñez wrote: > On 25 September 2015 at 22:18, Manuel López-Ibáñez > wrote: > > On 25 September 2015 at 22:11, David Malcolm wrote: > > >context->last_location = diagnostic_location (diagnostic, 0); &

Re: [PATCH] v3 of diagnostic_show_locus and rich_location (was Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2))

2015-09-25 Thread David Malcolm
On Fri, 2015-09-25 at 23:13 +0200, Manuel López-Ibáñez wrote: > + If SHOW_CARET_P is true, then the range should be rendered with > + a caret at its starting location. This > + is for use by the Fortran frontend, for implementing the > + "%C" and "%L" format codes. */ > + > +void > +rich_

Re: [patch 4/3] Header file reduction - Tools for contrib

2015-10-08 Thread David Malcolm
On Tue, 2015-10-06 at 14:02 +0200, Bernd Schmidt wrote: [...] > > No commenting on the quality of python code... :-) I was > > learning python on the fly.Im sure some things are QUITE awful., [...] > > + def ii_base (iinfo): > > + return iinfo[0] > > + > > + def ii_path (iinfo): > > + ret

[PATCH] v4 of diagnostic_show_locus and rich_location

2015-10-12 Thread David Malcolm
in this kit (which is now in trunk). I don't know if adding such test coverage is necessary for acceptance of this patch though. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? Some other comments inline. > Hello, > > David Malcolm

Benchmarks of v2 (was Re: [PATCH 0/5] RFC: Overhaul of diagnostics (v2))

2015-10-13 Thread David Malcolm
On Thu, 2015-09-24 at 10:15 +0200, Richard Biener wrote: > On Thu, Sep 24, 2015 at 2:25 AM, David Malcolm wrote: > > On Wed, 2015-09-23 at 15:36 +0200, Richard Biener wrote: > >> On Wed, Sep 23, 2015 at 3:19 PM, Michael Matz wrote: > >> > Hi, > >> >

Re: [PATCH] v4 of diagnostic_show_locus and rich_location

2015-10-13 Thread David Malcolm
On Mon, 2015-10-12 at 17:36 +0100, Manuel López-Ibáñez wrote: > On 12 October 2015 at 16:44, David Malcolm wrote: > > v4 of the patch does the conversion of Fortran, and eliminates the > > adaptation layer. No partial transitions here! > > > > Manu: I hope this addres

Re: Benchmarks of v2 (was Re: [PATCH 0/5] RFC: Overhaul of diagnostics (v2))

2015-10-16 Thread David Malcolm
On Wed, 2015-10-14 at 11:00 +0200, Richard Biener wrote: > On Tue, Oct 13, 2015 at 5:32 PM, David Malcolm wrote: > > On Thu, 2015-09-24 at 10:15 +0200, Richard Biener wrote: > >> On Thu, Sep 24, 2015 at 2:25 AM, David Malcolm wrote: > >> > On Wed, 2015-09-23 at 15:

Re: Benchmarks of v2 (was Re: [PATCH 0/5] RFC: Overhaul of diagnostics (v2))

2015-10-22 Thread David Malcolm
On Mon, 2015-10-19 at 16:51 +0200, Michael Matz wrote: > Hi, > > On Fri, 16 Oct 2015, David Malcolm wrote: > > > This fixes much of the bloat seen for influence.i when sending ranges > > through for every token. > > Yeah, I think that's on the right track.

[PATCH 01/10] Improvements to description of source_location in line-map.h

2015-10-23 Thread David Malcolm
libcpp/ChangeLog: * include/line-map.h (source_location): In the table in the descriptive comment, show UNKNOWN_LOCATION, BUILTINS_LOCATION, LINE_MAP_MAX_LOCATION_WITH_COLS, LINE_MAP_MAX_SOURCE_LOCATION. Add notes about ad-hoc values. --- libcpp/include/line-map.h |

[PATCH 00/10] Overhaul of diagnostics (v5)

2015-10-23 Thread David Malcolm
This is a followup to: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01696.html (one of the individual patches has seen iteration since that, so I'm calling the whole thing "v5" for the sake of clarity). Patches 1-3 are a preamble: "Improvements to description of source_location in line-map.h

[PATCH 02/10] Add stats on adhoc table to dump_line_table_statistics

2015-10-23 Thread David Malcolm
The stats on line-table memory usage emitted via -fmem-report from input.c's dump_line_table_statistics don't include information on the ad-hoc data table. This patch adds lines like this: Ad-hoc table size: 192k Ad-hoc table entries used:4336 OK for trunk? gcc/

[PATCH 03/10] libstdc++v3: Explicitly disable carets and colorization within testsuite

2015-10-23 Thread David Malcolm
Later on in this patch kit, with token range underlining, the libstdc++v3 testsuite starts showing numerous failures of the form: FAIL: 17_intro/using_namespace_std_tr1_neg.cc (test for excess errors) The excess errors turn out to be the source code and caret/underlines emitted after an "error"

[PATCH 05/10] Add ranges to libcpp tokens (via ad-hoc data, unoptimized)

2015-10-23 Thread David Malcolm
This patch: - generalizes the meaning of the source_location (aka location_t) type from being a caret within the source code to being a caret plus a source_range. The latter data is stored purely in the ad-hoc data lookaside for now. - captures ranges for libcpp tokens by generat

[PATCH 07/10] Add plugin to recursively dump the source-ranges in a tree (v2)

2015-10-23 Thread David Malcolm
This patch adds a test plugin that recurses down an expression tree, printing diagnostics showing the ranges of each node in the tree. It corresponds to: [PATCH 15/22] Add plugin to recursively dump the source-ranges in a tree https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00741.html from v1

[PATCH 09/10] Delay some resolution of ad-hoc locations, preserving ranges

2015-10-23 Thread David Malcolm
Some diagnostics e.g. -Wmaybe-uninitialized weren't showing underlines, despite being provided with range-based data. Debugging showed that it the pertinent location was an ad-hoc location with a range: (gdb) p /x loc $9 = 0x802a (gdb) p line_table->location_adhoc_data_map.data[0x2a]

[PATCH 10/10] Compress short ranges into source_location

2015-10-23 Thread David Malcolm
The attached patch implements a bit-packing scheme so that short ranges can be stored directly within a 32-bit source_location (aka location_t) without needing to use the ad-hoc table. The intent is to mitigate the overhead introduced in the earlier patch that added ranges for all tokens in libcpp

[PATCH 08/10] Wire things up so that libcpp users get token underlines

2015-10-23 Thread David Malcolm
A previous patch introduced the ability to print one or more ranges for a diagnostic via a rich_location class. Another patch generalized source_location (aka location_t) to be both a caret and a range, and generated range information for all tokens coming out of libcpp's lexer. The attached patc

[PATCH 06/10] Track expression ranges in C frontend

2015-10-23 Thread David Malcolm
As in the previous version of this patch "Implement tree expression tracking in C FE (v2)" the patch now captures ranges for all C expressions during parsing within a new field of c_expr, and for all tree nodes with a location_t, it stores them in ad-hoc locations for later use. Hence compound ex

[PATCH 04/10] Reimplement diagnostic_show_locus, introducing rich_location classes (v5)

2015-10-23 Thread David Malcolm
The change since v4 can be seen at: https://dmalcolm.fedorapeople.org/gcc/2015-10-23/0001-Add-colorize_source_p-to-diagnostic_context.patch which is a tweak to colorization, to handle both frontends that provide ranges and those that only provide carets, and provide a smoother transition path for

Re: [PATCH 00/10] Overhaul of diagnostics (v5)

2015-10-23 Thread David Malcolm
On Fri, 2015-10-23 at 15:13 -0600, Jeff Law wrote: > On 10/23/2015 02:41 PM, David Malcolm wrote: > > This is a followup to: > >https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01696.html > > (one of the individual patches has seen iteration since that, so > > I'm

[PATCH 03/16] Add test-bitmap.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-bitmap.c: New file. --- gcc/testsuite/unittests/test-bitmap.c | 116 ++ 1 file changed, 116 insertions(+) create mode 100644 gcc/testsuite/unittests/test-bitmap.c diff --git a/gcc/testsuite/unittests/test-bitmap.c

[PATCH 01/16] Add unittest infrastructure

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * g++.dg/plugin/plugin.exp (plugin_test_list): Add the unittests plugin. * g++.dg/plugin/unittests.C: New file. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add the unittests plugin. * gcc.dg/plugin/unittests.c: New file.

[PATCH 05/16] Add test-et-forest.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-et-forest.c: New file. --- gcc/testsuite/unittests/test-et-forest.c | 121 +++ 1 file changed, 121 insertions(+) create mode 100644 gcc/testsuite/unittests/test-et-forest.c diff --git a/gcc/testsuite/unittests/test-et-

[PATCH 00/16] Unit tests framework (v3)

2015-10-27 Thread David Malcolm
n the testcases indicating room for further testing, and I've not fully reduced the #includes in them; is the "blessed" #include order documented yet, and do we have tooling in "contrib" for this yet?] With those caveats, OK for trunk? David Malcolm (16): Add unittest infrastruc

[PATCH 11/16] Add test-hash-set.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-hash-set.c: New file. --- gcc/testsuite/unittests/test-hash-set.c | 53 + 1 file changed, 53 insertions(+) create mode 100644 gcc/testsuite/unittests/test-hash-set.c diff --git a/gcc/testsuite/unittests/test-hash-s

[PATCH 07/16] Add test-functions.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-functions.c: New file. --- gcc/testsuite/unittests/test-functions.c | 645 +++ 1 file changed, 645 insertions(+) create mode 100644 gcc/testsuite/unittests/test-functions.c diff --git a/gcc/testsuite/unittests/test-fun

[PATCH 10/16] Add test-hash-map.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-hash-map.c: New file. --- gcc/testsuite/unittests/test-hash-map.c | 77 + 1 file changed, 77 insertions(+) create mode 100644 gcc/testsuite/unittests/test-hash-map.c diff --git a/gcc/testsuite/unittests/test-hash-m

[PATCH 15/16] Add test-vec.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-vec.c: New file. --- gcc/testsuite/unittests/test-vec.c | 161 + 1 file changed, 161 insertions(+) create mode 100644 gcc/testsuite/unittests/test-vec.c diff --git a/gcc/testsuite/unittests/test-vec.c b/gcc/te

[PATCH 04/16] Add test-cfg.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-cfg.c: New file. --- gcc/testsuite/unittests/test-cfg.c | 319 + 1 file changed, 319 insertions(+) create mode 100644 gcc/testsuite/unittests/test-cfg.c diff --git a/gcc/testsuite/unittests/test-cfg.c b/gcc/te

[PATCH 06/16] Add test-folding.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-folding.c: New file. --- gcc/testsuite/unittests/test-folding.c | 120 + 1 file changed, 120 insertions(+) create mode 100644 gcc/testsuite/unittests/test-folding.c diff --git a/gcc/testsuite/unittests/test-folding

[PATCH 14/16] Add test-tree.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-tree.c: New file. --- gcc/testsuite/unittests/test-tree.c | 101 1 file changed, 101 insertions(+) create mode 100644 gcc/testsuite/unittests/test-tree.c diff --git a/gcc/testsuite/unittests/test-tree.c b/gcc

[PATCH 12/16] Add test-locations.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-locations.c: New file. --- gcc/testsuite/unittests/test-locations.c | 145 +++ 1 file changed, 145 insertions(+) create mode 100644 gcc/testsuite/unittests/test-locations.c diff --git a/gcc/testsuite/unittests/test-loc

[PATCH 13/16] Add test-rtl.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-rtl.c: New file. --- gcc/testsuite/unittests/test-rtl.c | 94 ++ 1 file changed, 94 insertions(+) create mode 100644 gcc/testsuite/unittests/test-rtl.c diff --git a/gcc/testsuite/unittests/test-rtl.c b/gcc/tes

[PATCH 16/16] Add test-wide-int.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-wide-int.c: New file. --- gcc/testsuite/unittests/test-wide-int.c | 185 1 file changed, 185 insertions(+) create mode 100644 gcc/testsuite/unittests/test-wide-int.c diff --git a/gcc/testsuite/unittests/test-wide-

[PATCH 09/16] Add test-gimple.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-gimple.c: New file. --- gcc/testsuite/unittests/test-gimple.c | 178 ++ 1 file changed, 178 insertions(+) create mode 100644 gcc/testsuite/unittests/test-gimple.c diff --git a/gcc/testsuite/unittests/test-gimple.c

Re: [PATCH 00/16] Unit tests framework (v3)

2015-10-27 Thread David Malcolm
On Tue, 2015-10-27 at 15:48 -0400, David Malcolm wrote: [...snip...] Looks like [Patch 02/16] was too big (1.2MB) for the list; it can be seen here: https://dmalcolm.fedorapeople.org/gcc/2015-10-27/unittests/0002-Add-embedded-copy-of-gtest-1.7-to-unittests.patch [..snip...]

[PATCH 08/16] Add test-ggc.c to unittests

2015-10-27 Thread David Malcolm
gcc/testsuite/ChangeLog: * unittests/test-ggc.c: New file. --- gcc/testsuite/unittests/test-ggc.c | 299 + 1 file changed, 299 insertions(+) create mode 100644 gcc/testsuite/unittests/test-ggc.c diff --git a/gcc/testsuite/unittests/test-ggc.c b/gcc/te

Re: [PATCH 04/10] Reimplement diagnostic_show_locus, introducing rich_location classes (v5)

2015-10-28 Thread David Malcolm
On Tue, 2015-10-27 at 17:02 -0600, Jeff Law wrote: > On 10/23/2015 02:41 PM, David Malcolm wrote: > > The change since v4 can be seen at: > > > > https://dmalcolm.fedorapeople.org/gcc/2015-10-23/0001-Add-colorize_source_p-to-diagnostic_context.patch > > which is

[PATCH 4a] diagnostic-show-locus.c changes: Deletions

2015-10-28 Thread David Malcolm
gcc/ChangeLog: * diagnostic-show-locus.c (adjust_line): Delete. (diagnostic_print_caret_line): Delete. --- gcc/diagnostic-show-locus.c | 102 1 file changed, 102 deletions(-) diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-sho

[PATCH 4b] diagnostic-show-locus.c changes: Insertions

2015-10-28 Thread David Malcolm
gcc/ChangeLog: * diagnostic-show-locus.c (struct point_state): New struct. (class colorizer): New class. (class layout_point): New class. (class layout_range): New class. (class layout): New class. (colorizer::colorizer): New ctor. (colorizer:

[PATCH 4c] Other changes: everything apart from diagnostic-show-locus.c changes

2015-10-28 Thread David Malcolm
Reimplement diagnostic_show_locus, introducing rich_location classes. gcc/ChangeLog: * diagnostic-color.c (color_dict): Eliminate "caret"; add "range1" and "range2". (parse_gcc_colors): Update comment to describe default GCC_COLORS. * diagnostic-core.h (warning_at_r

Re: [PATCH 00/16] Unit tests framework (v3)

2015-10-29 Thread David Malcolm
On Wed, 2015-10-28 at 12:38 +0100, Bernd Schmidt wrote: > On 10/27/2015 08:48 PM, David Malcolm wrote: > > The following patch kit adds a unit tests framework for gcc, > > as a new subdirectory below gcc/testsuite. > > So, as a general comment I think this would be a very

<    5   6   7   8   9   10   11   12   13   14   >