[PATCH/RFC] tree-if-conv.c: fix two ICEs seen with -fno-tree-forwprop (PR tree-optimization/84178)

2018-02-08 Thread David Malcolm
PR tree-optimization/84178 reports a couple of source files that ICE inside ifcvt when compiled with -03 -fno-tree-forwprop (trunk and gcc 7). Both cases involve problems with ifcvt's per-BB gimplified predicates. Testcase 1 fails this assertion within release_bb_predicate during cleanup: 283

[PATCH] jit: fix link on OS X and Solaris (PR jit/64089 and PR jit/84288)

2018-02-13 Thread David Malcolm
libgccjit fails to link on OS X and Solaris due to jit/Make-lang.in, due to the assumption there that the linker is GNU ld. Specifically, jit/Make-lang.in hardcodes the use of two options: --version-script and -soname. * on Darwin, --version-script doesn't seem to exist in the linker, and it us

Re: [PATCH] adjust warning_n() to take uhwi (PR 84207)

2018-02-13 Thread David Malcolm
On Tue, 2018-02-13 at 15:37 -0700, Martin Sebor wrote: > On 02/13/2018 01:59 PM, Manuel López-Ibáñez wrote: > > > > > > On 13 Feb 2018 5:58 pm, "Martin Sebor" > > wrote: > > > > > > I wanted to make the _n() functions like warning_n() more > > robust by letting

Re: update LTO test harness README

2018-02-15 Thread David Malcolm
On Thu, 2018-02-15 at 10:54 +0100, Richard Biener wrote: > On Wed, 14 Feb 2018, Martin Sebor wrote: > > > I was excited to find out about the recent enhancement to > > the LTO test harness to support the new dg-lto-warning and > > dg-lto-message directives (thanks, David). > > > > To make them ea

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-15 Thread David Malcolm
On Fri, 2018-02-09 at 13:01 +, Nick Clifton wrote: > Hi David, Hi Martin, > > OK, take 3 of the patch is attached. In this version: > > * The escaping is handled by a new class. > * Self-tests have been added (and they helped find a bug - yay!) > * The documentation has been extended

Re: [PATCH/RFC] tree-if-conv.c: fix two ICEs seen with -fno-tree-forwprop (PR tree-optimization/84178)

2018-02-15 Thread David Malcolm
On Fri, 2018-02-09 at 12:02 +0100, Richard Biener wrote: > On Thu, Feb 8, 2018 at 11:23 PM, David Malcolm > wrote: > > PR tree-optimization/84178 reports a couple of source files that > > ICE inside > > ifcvt when compiled with -03 -fno-tree-forwprop (trunk and gcc 7). >

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-16 Thread David Malcolm
On Fri, 2018-02-16 at 12:43 +, Nick Clifton wrote: > Hi David, > > Attached is a revised version of the patch which I hope addresses > all > of your (very helpful) comments on the v3 patch. > > OK to apply once the sources are back on stage 1 ? Yes. Thanks! Dave > Cheers > Nick >

Re: RFA: Sanitize deprecation messages (PR 84195)

2018-02-16 Thread David Malcolm
On Fri, 2018-02-16 at 07:14 -0500, Trevor Saunders wrote: > On Thu, Feb 15, 2018 at 04:04:45PM -0500, David Malcolm wrote: > > On Fri, 2018-02-09 at 13:01 +, Nick Clifton wrote: > > > +class escaped_string > > > +{ > > > + public: > > > + esca

Re: [Patch AArch64] Turn on frame pointer / partial fix for PR84521

2018-02-23 Thread David Malcolm
On Fri, 2018-02-23 at 11:32 +, Ramana Radhakrishnan wrote: > This fixes a GCC-8 regression that we accidentally switched off frame > pointers in the AArch64 backend when changing the defaults in the > common > parts of the code. This breaks an ABI decision that was made in GCC > at > the dawn o

Re: [PATCH] Fix bogus function cast warning for functions with common arg subset

2018-02-23 Thread David Malcolm
On Fri, 2018-02-23 at 09:10 +0530, Siddhesh Poyarekar wrote: > Libraries like gtk/glib[1] and python[2] use functions with common > argument subsets to register callbacks. The working idea behind it > is > to have a flag in the structure (or some other pre-determined method) > that specifies how t

[PATCH] libiberty: fix URL for demangler ABI

2018-03-02 Thread David Malcolm
The comment at the top of cp-demangle.c lists: http://www.codesourcery.com/cxx-abi/abi.html#mangling which redirects to: https://mentorembedded.github.io/cxx-abi/abi.html#mangling but this is a 404: the latter site is empty. I looked on archive.org; the final version before the redirect seems

[PATCH] libiberty: fix memory usage explosion for invalid templates (PR demangler/84668)

2018-03-03 Thread David Malcolm
PR demangler/84668 reports this failure of c++filt (found by fuzzing): $ c++filt '__H5z55_H5z555' c++filt: out of memory allocating 18446744071696285694 bytes after a total of 135168 bytes internal_cplus_demangle handles the "H5" as a template with 5 arguments

[PATCH 1/2] tree-if-conv.c: fix ICE seen with -fno-tree-forwprop (PR tree-optimization/84178)

2018-03-07 Thread David Malcolm
PR tree-optimization/84178 reports a couple of source files that ICE inside ifcvt when compiled with -03 -fno-tree-forwprop (trunk and gcc 7). Both cases involve problems with ifcvt's per-BB gimplified predicates. Testcase 1 fails this assertion within release_bb_predicate during cleanup: 283

Re: [PATCH/RFC] tree-if-conv.c: fix two ICEs seen with -fno-tree-forwprop (PR tree-optimization/84178)

2018-03-07 Thread David Malcolm
On Fri, 2018-02-16 at 12:48 +0100, Richard Biener wrote: > On Thu, Feb 15, 2018 at 11:07 PM, David Malcolm > wrote: > > On Fri, 2018-02-09 at 12:02 +0100, Richard Biener wrote: > > > On Thu, Feb 8, 2018 at 11:23 PM, David Malcolm > > om> > > > wrote: >

[PATCH 2/2] ifcvt: unfixed testcase for 2nd issue within PR tree-optimization/84178

2018-03-07 Thread David Malcolm
Here's a testcase for the 2nd issue within PR tree-optimization/84178. With -03 -fno-tree-forwprop, trunk and gcc 7 segfault inside update_ssa when called from version_loop_for_if_conversion when a loop is versioned. During loop_version, some blocks are duplicated, and this can duplicate SSA name

Seeking Release Manager approval for: [PATCH] jit: fix link on OS X and Solaris (PR jit/64089 and PR jit/84288)

2018-03-09 Thread David Malcolm
On Wed, 2018-02-14 at 23:36 +0100, FX wrote: > I can confirm that, with the attached revised patch, a bootstrap with > --enable-languages=c,c++,jit --enable-host-shared is successful on > macOS. > > FX Looks good to me; thanks for fixing. Release managers: I'd like to apply FX's patch here:

[committed] Fix ICE for missing header fix-it hints with overlarge #line directives (PR c/84852)

2018-03-14 Thread David Malcolm
PR c/84852 reports an ICE inside diagnostic_show_locus when printing a diagnostic for a source file with a #line >= 2^31: #line 77 int foo (void) { return strlen(""); } where we're attempting to print a fix-it hint at the top of the file and underline the "strlen" (two "line spans").

[committed] Fix testcase for PR c/84852

2018-03-15 Thread David Malcolm
Thanks for catching this. Sorry about the breakage; it affects every target. I had renamed the testcase, and I missed the failure when reviewing the test results. > On Wed, Mar 14, 2018 at 10:10 PM, David Malcolm > wrote: [...] > > Successfully bootstrapped and regression-tested on x86

Re: [committed] Fix ICE for missing header fix-it hints with overlarge #line directives (PR c/84852)

2018-03-16 Thread David Malcolm
On Fri, 2018-03-16 at 10:18 +, Bin.Cheng wrote: > On Thu, Mar 15, 2018 at 1:32 AM, Paul Hua > wrote: > > Hi: > > > > The fixits-pr84852-1.c fails on mips64el target. > > Hi, > It fails on aarch64/arm bare-metal cross toolchains with different > message like: > ERROR: gcc.dg/fixits-pr84852-1.

[PATCH 3/3] Document my gcc 8 changes for the website

2018-03-16 Thread David Malcolm
This patch documents various improvements in GCC 8 for our website. There are lots of examples of colorized output from GCC (generated using ansi2html); the patch uses the ansi2html.css from the previous patch for styling them. Caveat: I don't have the toolchain working for building the site, so

[PATCH 0/3] wwwdocs: Updates for gcc 8 changes

2018-03-16 Thread David Malcolm
classes into HTML colorization. OK for the website? (Note the caveats in patch 3) Thanks David Malcolm (3): bin: add ansi2html.sh Add htdocs/ansi2html.css Document my gcc 8 changes for the website bin/ansi2html.sh | 520 ++ htdocs

[PATCH 1/3] bin: add ansi2html.sh

2018-03-16 Thread David Malcolm
--- bin/ansi2html.sh | 520 +++ 1 file changed, 520 insertions(+) create mode 100755 bin/ansi2html.sh diff --git a/bin/ansi2html.sh b/bin/ansi2html.sh new file mode 100755 index 000..ae83a78 --- /dev/null +++ b/bin/ansi2html.sh @@ -0,0 +1,5

[PATCH 2/3] Add htdocs/ansi2html.css

2018-03-16 Thread David Malcolm
Generated by: ansi2html.sh --css-only --bg=dark --palette=xterm --- htdocs/ansi2html.css | 287 +++ 1 file changed, 287 insertions(+) create mode 100644 htdocs/ansi2html.css diff --git a/htdocs/ansi2html.css b/htdocs/ansi2html.css new file mode

Re: [PATCH 0/3] wwwdocs: Updates for gcc 8 changes

2018-03-18 Thread David Malcolm
On Mon, 2018-03-19 at 00:02 +0100, Gerald Pfeifer wrote: > Hi David, > > On Fri, 16 Mar 2018, David Malcolm wrote: > > This patch kit is for the website; I generated it against a local > > git mirror of the CVS repo. > > > > It adds lots of examples of color

Re: Seeking Release Manager approval for: [PATCH] jit: fix link on OS X and Solaris (PR jit/64089 and PR jit/84288)

2018-03-20 Thread David Malcolm
On Tue, 2018-03-20 at 09:38 +0100, Rainer Orth wrote: > Hi David, > > > Release managers: > > > > I'd like to apply FX's patch here: > > https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00881/patch > > to trunk, to fix the build of jit on OS X, and to make it easier to > > fix > > it on Solaris. >

[PATCH 1/2] C++: show private field accessor hints for const accesses (PR c++/84892)

2018-03-20 Thread David Malcolm
PR c++/84892 reports that we fail to offer fix-it hints about accessor member functions when complaining about accesses to private fields through const pointers and references. It turns out that field_accessor_p was incorrectly checking for "this" being a "const *T", rather than being a "const T*"

[PATCH 2/2] C++: show private field accessor hints with -g and optimization (PR c++/84994)

2018-03-20 Thread David Malcolm
PR c++/84894 reports that the fix-it hints suggesting accessor calls for private fields doesn't work with -g for -O1 and above. The issue is that field_accessor_p requires DECL_SAVED_TREE (fn) to be a RETURN_EXPR, but the former is a STATEMENT_LIST, created in start_preparsed_function here: 15060

Re: Seeking Release Manager approval for: [PATCH] jit: fix link on OS X and Solaris (PR jit/64089 and PR jit/84288)

2018-03-20 Thread David Malcolm
On Wed, 2018-03-21 at 00:39 +0100, Rainer Orth wrote: > Hi Malcolm, > > > > I've now tested the patch (together with the one from PR > > > jit/84288 > > > for > > > several remaining issues). I've needed another snippet for > > > Solaris/SPARC which links libkstat into xgcc and needs it in > > >

[PATCH v2] C++: show private field accessor hints with -g and optimization (PR c++/84994)

2018-03-21 Thread David Malcolm
On Tue, 2018-03-20 at 21:51 -0400, Jason Merrill wrote: > On Tue, Mar 20, 2018 at 7:37 PM, David Malcolm > wrote: > > PR c++/84894 reports that the fix-it hints suggesting accessor > > calls for > > private fields doesn't work with -g for -O1 and above. > > >

[PATCH 0/4] Improvements to #include suggestions

2018-03-22 Thread David Malcolm
relatively low risk. David Malcolm (4): More #include suggestions (PR c++/84269) C: Ensure that we print include hints in -Wimplicit-function-declaration C++: suggest missing headers for implicit use of "std" (PR c++/85021) C++: more std header hints; filter on C++ dialect (P

[PATCH 1/4] More #include suggestions (PR c++/84269)

2018-03-22 Thread David Malcolm
PR c++/84269 reports a number of names in the C and C++ standard libraries for which we don't yet offer #include fix-it hints. This patch adds them (up to comment #9). Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. OK for trunk? gcc/c-family/ChangeLog: PR c++/84269

[PATCH 2/4] C: Ensure that we print include hints in -Wimplicit-function-declaration

2018-03-22 Thread David Malcolm
I noticed when testing the previous patch on the C frontend that the fix-it hints weren't always showing up: -Wimplicit-function-declaration wasn't always providing a fix-it hint, but "incompatible implicit declaration of built-in function" was, *if* it warned. Consider e.g.: $ cat t.c void t

[PATCH 3/4] C++: suggest missing headers for implicit use of "std" (PR c++/85021)

2018-03-22 Thread David Malcolm
We provide fix-it hints for the most common "std" names when an explicit "std::" prefix is present, however we don't yet provide fix-it hints for this implicit case: using namespace std; void f() { cout << "test"; } for which we emit: t.cc: In function 'void f()': t.cc:2:13: error: 'cou

[PATCH 4/4] C++: more std header hints; filter on C++ dialect (PR c++/84269)

2018-03-22 Thread David Malcolm
Jonathan added a bunch more suggestions to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84269#c10 as I was testing my last patch, some of which need C++14 and C++17, and some of which use headers that exist in earlier standards. For example, exists in C++98, but if the user attempts to use std

[PATCH 2/2] Show pertinent parameter (PR c++/85110)

2018-03-28 Thread David Malcolm
This followup patch updates the specific error-handling path to add a note showing the pertinent parameter decl, taking the output from: test.cc: In function 'void caller(const char*)': test.cc:6:14: error: cannot convert 'const char*' to 'const char**' for argument '2' to 'void callee(int, const

[PATCH 1/2] More underlining of bad arguments (PR c++/85110)

2018-03-28 Thread David Malcolm
As of r256448, the C++ frontend underlines many bad arguments in its diagnostics; those where perform_overload_resolution returns a non-NULL candidate, but there's a failure in convert_like_real. However, for the case where perform_overload_resolution fails, but there's a single non-viable candida

Re: [PATCH] Show dangerous warning when -Werror option is used

2018-04-01 Thread David Malcolm
On Sun, 2018-04-01 at 22:40 +0200, Pali Rohár wrote: > On Sunday 01 April 2018 14:32:26 Segher Boessenkool wrote: > > On Sun, Apr 01, 2018 at 12:05:40PM +0200, Pali Rohár wrote: > > > Command line option -Werror is dangerous as it could cause > > > problems for > > > compiling applications in futur

[PATCH 0/2] wwwdocs: Updates for gcc 8 changes (v2)

2018-04-04 Thread David Malcolm
On Mon, 2018-03-19 at 00:02 +0100, Gerald Pfeifer wrote: > Hi David, > > On Fri, 16 Mar 2018, David Malcolm wrote: > > This patch kit is for the website; I generated it against a local > > git mirror of the CVS repo. > > > > It adds lots of examples of color

[committed 2/2] wwwdocs: Document my gcc 8 changes for the website (v2)

2018-04-04 Thread David Malcolm
This patch incorporates your review suggestions. Successfully checked as XHTML 1.0 Transitional. I've committed it to CVS. I made this version using gcc-color-to-html.py from the previous patch, to turn the SGR codes into spans for use with our gcc.css. It adds various entries to the stylesheet t

[PATCH 1/2] wwwdocs: Add bin/gcc-color-to-html.py

2018-04-04 Thread David Malcolm
Here's the new script I've been using for converting from diagnostic-color.c output to HTML spans that use gcc.css, via something like: LANG=C gcc $@ -fdiagnostics-color=always 2>&1 | ./bin/gcc-color-to-html.py The script converts SGR_SEQ(COLOR_BOLD) to a rather than so that it can use

Re: [committed 2/2] wwwdocs: Document my gcc 8 changes for the website (v2)

2018-04-04 Thread David Malcolm
On Wed, 2018-04-04 at 21:02 +0200, Gerald Pfeifer wrote: > On Wed, 4 Apr 2018, David Malcolm wrote: > > I made this version using gcc-color-to-html.py from the previous > > patch, > > to turn the SGR codes into spans for use with our gcc.css. > > Nice. Out of curiosit

Re: [PATCH 1/2] wwwdocs: Add bin/gcc-color-to-html.py

2018-04-04 Thread David Malcolm
On Wed, 2018-04-04 at 21:01 +0200, Gerald Pfeifer wrote: > On Wed, 4 Apr 2018, David Malcolm wrote: > > Here's the new script I've been using for converting from > > diagnostic-color.c output to HTML spans that use gcc.css, > > via something like: > >

[PATCH v2] C++: suggest missing headers for implicit use of "std" (PR c++/85021)

2018-04-05 Thread David Malcolm
On Thu, 2018-03-29 at 15:25 -0400, Jason Merrill wrote: > On Thu, Mar 22, 2018 at 7:44 PM, David Malcolm > wrote: > > We provide fix-it hints for the most common "std" names when an > > explicit > > "std::" prefix is present, however we don't y

[PATCH] v2: Show pertinent parameter (PR c++/85110)

2018-04-06 Thread David Malcolm
On Thu, 2018-03-29 at 09:20 -0400, Jason Merrill wrote: > On Wed, Mar 28, 2018 at 4:44 PM, David Malcolm > wrote: > > This followup patch updates the specific error-handling path > > to add a note showing the pertinent parameter decl, taking > > the output from: >

Re: [PATCH] gdbhooks: Add new pretty-printers for: varpool_node, symtab_node, cgraph_edge and ipa_ref.

2018-04-10 Thread David Malcolm
On Tue, 2018-04-10 at 14:45 +0200, Martin Liška wrote: > Hi. > > I'm bit ashamed that I tasted our gdb pretty-printers today for the > first time. > It's working nice and I would like to extend it a bit for classes > that I print/debug often. This looks good from the gdbhooks.py side; I'll assume

Re: [C++ PATCH] empty-declarations

2018-04-10 Thread David Malcolm
On Tue, 2018-04-10 at 13:47 -0400, Nathan Sidwell wrote: > On 04/10/2018 12:43 PM, Jason Merrill wrote: > > On Tue, Apr 10, 2018 at 12:32 PM, Nathan Sidwell > > wrote: > > > On 04/10/2018 12:00 PM, Jason Merrill wrote: > > > I don't see why we should warn at all. > > > > It's not on by default, b

[PATCH] configure.ac: honor --with-gcc-major-version in gcc-driver-name.h (PR jit/85384)

2018-04-12 Thread David Malcolm
This patch updates gcc/configure.ac to use gcc_base_ver. I had to drop the \$\$ from the sed expression to get it to work within the configure script; I'm not entirely sure what their purpose is. Without them, it's still matching on the first group of numeric characters in BASE-VER. Tested with

[committed] Prevent erroneous "macro had not yet been defined" messages (PR c++/85385)

2018-04-12 Thread David Malcolm
PR c++/85385 reports an issue where we emit bogus "macro had not yet been defined" notes when a macro is mis-used: $ cat test.c #define MACRO(X,Y) void test () { MACRO(42); } $ ./xg++ -B. -c test.c test.c:5:11: error: macro "MACRO" requires 2 arguments, but only 1 given MA

Re: [PATCH 05/25] Add sorry_at diagnostic function.

2018-09-05 Thread David Malcolm
On Wed, 2018-09-05 at 12:49 +0100, a...@codesourcery.com wrote: > The plain "sorry" diagnostic only gives the "current" location, which > is > typically the last line of the function or translation unit by time > we get to > the back end. > > GCN uses "sorry" to report unsupported language feature

Re: [PATCH 05/25] Add sorry_at diagnostic function.

2018-09-05 Thread David Malcolm
On Wed, 2018-09-05 at 09:39 -0400, David Malcolm wrote: > On Wed, 2018-09-05 at 12:49 +0100, a...@codesourcery.com wrote: > > The plain "sorry" diagnostic only gives the "current" location, > > which > > is > > typically the last line of the fun

[PATCH] C++: special-case single non-viable candidate (more PR c++/85110)

2018-09-05 Thread David Malcolm
On Thu, 2018-08-30 at 18:18 -0400, Jason Merrill wrote: > On Thu, Aug 23, 2018 at 2:08 PM, David Malcolm > wrote: > > This is a followup to: > > > > "[PATCH] C++: underline param in print_conversion_rejection (more > > PR c++/85110)" > > https

[PATCH 1/5] substring-locations: add class format_string_diagnostic_t

2018-09-14 Thread David Malcolm
With the addition of ranges in r263564, format_warning_at_substring_n has 10 arguments. Reduce the number of args by bundling the shared ones into a class format_string_diagnostic_t. gcc/c-family/ChangeLog: * c-format.c (format_warning_at_char): Update for introduction of format_s

[PATCH 0/5] RFC: gimple-ssa-sprintf.c: a new approach (PR middle-end/77696)

2018-09-14 Thread David Malcolm
ssage where appropriate (to better grab the user's attention). It also calls out NUL terminators, since people tend to make mistakes with them. There's a lot of FIXMEs in the resulting patch, but I wanted to run the idea past you before fixing all the FIXMEs. In particular, I haven't attempte

[PATCH 5/5] gimple-ssa-sprintf.c: rewrite overflow/truncation diagnostic (PR middle-end/77696)

2018-09-14 Thread David Malcolm
gcc/ChangeLog: PR middle-end/77696 * gimple-ssa-sprintf.c: Include "gcc-rich-location.h". (struct directive_state): New struct. (directive_state::get_text): New function. (format_result::add_directive): New member function. (format_result::should_warn

[PATCH 3/5] gimple-ssa-sprintf.c: move struct call_info out of the dom_walker subclass

2018-09-14 Thread David Malcolm
gcc/ChangeLog: * gimple-ssa-sprintf.c (struct call_info): New forward decl. (class sprintf_dom_walker): Remove forward decl. (struct sprintf_dom_walker::call_info): Rename to... (struct call_info): ...this. (should_warn_p): Update for move of call_info out of

[PATCH 4/5] Add pp_humanized_limit and pp_humanized_range

2018-09-14 Thread David Malcolm
gcc/ChangeLog: * pretty-print.c (get_power_of_two): New function. (struct relative_to_power_of_2): New struct. (pp_humanized_limit): New function. (pp_humanized_range): New function. (selftest::assert_pp_humanized_limit): New function. (ASSERT_PP_HUMA

[PATCH 2/5] Add range_idx param to range_label::get_text

2018-09-14 Thread David Malcolm
This patch updates the pure virtual function range_label::get_text (and its implementations) so that the index of the range is passed in, allowing for one label instance to be shared by multiple ranges. gcc/c-family/ChangeLog: * c-format.c (range_label_for_format_type_mismatch::get_text):

Re: [PATCH] gcov: emit hotness colors to easily find hot code.

2018-09-17 Thread David Malcolm
On Wed, 2018-09-12 at 14:36 +0200, Martin Liška wrote: > Hi. > > This is follow-up of: > https://gcc.gnu.org/ml/gcc/2018-08/msg00162.html > > I'm suggesting to introduce using colors in order to indicate hotness > of lines. Legend is printed at the very beginning of the output file. > Example: ht

[PATCH] dump_printf: use %T and %G throughout

2018-09-18 Thread David Malcolm
As promised at Cauldron, this patch uses %T and %G with dump_printf and dump_printf_loc calls to eliminate calls to dump_generic_expr (MSG_*, arg, TDF_SLIM) (via %T) and dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0) (via %G) throughout the middle-end, simplifying numerous dump callsites. A

[PATCH] dumpfile.c: fix stray dump_loc output (PR tree-optimization/87309)

2018-09-19 Thread David Malcolm
In r262891 I reimplemented this call: dump_printf_loc (MSG_NOTE, loc, "=== %s ===\n", name); in dump_begin_scope to use direct calls to dump_loc: if (dump_file) { dump_loc (MSG_NOTE, dump_file, loc.get_location_t ()); fprintf (dump_file, "=== %s ===\n", name); } if (alt_d

Re: [PATCH] dumpfile.c: fix stray dump_loc output (PR tree-optimization/87309)

2018-09-21 Thread David Malcolm
On Wed, 2018-09-19 at 15:51 +0200, Richard Biener wrote: > On Wed, Sep 19, 2018 at 12:42 PM David Malcolm > wrote: > > > > In r262891 I reimplemented this call: > > dump_printf_loc (MSG_NOTE, loc, "=== %s ===\n", name); > > in dump_begin_scope t

[PATCH] v2: C++: suggestions for misspelled private members (PR c++/84993)

2018-09-21 Thread David Malcolm
This is v2 of the patch; I managed to bit-rot my own patch due to my fix for r264335, which tightened up the "is this meaningful" threshold on edit distances when finding spelling correction candidates. The only change in this version is to rename various things in the testcase so that they contin

[PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}

2018-09-25 Thread David Malcolm
As noted at Cauldron, dumpfile.c currently emits "note: " for all kinds of dump message, so that (after filtering) there's no distinction between MSG_OPTIMIZED_LOCATIONS vs MSG_NOTE vs MSG_MISSED_OPTIMIZATION in the textual output. This patch changes dumpfile.c so that the "note: " varies to show

Re: [PATCH] GCOV: introduce --json-format.

2018-09-27 Thread David Malcolm
On Thu, 2018-09-27 at 09:46 +0200, Martin Liška wrote: > Hi. > > For some time we've been providing an intermediate format as > output of GCOV tool. It's documented in our code that primary > consumer of it is lcov. Apparently that's not true: > https://github.com/linux-test-project/lcov/issues/38

[committed] opt-suggestions.c: fix minor memory leak

2018-09-28 Thread David Malcolm
"make selftest-valgrind" shows a couple of leaks, presumably introduced in r264052 (PR driver/83193): 440 bytes in 1 blocks are definitely lost in loss record 590 of 668 at 0x4A083AA: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x20C4AAC: xrealloc (xmalloc.c:179)

[PATCH 0/3] Higher-level reporting of vectorization problems (v3)

2018-09-28 Thread David Malcolm
hose patches for more information. The patches now bootstrap & pass regression testing on x86_64-pc-linux-gnu; I'm hoping to get this into trunk for GCC 9. Thanks Dave David Malcolm (3): Fix -fopt-info for plugin passes Add -fopt-info-internals v3: Report vectorization problem

[PATCH 2/3] Add -fopt-info-internals

2018-09-28 Thread David Malcolm
This patch introduces a verbosity level to dump messages: "user-facing" vs "internals". By default, messages at the top-level dump scope are "user-facing", whereas those that are in nested scopes are implicitly "internals", and are filtered out by -fopt-info unless a new "-internals" sub-option of

[PATCH 1/3] Fix -fopt-info for plugin passes

2018-09-28 Thread David Malcolm
Attempts to dump via -fopt-info from a plugin pass fail, due to the dfi->alt_state for such passes never being set. This is because the -fopt-info options were being set up per-pass during option-parsing (via gcc::dump_manager::opt_info_enable_passes), but this data was not retained or used it for

Re: [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}

2018-10-01 Thread David Malcolm
On Sun, 2018-09-30 at 00:12 +0200, Andreas Schwab wrote: > That produces extra output that breaks a few tests. > > g++.dg/vect/pr33426-ivdep-2.cc -std=c++11 (test for excess errors) > g++.dg/vect/pr33426-ivdep-2.cc -std=c++14 (test for excess errors) > g++.dg/vect/pr33426-ivdep-2.cc -std=c++98

[PATCH 2/2] Support string locations for C++ in -Wformat (PR c++/56856)

2018-10-04 Thread David Malcolm
-Wformat in the C++ FE doesn't work as well as it could: (a) it doesn't report precise locations within the string literal, and (b) it doesn't underline arguments for those arguments !CAN_HAVE_LOCATION_P, despite having location wrapper nodes. For example: Wformat-ranges.C:32:10: warning: forma

[PATCH 1/2] testsuite: multiline.exp: implement optional target/xfail selector

2018-10-04 Thread David Malcolm
Successfully regrtested on x86_64-pc-linux-gnu. OK for trunk? gcc/testsuite/ChangeLog: * lib/multiline.exp (proc dg-end-multiline-output): Check argument count. If there's a 3rd argument, use dg-process-target on it, bailing out, or recording expected failures as "maybe_x

Re: [PATCH 2/3] Add -fopt-info-internals

2018-10-04 Thread David Malcolm
On Thu, 2018-10-04 at 12:45 +0200, Richard Biener wrote: > On Fri, 28 Sep 2018, David Malcolm wrote: > > > This patch introduces a verbosity level to dump messages: > > "user-facing" vs "internals". > > > > By default, messages at the top-lev

-fopt-info-inline and class opt_problem

2018-10-04 Thread David Malcolm
On Thu, 2018-10-04 at 12:52 +0200, Richard Biener wrote: > On Fri, 28 Sep 2018, David Malcolm wrote: [...snip...] > > > > OK for trunk? > > OK. My question on 2/3 leaves Richard time to comment. > > Maybe you can tackle the issue that -fopt-info-inline does > no

[PATCH] Folding and check_function_arguments

2018-10-08 Thread David Malcolm
On Mon, 2018-10-08 at 10:37 -0400, Jason Merrill wrote: > On Thu, Oct 4, 2018 at 10:12 AM David Malcolm > wrote: > > > > -Wformat in the C++ FE doesn't work as well as it could: > > (a) it doesn't report precise locations within the string literal, > > an

Re: [PATCH] v2: C++: suggestions for misspelled private members (PR c++/84993)

2018-10-09 Thread David Malcolm
On Mon, 2018-09-24 at 10:56 -0600, Martin Sebor wrote: > On 09/21/2018 04:09 PM, David Malcolm wrote: > > This is v2 of the patch; I managed to bit-rot my own patch due to > > my > > fix for r264335, which tightened up the "is this meaningful" > > thresho

[PATCH] C++: simplify output from suggest_alternatives_for

2018-10-09 Thread David Malcolm
hloc.add_fixit_replace (suggestion); error_at (&richloc, "unknown type name %qE; did you mean %qs?", - token->value, hint.suggestion ()); + token->value, suggestion); } else

[committed] Cleanup of libcpp diagnostic callbacks

2018-10-09 Thread David Malcolm
This patch renames the "error" callback within libcpp to "diagnostic", and uses the pair of enums in cpplib.h, rather than passing two different kinds of "int" around. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r264999. gcc/c-family/ChangeLog: *

[PATCH] v2: C++: simplify output from suggest_alternatives_for

2018-10-10 Thread David Malcolm
On Tue, 2018-10-09 at 18:38 -0400, Jason Merrill wrote: > On Tue, Oct 9, 2018 at 1:19 PM David Malcolm > wrote: > > + /* Emulation of a "move" constructor, but really a copy > > + constructor. */ > > + > > + name_hint (const name_hint &othe

[committed] libcpp: show macro definition when used with wrong argument count

2018-10-11 Thread David Malcolm
Consider: demo.c: In function 'test': demo.c:5:40: error: macro "LOG_2" requires 3 arguments, but only 2 given 5 | LOG_2 ("loading file: %s\n", filename); |^ This patch adds a note showing the definition of the macro in question, giving: demo.c: In fun

[PATCH] multiline.exp: complain about mismatched dg-{begin|end}-multiline-output

2018-10-11 Thread David Malcolm
Mismatched dg-{begin|end}-multiline-output directives are currently silently ignored, leading to difficult-to-diagnose test failures involving excess output. This patch makes multiline.exp complain about them. Successfully regrtested on x86_64-pc-linux-gnu OK for trunk? gcc/testsuite/ChangeLog:

[PATCH] Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-25 Thread David Malcolm
Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky Abstractions shows two issues where g++ offers suggestions about implementation details: Example 1: int main () { auto lambda = [val = 2](){}; lambda.val; } : In function 'int main()': :5:10: error: 'struct main()::' has no member named

Re: RFC: bash completion

2018-04-25 Thread David Malcolm
[moving from gcc to gcc-patches mailing list] On Wed, 2018-04-25 at 15:12 +0200, Martin Liška wrote: > On 04/24/2018 06:27 PM, David Malcolm wrote: > > On Tue, 2018-04-24 at 16:45 +0200, Martin Liška wrote: > > > Hi. > > > > > > Some time ago, I investiga

[PATCH] v2: Don't offer suggestions for compiler-generated variables (PR c++/85515)

2018-04-26 Thread David Malcolm
On Thu, 2018-04-26 at 15:53 -0400, Jason Merrill wrote: > On Thu, Apr 26, 2018 at 3:45 AM, Richard Biener > wrote: > > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell > > wrote: > > > On 04/25/2018 11:41 AM, David Malcolm wrote: > > > > > > > &g

[committed] input.h: convert some macros to inline functions

2018-04-27 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r259727. gcc/ChangeLog: * input.h (in_system_header_at): Convert from macro to inline function. (from_macro_expansion_at): Likewise. (from_macro_definition_at): Likewise. --- gcc/

[committed] input.h: use STATIC_ASSERT

2018-04-30 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r259766. gcc/ChangeLog: * input.h (builtins_location_check): Convert to a STATIC_ASSERT. --- gcc/input.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/input.h b/gcc/input.h in

[committed] Use char_span for return type of location_get_source_line

2018-04-30 Thread David Malcolm
location_get_source_line returns a const char * that isn't 0-terminated, writing back a length through an int * param. This is error-prone, as all call-sites have to take into account the lack of 0-termination, and respect the length of the buffer. It's cleaner to bundle together this pointer+len

[committed] selftest.h: fix alphabetization of per-source-file selftest declarations

2018-04-30 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r259773. gcc/ChangeLog: * selftest.h: Fix alphabetization of per-source-file selftest declarations. --- gcc/selftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff -

[PATCH] selftest: remove "Yoda ordering" in assertions

2018-04-30 Thread David Malcolm
Our selftest assertions were of the form: ASSERT_EQ (expected, actual) and both Richard Sandiford and I find this "Yoda ordering" confusing. Our existing tests aren't entirely consistent about this, and it doesn't make sense for ASSERT_NE and its variants. The ordering comes from googletest's

[committed] Add gcc_rich_location::add_fixit_insert_formatted

2018-04-30 Thread David Malcolm
This patch adds a support function to class gcc_rich_location to make it easier for fix-it hints to use idiomatic C/C++ indentation, for use by the patch for PR c++/85523. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r259783. gcc/ChangeLog: PR c++/

[PATCH] Add fix-it hint for missing return statement in assignment operators (PR c++/85523)

2018-04-30 Thread David Malcolm
Following on from the thread on the "gcc" list here: https://gcc.gnu.org/ml/gcc/2018-04/msg00172.html here's an updated version of Jonathan's patch, which: * eliminates the separate "note" in favor of simplying having the warning itself emit the "return *this;" fix-it hint pr85523.C: In

Re: [PATCH] Add fix-it hint for missing return statement in assignment operators (PR c++/85523)

2018-04-30 Thread David Malcolm
On Mon, 2018-04-30 at 20:29 -0400, David Malcolm wrote: [...] > In doing so I guarded it with a call to: > global_dc->option_enabled (OPT_Wreturn_type Gah; typo, sorry: > as per the insides of diagnostic.s, since adding a fi

[PATCH] spellcheck: support transpositions aka Damerau-Levenshtein (PR other/69968)

2018-04-30 Thread David Malcolm
This patch updates the edit-distance algorithm in spellcheck.c to support transpositions as well as additions/deletions/substitutions, so that a transposition error counts as a distance of 1 rather than 2. This leads to saner suggestions for such cases. Successfully bootstrapped & regrtested on x

Re: [PATCH 1/2] gcc_qsort: source code changes

2018-05-10 Thread David Malcolm
On Thu, 2018-05-10 at 18:56 +0300, Alexander Monakov wrote: > * sort.cc: New file. > * system.h [!CHECKING_P] (qsort): Redirect to gcc_qsort. > * vec.c (qsort_chk): Use gcc_qsort. [...snip...] I'm not a reviewer for this, but there's a lot of fiddly implementation logic here

Re: [wwwdocs] Describe how to validate wwwdocs changes

2018-05-15 Thread David Malcolm
On Sun, 2018-05-13 at 22:19 -0600, Gerald Pfeifer wrote: > This is triggered by a report from Martin who rightfully pointed > out that it's not straightforward to validate wwwdocs changes before > committing a change. > > Martin, what do you think? Would that have avoided the challenges > your

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-18 Thread David Malcolm
On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > The following adds a simple alloc/free_flag machinery allocating > bits from an int typed pool and applies that to bb->flags and edge- > >flags. > This should allow infrastructure pieces to use egde/bb flags > temporarily > without worrying

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread David Malcolm
On Tue, 2018-05-22 at 10:43 +0200, Richard Biener wrote: > On Mon, 21 May 2018, Jeff Law wrote: > > > On 05/18/2018 07:15 AM, David Malcolm wrote: > > > On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > > > > The following adds a simple alloc/free_

[PATCH 016/236] BND_TO scaffolding

2014-08-06 Thread David Malcolm
gcc/ * sel-sched-ir.h (BND_TO): insn_t will eventually be an rtx_insn *. To help with transition, for now, convert from an access macro into a pair of functions: BND_TO, returning an rtx_insn *, and... (SET_BND_TO): New function, for use where BND_TO is used

[PATCH 074/236] expr.c: Use rtx_insn and rtx_code_label

2014-08-06 Thread David Malcolm
gcc/ * expr.c (convert_move): Strengthen local "insns" from rtx to rtx_insn *. (emit_block_move_via_loop): Strengthen locals "cmp_label" and "top_label" from rtx to rtx_code_label *. (move_block_to_reg): Strengthen local "insn", "last" from rtx to rtx

[PATCH 178/236] Remove BB_HEAD, BB_END, BB_HEADER scaffolding

2014-08-06 Thread David Malcolm
gcc/ * basic-block.h (struct rtl_bb_info): Strengthen fields "end_" and "header_" from rtx to rtx_insn *. (struct basic_block_d): Likewise for field "head_" within "x" field of union basic_block_il_dependent. (BB_HEAD): Drop function... (SET_BB_HEAD):

[PATCH 065/236] cse.c: Use rtx_insn

2014-08-06 Thread David Malcolm
gcc/ * cse.c (struct qty_table_elem): Strengthen field "const_insn" from rtx to rtx_insn *. (struct change_cc_mode_args): Likewise for field "insn". (this_insn): Strengthen from rtx to rtx_insn *. (make_new_qty): Replace use of NULL_RTX with NULL when dealing

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