Re: [PATCH] Add selftest for vec::reverse

2017-12-29 Thread David Malcolm
On Fri, 2017-12-29 at 15:39 +0100, Martin Liška wrote: > On 10/06/2017 06:20 PM, David Malcolm wrote: > > Martin: I noticed that your switch expansion patch added a > > vec::reverse () > > method. Here's a proposed selftest for it, mostly to verify > > that it ha

[committed] Fix warning in gcc.dg/plugin/expensive_selftests_plugin.c with !CHECKING_P

2018-01-03 Thread David Malcolm
On Tue, 2018-01-02 at 21:25 +0100, Andreas Schwab wrote: > /daten/gcc/gcc- > 20180101/gcc/testsuite/gcc.dg/plugin/expensive_selftests_plugin.c:175 > :1: warning: no return statement in function returning non-void [- > Wreturn-type] > > Andreas. Thanks. I forgot to handle the --enable-checking=

[PATCH] lto, testsuite: Fix ICE in -Wodr (PR lto/83121)

2018-01-04 Thread David Malcolm
PR lto/83121 reports an ICE deep inside the linemap code when -Wodr reports on a type mismatch. The root cause is that the warning can access the DECL_SOURCE_LOCATION of a streamed-in decl before the lto_location_cache has been applied. lto_location_cache::input_location stores RESERVED_LOCATION_

PING Re: [v3 of PATCH 13/14] c-format.c: handle location wrappers

2018-01-05 Thread David Malcolm
Fri, 2017-12-22 at 14:10 -0500, David Malcolm wrote: > On Thu, 2017-12-21 at 00:00 -0500, Jason Merrill wrote: > > On Wed, Dec 20, 2017 at 12:33 PM, David Malcolm > m> > > wrote: > > > On Tue, 2017-12-19 at 14:55 -0500, Jason Merrill wrote: > > > > On 12

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-05 Thread David Malcolm
On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > On 12/29/2017 12:06 PM, David Malcolm wrote: > > One issue I ran into was that fold_for_warn doesn't eliminate > > location wrappers when processing_template_decl, leading to > > failures of the template-base

Re: [PATCH] lto, testsuite: Fix ICE in -Wodr (PR lto/83121)

2018-01-05 Thread David Malcolm
On Fri, 2018-01-05 at 10:36 +0100, Richard Biener wrote: > On Thu, Jan 4, 2018 at 10:52 PM, David Malcolm > wrote: > > PR lto/83121 reports an ICE deep inside the linemap code when -Wodr > > reports on a type mismatch. > > > > The root cause is t

Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread David Malcolm
On Fri, 2018-01-05 at 17:20 -0500, David Malcolm wrote: > On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > > On 12/29/2017 12:06 PM, David Malcolm wrote: > > > One issue I ran into was that fold_for_warn doesn't eliminate > > > location wrappers when proc

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread David Malcolm
On Mon, 2018-01-08 at 12:25 -0500, Nathan Sidwell wrote: > On 01/08/2018 12:14 PM, Jakub Jelinek wrote: > > On Mon, Jan 08, 2018 at 12:10:50PM -0500, Nathan Sidwell wrote: > > > > Both "_S_terminal" VAR_DECLs have a "_CharT" > > > > TEMPLATE_TYPE_PARM, but > > > > these types are different tree nod

Re: [PATCH] lto, testsuite: Fix ICE in -Wodr (PR lto/83121)

2018-01-08 Thread David Malcolm
On Sat, 2018-01-06 at 08:44 +0100, Richard Biener wrote: > On January 5, 2018 11:55:11 PM GMT+01:00, David Malcolm hat.com> wrote: > > On Fri, 2018-01-05 at 10:36 +0100, Richard Biener wrote: > > > On Thu, Jan 4, 2018 at 10:52 PM, David Malcolm > > om> > > &

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-08 Thread David Malcolm
On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > On 12/29/2017 12:06 PM, David Malcolm wrote: > > One issue I ran into was that fold_for_warn doesn't eliminate > > location wrappers when processing_template_decl, leading to > > failures of the template-base

[PATCH v2.4 of 02/14] Support for adding and stripping location_t wrapper nodes

2018-01-09 Thread David Malcolm
On Mon, 2018-01-08 at 19:08 +0100, Jakub Jelinek wrote: > On Mon, Jan 08, 2018 at 01:02:37PM -0500, David Malcolm wrote: > > Thanks Nathan and Jakub: a quick smoketest using TREE_LANG_FLAG_0 > > worked, and fixes this issue. > > > > However, should I be using a TREE_LAN

Re: [PATCH GCC][6/6]Restrict predcom using register pressure information

2018-05-29 Thread David Malcolm
On Tue, 2018-05-29 at 17:04 +0100, Bin.Cheng wrote: > On Fri, May 4, 2018 at 5:24 PM, Bin Cheng wrote: > > Hi, > > This patch restricts predcom pass using register pressure > > information. > > In case of high register pressure, we now prune additional chains > > as well > > as disable unrolling i

[PATCH 00/10] RFC: Prototype of compiler-assisted performance analysis

2018-05-29 Thread David Malcolm
formation??? (which would mean storing them in memory before flushing them) * Should the JSON format interact with the other uses of dumpfiles? (both free-form messages, and capturing the IR) This would allow a viewer e.g. to follow a specific function, showing each state of it as it goes th

[PATCH 01/10] Convert dump and optgroup flags to enums

2018-05-29 Thread David Malcolm
The dump machinery uses "int" in a few places, for two different sets of bitmasks. This patch makes things more self-documenting and type-safe by using a new pair of enums: one for the dump_flags_t and another for the optgroup_flags. This requires adding some overloaded bit operations to the enum

[PATCH 06/10] Experiments with using optinfo for inlining

2018-05-29 Thread David Malcolm
gcc/ChangeLog: * ipa-inline.c: Include "optinfo.h". (report_inline_failed_reason): Use OPTINFO_FAILURE. (flatten_function): Use OPTINFO_SUCCESS. (early_inline_small_functions): Likewise. * tree-inline.c: Include "optinfo.h". (expand_call_inline): Use

[PATCH 02/10] Add JSON implementation

2018-05-29 Thread David Malcolm
This patch is the JSON patch I posted last year; it adds support to gcc for reading and writing JSON, based on DOM-like trees of json::value instances. This is overkill for what's needed by the rest of the patch kit (which just needs to be able to write JSON), but this code already existed, so I'm

[PATCH 09/10] Experiment with using optinfo in gimple-loop-interchange.cc

2018-05-29 Thread David Malcolm
This was an experiment to try to capture information on a loop optimization. gcc/ChangeLog: * gimple-loop-interchange.cc (should_interchange_loops): Add optinfo note when interchange gives better data locality behavior. (tree_loop_interchange::interchange): Add OPTINFO_SCOP

[PATCH 04/10] Use indentation to show nesting for -fopt-info

2018-05-29 Thread David Malcolm
This converts e.g. from: test.c:8:3: note: === analyzing loop === test.c:8:3: note: === analyze_loop_nest === test.c:8:3: note: === vect_analyze_loop_form === test.c:8:3: note: === get_loop_niters === test.c:8:3: note: symbolic number of iterations is (unsigned int) n_9(D) test.c:8:3: note: not ve

[PATCH 07/10] Experiment with using optinfo for loop-handling

2018-05-29 Thread David Malcolm
gcc/ChangeLog: * tree-ssa-loop-ivcanon.c: Include "optinfo.h". (try_unroll_loop_completely): Port to optinfo. (canonicalize_loop_induction_variables): Use OPTINFO_NOTE. * tree-ssa-loop-niter.c: Include "optinfo.h". (number_of_iterations_exit): Port to OPTINFO

[PATCH 08/10] Experiment with using optinfo for devirtualization

2018-05-29 Thread David Malcolm
gcc/ChangeLog: * gimple-fold.c: Include "optinfo.h". (fold_gimple_assign): Port to optinfo. (gimple_fold_call): Likewise. * ipa-devirt.c: Include "optinfo.h". (ipa_devirt): Port to optinfo. * ipa.c: Include "optinfo.h". (walk_polymorphic_call_

[PATCH 10/10] Experiment with optinfo in tree-ssa-loop-im.c

2018-05-29 Thread David Malcolm
--- gcc/tree-ssa-loop-im.c | 13 + 1 file changed, 13 insertions(+) diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 030aac0..fcf5d24 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see

[PATCH 03/10] Add optinfo, remarks and optimization records

2018-05-29 Thread David Malcolm
; diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 819a962..abd363c 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -105,6 +105,7 @@ function switch_flags (flags) test_flag("Undocumented", flags, " | CL_UNDOCUMENTED") \ test_fl

Re: [PATCH 02/10] Add JSON implementation

2018-05-30 Thread David Malcolm
On Wed, 2018-05-30 at 13:25 -0400, Eric Gallager wrote: > On 5/29/18, David Malcolm wrote: > > This patch is the JSON patch I posted last year; > > it adds support to gcc for reading and writing JSON, > > based on DOM-like trees of json::value instances. > > >

Re: [PATCH 09/10] Experiment with using optinfo in gimple-loop-interchange.cc

2018-06-01 Thread David Malcolm
On Fri, 2018-06-01 at 11:50 +0200, Richard Biener wrote: > On Tue, May 29, 2018 at 10:33 PM David Malcolm > wrote: > > > > This was an experiment to try to capture information on a > > loop optimization. > > > > gcc/ChangeLog: > > * gimple-loo

Re: [PATCH 09/10] Experiment with using optinfo in gimple-loop-interchange.cc

2018-06-01 Thread David Malcolm
On Fri, 2018-06-01 at 17:31 +0200, Richard Biener wrote: > On June 1, 2018 3:40:15 PM GMT+02:00, David Malcolm com> wrote: > > On Fri, 2018-06-01 at 11:50 +0200, Richard Biener wrote: > > > On Tue, May 29, 2018 at 10:33 PM David Malcolm > > om> > > &

[PATCH] wwwdocs: port from MetaHTML to a Python 3 script

2018-06-04 Thread David Malcolm
; > Alternatively, what do you think of the idea to have a script (or > > makefile) to post-process changes to these pages on the client > > side, > > before checking them in? I.e., adding the example annotation David > > Malcolm prefers (black background) and also validating

Sharing gdb's enum-flags.h with gcc? (was Re: [PATCH 01/10] Convert dump and optgroup flags to enums)

2018-06-05 Thread David Malcolm
On Tue, 2018-06-05 at 04:40 -0400, Trevor Saunders wrote: > On Fri, Jun 01, 2018 at 12:00:09PM +0200, Richard Biener wrote: > > On Tue, May 29, 2018 at 10:32 PM David Malcolm > > wrote: > > > > > > The dump machinery uses "int" in a few place

[PATCH (for gdb)] enum-flags.h: Add trailing semicolon to example in comment

2018-06-05 Thread David Malcolm
On Tue, 2018-06-05 at 17:13 +0100, Pedro Alves wrote: > On 06/05/2018 03:49 PM, David Malcolm wrote: > > On Tue, 2018-06-05 at 04:40 -0400, Trevor Saunders wrote: > > > You may want to look at gdb's enum-flags.h which I think already > > > implements what your d

Re: [PATCH (for gdb)] enum-flags.h: Add trailing semicolon to example in comment

2018-06-06 Thread David Malcolm
On Tue, 2018-06-05 at 18:31 +0100, Pedro Alves wrote: > [adding gdb-patches] > > On 06/05/2018 06:56 PM, David Malcolm wrote: > > On Tue, 2018-06-05 at 17:13 +0100, Pedro Alves wrote: > > > On 06/05/2018 03:49 PM, David Malcolm wrote: > > > > On Tue, 2018-0

[committed] ix86_expand_call: convert return type to rtx_insn *

2018-06-06 Thread David Malcolm
Eliminate an "as_a ()" cast. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. I'm treating this as pre-approved, under the pre-approval on rtx -> rtx_insn * cleanups here: https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01310.html Committed to trunk as r261233. gcc/ChangeLog:

[committed] v2: Convert dump and optgroup flags to enums

2018-06-08 Thread David Malcolm
On Tue, 2018-06-05 at 18:16 +0200, Richard Biener wrote: > On June 5, 2018 4:49:21 PM GMT+02:00, David Malcolm com> wrote: > > On Tue, 2018-06-05 at 04:40 -0400, Trevor Saunders wrote: > > > On Fri, Jun 01, 2018 at 12:00:09PM +0200, Richard Biener wrote: > > > >

Re: [PATCH] Avoid excessive function type casts with splay-trees part 2

2018-06-08 Thread David Malcolm
On Fri, 2018-06-08 at 14:03 +, Bernd Edlinger wrote: > Hi! > > > This patch converts the splay-tree internals into a template, and > makes > the typed_splay_tree template really type-safe. Previously > everything > would break apart if KEY_TYPE or VALUE_TYPE would not be pointer > types. > T

Re: [PATCH] Avoid excessive function type casts with splay-trees part 2

2018-06-11 Thread David Malcolm
On Fri, 2018-06-08 at 20:41 +, Bernd Edlinger wrote: > On 06/08/18 16:28, David Malcolm wrote: > > On Fri, 2018-06-08 at 14:03 +, Bernd Edlinger wrote: > > > Hi! > > > > > > > > > This patch converts the splay-tree internals into a templat

[PATCH 0/5] More rtx->rtx_insn * cleanups

2018-06-12 Thread David Malcolm
198 configurations in contrib/config-list.mk. OK for trunk? David Malcolm (5): emit-rtl.c: more typesafety arc: update for emit-rtl.h change bfin: update for emit-rtl.h changes c6x: update for emit-rtl.h changes sh: update for emit-rtl.h changes gcc/config/arc/arc.c | 4 +-- gc

[PATCH 2/5] arc: update for emit-rtl.h change

2018-06-12 Thread David Malcolm
gcc/ChangeLog: * config/arc/arc.c (hwloop_optimize): Strengthen local "end_label" from rtx to rtx_insn *. --- gcc/config/arc/arc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 2bedc9a..987abfd 100644 --- a

[PATCH 3/5] bfin: update for emit-rtl.h changes

2018-06-12 Thread David Malcolm
gcc/ChangeLog: * config/bfin/bfin.c (hwloop_optimize): Strengthen local "label" from rtx to rtx_insn *. (add_sched_insns_for_speculation): Likewise local for "target", converting usage of JUMP_LABEL to JUMP_LABEL_AS_INSN. --- gcc/config/bfin/bfin.c | 4 ++-- 1 file

[PATCH 1/5] emit-rtl.c: more typesafety

2018-06-12 Thread David Malcolm
This patch converts various rtx to rtx_insn * (or rtx_code_label *). It also convert the various "_loc" params from int to location_t gcc/ChangeLog: * emit-rtl.c (next_real_insn): Strengthen param from "rtx" to "rtx_insn *". (add_insn_after): Likewise for first two params.

[PATCH 4/5] c6x: update for emit-rtl.h changes

2018-06-12 Thread David Malcolm
gcc/ChangeLog: * config/c6x/c6x.c (reorg_split_calls): Strengthen param "call_labels" from rtx_insn ** to rtx_code_label **. (reorg_emit_nops): Likewise. (c6x_reorg): Likewise for local "call_labels". --- gcc/config/c6x/c6x.c | 6 +++--- 1 file changed, 3 insertions

[PATCH 5/5] sh: update for emit-rtl.h changes

2018-06-12 Thread David Malcolm
gcc/ChangeLog: * config/sh/sh-protos.h (get_dest_uid): Strengthen 1st param from rtx to rtx_insn *. * config/sh/sh.c (dump_table): Strengthen local "lab" from rtx to rtx_code_label *, adding safe_as_a casts to the loops over LABEL_REFS. (fixup_addr_d

Re: [PATCH 1/5] emit-rtl.c: more typesafety

2018-06-12 Thread David Malcolm
On Tue, 2018-06-12 at 14:50 -0600, Jeff Law wrote: > On 06/12/2018 12:54 PM, David Malcolm wrote: > > This patch converts various rtx to rtx_insn * (or rtx_code_label > > *). > > It also convert the various "_loc" params from int to location_t > > &g

Re: [PATCH 1/5] emit-rtl.c: more typesafety

2018-06-13 Thread David Malcolm
On Tue, 2018-06-12 at 15:23 -0600, Jeff Law wrote: > On 06/12/2018 03:16 PM, David Malcolm wrote: > > On Tue, 2018-06-12 at 14:50 -0600, Jeff Law wrote: > > > > Ultimately these boil down to: > > > > gcc_checking_assert (INSN_P (rt) >

[PATCH] More rtx to rtx_insn * cleanups

2018-06-14 Thread David Malcolm
These are mostly pre-approved, but there are some slightly non-trivial cases in frv.c and mips.c. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Successfully built "cc1" binaries on all 197 configurations in contrib/config-list.mk. OK for trunk? gcc/ChangeLog: * config/f

[PATCH 1/8] Add GCC_LIKELY and GCC_UNLIKELY

2018-06-14 Thread David Malcolm
The idea is to later use these macros to mark the if (dump_enabled_p ()) parts of the compiler as cold, in the hope of helping non-PGO builds of gcc. I haven't measured it yet, though. gcc/ChangeLog: * system.h (GCC_LIKELY, GCC_UNLIKELY): New macros, adapted from libgfortran.h.

[PATCH 0/8] v2 of optimization records patch kit

2018-06-14 Thread David Malcolm
On Mon, 2018-06-04 at 15:20 +0200, Richard Biener wrote: > On Sat, Jun 2, 2018 at 12:22 AM David Malcolm > wrote: > > > > On Fri, 2018-06-01 at 17:31 +0200, Richard Biener wrote: > > > On June 1, 2018 3:40:15 PM GMT+02:00, David Malcolm > > hat. > > >

[PATCH 2/8] Introduce VECT_SCOPE macro

2018-06-14 Thread David Malcolm
The vectorizer code has numerous instances of: if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "=== some message ===\n"); In each case, the dump_printf_loc is a MSG_NODE at vect_location. In almost all cases the message is of the form "=== foo ===\n"

[PATCH 5/8] gimple-loop-interchange.cc: use the dump API in a few places

2018-06-14 Thread David Malcolm
Doing so makes this information appear in -fopt-info, remarks, and optimization records, rather than just in the dump_file. gcc/ChangeLog: * gimple-loop-interchange.cc (tree_loop_interchange::interchange): Convert fprintf calls to dump_printf calls. (prepare_perfect_loop_ne

[PATCH 4/8] tree-vect-loop.c: use MSG_OPTIMIZED_LOCATIONS in a few places

2018-06-14 Thread David Malcolm
I noticed when reviewing an HTML report generated from optimization records generated in turn from the existing API calls that we sometimes use MSG_NOTE when MSG_OPTIMIZED_LOCATIONS would be more appropriate (to denote a successful optimization). gcc/ChangeLog: * tree-vect-loop.c (vect_tra

[PATCH 7/8] tree-ssa-loop-im.c port from fprintf to the dump API

2018-06-14 Thread David Malcolm
More porting from fprintf to using the dump API, so that the messages appear in -fopt-info etc. Note how these messages aren't consolidated into one optimization record by the v2 patch kit. gcc/ChangeLog: * tree-ssa-loop-im.c (move_computations_worker): Port from fprintf to the du

[PATCH 6/8] ipa-inline.c/tree-inline.c: port from fprintf to dump API

2018-06-14 Thread David Malcolm
This patch ports from fprintf to using the dump API in a few places Doing so makes this information appear in -fopt-info, remarks, and optimization records, rather than just in the dump_file. In early_inline_small_functions I experimented with two approaches: simply porting from fprintf to dump_p

[PATCH 3/8] v2 of optinfo, remarks and optimization records

2018-06-14 Thread David Malcolm
Changed in v2: * The patch now reuses the existing dump API (the "dump_*" functions in dumpfile.h), rather than inventing its own. * I've eliminated the streaming "operator<<" API; instead the optimization records and remarks are constructed from "dump_*" calls. * This patch gets rid of the

Re: [PATCH 1/8] Add GCC_LIKELY and GCC_UNLIKELY

2018-06-15 Thread David Malcolm
On Fri, 2018-06-15 at 10:36 -0600, Jeff Law wrote: > On 06/15/2018 10:35 AM, Jakub Jelinek wrote: > > On Fri, Jun 15, 2018 at 10:31:26AM -0600, Jeff Law wrote: > > > On 06/14/2018 02:32 PM, David Malcolm wrote: > > > > The idea is to later use these macros to mark th

Re: [PATCH 2/8] Introduce VECT_SCOPE macro

2018-06-18 Thread David Malcolm
On Fri, 2018-06-15 at 14:11 -0600, Jeff Law wrote: > On 06/14/2018 02:32 PM, David Malcolm wrote: > > The vectorizer code has numerous instances of: > > > > if (dump_enabled_p ()) > > dump_printf_loc (MSG_NOTE, vect_location, > > "

Re: [PATCH 1/3] Introduce auto_string_vec class.

2018-06-20 Thread David Malcolm
On Mon, 2018-05-14 at 14:50 +0200, Martin Liška wrote: > First part with introduction of auto_string_vec class. > FWIW, I'm fine with the changes to the jit subdir, but I don't think I have approval rights on the vec.h changes. BTW, was the move of vec_alloc in vec.h intentional? (I take it tha

Re: [PATCH 2/3] Refactoring to opt-suggestions.[ch].

2018-06-20 Thread David Malcolm
On Mon, 2018-05-14 at 14:51 +0200, Martin Liška wrote: > Second part refactors function from gcc.c into a new class > option_proposer. > > Martin [...snip...] diff --git a/gcc/c-family/cppspec.c b/gcc/c-family/cppspec.c index 1e0a8bcd294..66540239f53 100644 --- a/gcc/c-family/cppspec.c +++ b/gcc

Re: [PATCH 3/3] Come up with new --completion option.

2018-06-20 Thread David Malcolm
On Mon, 2018-05-14 at 14:51 +0200, Martin Liška wrote: > Main part where I still need to write ChangeLog file and > gcc.sh needs to be moved to bash-completions project. > > Martin As before, I'm not an official reviewer for it, but it touches code that I wrote, so here goes. Overall looks good

[PATCH] Fix IPA crash in libgccjit

2018-06-20 Thread David Malcolm
All/most of the jit.dg testcases are segfaulting on cleanup of the 2nd in-process iteration: PATH=.:$PATH LD_LIBRARY_PATH=. LIBRARY_PATH=. \ gdb --args \ testsuite/jit/test-factorial.c.exe Starting program: /home/david/coding-3/gcc-git-static-analysis/build/gcc/testsuite/jit/test-factorial.c

Re: [PATCH 3/3] Come up with new --completion option.

2018-06-22 Thread David Malcolm
On Fri, 2018-06-22 at 13:25 +0200, Martin Liška wrote: > On 06/20/2018 05:27 PM, David Malcolm wrote: > > On Mon, 2018-05-14 at 14:51 +0200, Martin Liška wrote: [...snip...] > > Thanks for working on this; the rest looks good to me (though as I > > said, I'm not offi

[PATCH] [RFC] Higher-level reporting of vectorization problems

2018-06-22 Thread David Malcolm
optinfo-emit-json.o \ + opt-problem.o \ optabs.o \ optabs-libfuncs.o \ optabs-query.o \ diff --git a/gcc/opt-problem.cc b/gcc/opt-problem.cc new file mode 100644 index 000..78d5200 --- /dev/null +++ b/gcc/opt-problem.cc @@ -0,0 +1,49 @@ +/* Rich information o

[PATCH] Fix bootstrap failure in vect_analyze_loop

2018-06-25 Thread David Malcolm
I ran into this bootstrap failure (with r262092): ../../../src/gcc/tree-vect-loop.c: In function ‘_loop_vec_info* vect_analyze_loop(loop*, loop_vec_info, vec_info_shared*)’: ../../../src/gcc/tree-vect-loop.c:1946:25: error: ‘n_stmts’ may be used uninitialized in this function [-Werror=maybe-unin

[committed] Introduce dump_location_t

2018-06-26 Thread David Malcolm
On Mon, 2018-06-25 at 15:34 +0200, Richard Biener wrote: > On Wed, Jun 20, 2018 at 6:34 PM David Malcolm > wrote: > > > > Here's v3 of the patch (one big patch this time, rather than a > > kit). > > > > Like the v2 patch kit, this patch reuses the exi

[PATCH] -fopt-info: add indentation via DUMP_VECT_SCOPE

2018-06-26 Thread David Malcolm
This patch adds a concept of nested "scopes" to dumpfile.c's dump_*_loc calls, and wires it up to the DUMP_VECT_SCOPE macro in tree-vectorizer.h, so that the nested structure is shown in -fopt-info by indentation. For example, this converts -fopt-info-all e.g. from: test.c:8:3: note: === analyzin

Re: [line-map patch] Better packing of maps

2018-06-26 Thread David Malcolm
On Tue, 2018-06-26 at 14:28 -0400, Nathan Sidwell wrote: > I've been wandering around the line-map machinery on the modules > branch. > One thing I noticed was the padding of the line_map type hierarchy > was > unfortunate. That made me sad. This patch fixes that. > > Rather than keep the th

[PATCH] Hide alt_dump_file within dumpfile.c

2018-06-26 Thread David Malcolm
On Mon, 2018-06-25 at 15:34 +0200, Richard Biener wrote: > On Wed, Jun 20, 2018 at 6:34 PM David Malcolm > wrote: > > > > Here's v3 of the patch (one big patch this time, rather than a > > kit). > > > > Like the v2 patch kit, this patch reuses the exi

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-26 Thread David Malcolm
On Tue, 2018-06-26 at 01:44 +0200, Paolo Carlini wrote: > Hi, > > this includes straightforward tweaks to check_concept_fn and quite a > bit > of additional work on grokdeclarator: most of it is also rather > straightforward. In a few places there is the subtlety that we want > to > handle toge

[PATCH] C++: don't offer bogus "._0" suggestions (PR c++/86329)

2018-06-27 Thread David Malcolm
PR c++/86329 reports that the C++ frontend can offer bogus suggestions like: #include int compare() { return __n1 - __n2; } suggested.cc: In function 'int compare()': suggested.cc:5:10: error: '__n1' was not declared in this scope return __n1 - __n2; ^~~~ suggested.cc:5:10: note:

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread David Malcolm
On Thu, 2018-06-28 at 02:28 +0200, Paolo Carlini wrote: > Hi, > > On 28/06/2018 01:31, Jason Merrill wrote: > > > > > +/* Returns the smallest location. */ > > > > This should probably say "...that is not UNKNOWN_LOCATION." > > I agree. > > Actually, the places you use min_location would seem

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread David Malcolm
On Wed, 2018-06-27 at 21:13 -0400, David Malcolm wrote: > On Thu, 2018-06-28 at 02:28 +0200, Paolo Carlini wrote: > > Hi, > > > > On 28/06/2018 01:31, Jason Merrill wrote: > > > > > > > +/* Returns the smallest location. */ > > > > > &g

Re: [committed] Introduce dump_location_t

2018-06-28 Thread David Malcolm
On Thu, 2018-06-28 at 13:29 +0200, Richard Biener wrote: > On Tue, Jun 26, 2018 at 3:54 PM David Malcolm > wrote: > > > > On Mon, 2018-06-25 at 15:34 +0200, Richard Biener wrote: > > > On Wed, Jun 20, 2018 at 6:34 PM David Malcolm > > m> > > > wrote:

[PATCH] C++: less verbose error-recovery for version conflict markers

2018-06-28 Thread David Malcolm
We handle version conflict markers in source: $ cat /tmp/test.cc extern void f1 (void); extern void f2 (void); extern void f3 (void); extern void f4 (void); void test () { f1 (); <<< HEAD f2 (); === f3 (); >>> 252be53... Some commit message f4 (); } The C frontend's output i

Re: Add support for dumping multiple dump files under one name

2018-06-29 Thread David Malcolm
On Fri, 2018-06-29 at 10:15 +0200, Richard Biener wrote: > On Fri, 22 Jun 2018, Jan Hubicka wrote: > > > Hi, > > this patch adds dumpfile support for dumps that come in multiple > > parts. This > > is needed for WPA stream-out dump since we stream partitions in > > parallel and > > the dumps woul

[PATCH v3 of 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-09 Thread David Malcolm
On Mon, 2018-01-08 at 16:59 -0500, Jason Merrill wrote: > On 01/08/2018 04:49 PM, Jason Merrill wrote: > > On 01/08/2018 04:01 PM, David Malcolm wrote: > > > On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > > > > > > > > I'd rather ha

[PATCH v4 of 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-09 Thread David Malcolm
On Tue, 2018-01-09 at 15:39 +0100, Jakub Jelinek wrote: > On Tue, Jan 09, 2018 at 09:36:58AM -0500, Jason Merrill wrote: > > On 01/09/2018 06:53 AM, David Malcolm wrote: > > > +case NON_LVALUE_EXPR: > > > +case VIEW_CONVERT_EXPR: > > > + { >

[PATCH] Add some reproducers for issues found when developing the location-wrappers patch

2018-01-09 Thread David Malcolm
Whilst developing the location-wrapper patch kit, I accumulated various source files for which my work-in-progress patched-cc1plus had different behavior to an unpatched cc1plus: some of these were crashes, others were erroneous diagnostics. All of these are now fixed, but it seems appropriate to

[committed] Preserving locations for variable-uses and constants (PR c++/43486)

2018-01-10 Thread David Malcolm
All of the various parts of this kit have now been approved; I've committed it to trunk as r256448. (The initial version of the kit was posted 2017-10-20, and the followup on 2017-11-10, both in stage 1; the final patch approval was 2018-01-09, towards the end of stage 3). Successfully bootstrapp

[PATCH] Fix failure building LLVM with location wrapper nodes (PR c++/83799)

2018-01-11 Thread David Malcolm
PR c++/83799 reports a failure building LLVM due to a bogus "no matching function for call to" error at a callsite like this: TLI->getTypeLegalizationCost(DL); where "DL" is from: using TargetTransformInfoImplBase::DL; The root cause is that type_dependent_expression_p on a USING_DECL should r

[PATCH v2] Fix failure building LLVM with location wrapper nodes (PR c++/83799)

2018-01-12 Thread David Malcolm
On Fri, 2018-01-12 at 09:07 +0100, Markus Trippelsdorf wrote: > On 2018.01.11 at 18:21 -0500, David Malcolm wrote: > > diff --git a/gcc/testsuite/g++.dg/wrappers/pr83799.C > > b/gcc/testsuite/g++.dg/wrappers/pr83799.C > > new file mode 100644 > > index 000..f93c0ae

[PATCH] C++: Fix ICE in warn_for_memset within templates (PR c++/83814)

2018-01-12 Thread David Malcolm
PR c++/83814 reports an ICE introduced by the location wrapper patch (r256448), affecting certain memset calls within templates. The issue occurs when fold_for_warn is called on the arguments to the memset before they've been type-checked, leading to e.g. this assertion failing within fold_binary_

Re: [RFC][PATCH] PR preprocessor/83173: Additional check before decrementing highest_location

2018-01-12 Thread David Malcolm
On Fri, 2017-12-01 at 17:57 -0500, Mike Gulick wrote: > I've come up with some patches that fix PR preprocessor/83173, which > I reported > a couple of weeks ago. > > The first patch is a test case. The second and third patches are two > versions > of the fix. The first version is simpler, but i

Re: [PATCH v2] Fix failure building LLVM with location wrapper nodes (PR c++/83799)

2018-01-17 Thread David Malcolm
On Fri, 2018-01-12 at 12:37 -0500, David Malcolm wrote: > On Fri, 2018-01-12 at 09:07 +0100, Markus Trippelsdorf wrote: > > On 2018.01.11 at 18:21 -0500, David Malcolm wrote: [...snip...] > > Thanks for the fix. Minor nit: > > Please make TargetLoweringBase and Target

[PATCH v2] C++: Fix crash in warn_for_memset within templates (PR c++/83814)

2018-01-17 Thread David Malcolm
On Wed, 2018-01-17 at 09:28 -0500, Jason Merrill wrote: > On Wed, Jan 17, 2018 at 5:34 AM, Jakub Jelinek > wrote: > > On Fri, Jan 12, 2018 at 05:09:24PM -0500, David Malcolm wrote: > > > PR c++/83814 reports an ICE introduced by the location wrapper > > > patch >

[PATCH] -Warray-bounds: Fix false positive in some "switch" stmts (PR tree-optimization/83510)

2018-01-18 Thread David Malcolm
PR tree-optimization/83510 reports that r255649 (for PR tree-optimization/83312) introduced a false positive for -Warray-bounds for array accesses within certain switch statements: those for which value-ranges allow more than one case to be reachable, but for which one or more of the VR-unreachable

[PATCH] Finish removing class move_computations_dom_walker

2018-01-22 Thread David Malcolm
r232820 (aka 2c7b2f8860794cc9b9cf5eeea9d7dc109c0de3be) removed the implementation of class move_computations_dom_walker, but kept the decl. This patch removes the stray decl. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: PR tree-optimization/69452

[PATCH] Fix memory leaks in sbitmap.c selftests

2018-01-22 Thread David Malcolm
"make selftest-valgrind" shows a few leaks in sbitmap.c's selftests; this patch fixes them. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * sbitmap.c (selftest::test_set_range): Fix memory leaks. (selftest::test_bit_in_range): Likewise. ---

[PATCH] Add more test coverage to selftest::test_location_wrappers

2018-01-22 Thread David Malcolm
This patch adds a few extra assertions to selftest::test_location_wrappers. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * tree.c (selftest::test_location_wrappers): Add more test coverage. --- gcc/tree.c | 10 ++ 1 file changed,

[PATCH] v2 -Warray-bounds: Fix false positive in some "switch" stmts (PR tree-optimization/83510)

2018-01-22 Thread David Malcolm
On Fri, 2018-01-19 at 09:45 +0100, Richard Biener wrote: > On Fri, Jan 19, 2018 at 12:36 AM, David Malcolm > wrote: > > PR tree-optimization/83510 reports that r255649 (for > > PR tree-optimization/83312) introduced a false positive for > > -Warray-bounds for array access

[PATCH] C++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974)

2018-01-23 Thread David Malcolm
PR c++/83974 reports an ICE within fold_for_warn when calling cxx_eval_constant_expression on a CAST_EXPR. This comes from a pointer-to-member-function. The result of build_ptrmemfunc (within cp_convert_to_pointer for a null ptr) is a CONSTRUCTOR containing, amongst other things a CAST_EXPR of a

[PATCH v2] C++: Fix ICE in fold_for_warn on CAST_EXPR (PR c++/83974)

2018-01-23 Thread David Malcolm
On Tue, 2018-01-23 at 09:54 -0500, Jason Merrill wrote: > On Tue, Jan 23, 2018 at 9:27 AM, David Malcolm > wrote: > > PR c++/83974 reports an ICE within fold_for_warn when calling > > cxx_eval_constant_expression on a CAST_EXPR. > > > > This comes from a pointer-t

[committed] Fix jit.dg/test-alignment* (PR jit/82846)

2018-01-24 Thread David Malcolm
These testcases jit-compile functions that return char, but were erroneously calling them as if they returned int. This led to errors for certain target configurations (e.g. reading from %eax (32-bit) in the harness when only %al (8-bit) had been written to in the jit-compiled function). Regrtest

[committed] jit: remove some unused fields from recording::union_ (PR jit/81672)

2018-01-25 Thread David Malcolm
gcc::jit::recording::union_ has some stray fields, which are duplicates of those in the compound_type base class. It looks like these have been present since the initial merger of the jit branch to trunk (r217374), where it had three duplicate fields: location *m_loc; string *m_name; fields *m

Re: [PATCH] C++: avoid most reserved words as misspelling suggestions (PR c++/81610 and PR c++/80567)

2018-01-26 Thread David Malcolm
On Mon, 2017-12-11 at 17:24 -0500, Jason Merrill wrote: > On Wed, Nov 22, 2017 at 10:36 AM, David Malcolm > wrote: Original post: https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02048.html > > PR c++/81610 and PR c++/80567 report problems where the C++ > > frontend > > s

Re: [PATCH] fix for diagnostic/84034

2018-01-26 Thread David Malcolm
On Thu, 2018-01-25 at 18:53 +, Bernd Edlinger wrote: > Hi, > > as PR diagnostic/84034 shows, source files with > dos style line endings can cause a glitch in the > terminal emulation that erases the source line that > is supposed to be shown. > > That happens when the colorizing escape sequen

[PATCH/RFC] Fix ICE in find_taken_edge_computed_goto (PR 84136)

2018-01-31 Thread David Malcolm
PR 84136 reports an ICE within sccvn_dom_walker when handling a C/C++ source file that overuses the labels-as-values extension. The code in question stores a jump label into a global, and then jumps to it from another function, which ICEs after inlining: void* a; void foo() { if ((a = &&l))

[PING] Re: [PATCH] C++: avoid most reserved words as misspelling suggestions (PR c++/81610 and PR c++/80567)

2018-02-02 Thread David Malcolm
Ping On Fri, 2018-01-26 at 13:12 -0500, David Malcolm wrote: > On Mon, 2017-12-11 at 17:24 -0500, Jason Merrill wrote: > > On Wed, Nov 22, 2017 at 10:36 AM, David Malcolm > m> > > wrote: > > Original post: > https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02048.htm

Re: [PATCH/RFC] Fix ICE in find_taken_edge_computed_goto (PR 84136)

2018-02-02 Thread David Malcolm
On Thu, 2018-02-01 at 12:05 +0100, Richard Biener wrote: > On Wed, Jan 31, 2018 at 4:39 PM, David Malcolm > wrote: > > PR 84136 reports an ICE within sccvn_dom_walker when handling a > > C/C++ source file that overuses the labels-as-values extension. > > The code in ques

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-06 Thread David Malcolm
On Tue, 2018-02-06 at 12:39 +, Nick Clifton wrote: > Hi Martin, > > > My only suggestions are to consider how control characters and > > excessively messages are handled in other contexts and adopt > > the same approach here. > > Are there other places where user-supplied messages are display

Re: [PATCH] C++: avoid most reserved words as misspelling suggestions (PR c++/81610 and PR c++/80567)

2018-02-07 Thread David Malcolm
On Wed, 2018-02-07 at 12:21 -0500, Jason Merrill wrote: > On Fri, Jan 26, 2018 at 1:12 PM, David Malcolm > wrote: > > On Mon, 2017-12-11 at 17:24 -0500, Jason Merrill wrote: > > > On Wed, Nov 22, 2017 at 10:36 AM, David Malcolm > > com> > > > wro

Re: [PATCH] C++: avoid most reserved words as misspelling suggestions (PR c++/81610 and PR c++/80567)

2018-02-07 Thread David Malcolm
On Wed, 2018-02-07 at 13:22 -0500, Jason Merrill wrote: > On Wed, Feb 7, 2018 at 1:12 PM, David Malcolm > wrote: > > On Wed, 2018-02-07 at 12:21 -0500, Jason Merrill wrote: > > > On Fri, Jan 26, 2018 at 1:12 PM, David Malcolm > > om> > > > wrote: > >

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-07 Thread David Malcolm
On Wed, 2018-02-07 at 17:26 +, Nick Clifton wrote: > Hi Martin, Hi David, > > OK - attached is a new patch that: > > * Replaces control characters with their escape equivalents. > * Includes a testcase. > > I was not sure what to do about the inconsistencies between the > behaviour of #w

[PATCH] -Wformat: fix nonsensical "wide character" message (PR c/84258)

2018-02-07 Thread David Malcolm
PR c/84258 reports that we issue this: warning: format is a wide character string [-Wformat=] on this code: const unsigned char cuc[] = "%i"; sprintf(buf, (char *)cuc, 1); despite the absence of wide characters. This wording dates back 17.5 years to r36586: 2000-09-24 Joseph S. Myers

Re: [PATCH] -Wformat: fix nonsensical "wide character" message (PR c/84258)

2018-02-08 Thread David Malcolm
On Thu, 2018-02-08 at 17:18 +, Joseph Myers wrote: > On Wed, 7 Feb 2018, David Malcolm wrote: > > > gcc/c-family/ChangeLog: > > PR c/84258 > > * c-format.c (struct format_check_results): Add field > > "number_non_char". > > (

<    10   11   12   13   14   15   16   17   18   19   >