Re: [PATCH] Capture source location of dtors (PR c++/89390)

2019-02-20 Thread David Malcolm
On Tue, 2019-02-19 at 20:37 +0100, Jakub Jelinek wrote: > On Tue, Feb 19, 2019 at 02:44:55PM -0500, David Malcolm wrote: > > How about something like this? (on top of Jakub's patch) > > I had following queued for regtest, so if you want to go for the > make_location ^~,

[committed] Fix ICE with #line directive (PR c/89410)

2019-02-20 Thread David Malcolm
PR c/89410 reports various issues with #line directives with very large numbers; one of them is an ICE inside diagnostic-show-locus.c when emitting a diagnostic at line 0x. The issue is that the arithmetic in layout::calculate_line_spans to determine if two line spans are sufficiently clos

[PATCH v2] Capture source location of dtors (PR c++/89390)

2019-02-20 Thread David Malcolm
On Tue, 2019-02-19 at 20:37 +0100, Jakub Jelinek wrote: > On Tue, Feb 19, 2019 at 02:44:55PM -0500, David Malcolm wrote: > > How about something like this? (on top of Jakub's patch) > > I had following queued for regtest, so if you want to go for the > make_location ^~,

[PATCH] Minimum version of mpfr? (was Re: [PATCH] Fix up norm2 simplification (PR middle-end/88074))

2019-02-21 Thread David Malcolm
On Wed, 2019-02-13 at 00:09 +0100, Jakub Jelinek wrote: > Hi! > > As discussed recently on the mailing list, the norm2 simplification > doesn't > work if we limit mpfr emin/emax to some values derived from maximum > floating > exponents (and precision for denormals). > > The following patch adjusts

Re: [PATCH] Minimum version of mpfr? (was Re: [PATCH] Fix up norm2 simplification (PR middle-end/88074)), take 2

2019-02-22 Thread David Malcolm
On Fri, 2019-02-22 at 14:19 +0100, Jakub Jelinek wrote: > On Thu, Feb 21, 2019 at 04:50:27PM -0500, David Malcolm wrote: > > gcc/fortran/ChangeLog: > > PR middle-end/88074 > > * simplify.c (norm2_add_squared): Use mp_exp_t rather than > > mpfr_exp_t. >

Re: [PATCH][stage1] Add option suggestion for -Werror=foo and corresponding pragma.

2019-03-05 Thread David Malcolm
On Tue, 2019-03-05 at 15:14 +0100, Martin Liška wrote: > Hi. > > The patch extends option suggestion for both -Werror and > corresponding > pragram. > > Patch can bootstrap on x86_64-linux-gnu and survives regression > tests. > > Ready to be installed after stage1 opens? > Thanks, > Martin Good

Re: [PATCH][stage1] Add option suggestion for -Werror=foo and corresponding pragma.

2019-03-05 Thread David Malcolm
On Tue, 2019-03-05 at 15:14 +0100, Martin Liška wrote: > Hi. > > The patch extends option suggestion for both -Werror and > corresponding > pragram. > > Patch can bootstrap on x86_64-linux-gnu and survives regression > tests. > > Ready to be installed after stage1 opens? > Thanks, > Martin > >

Re: [PATCH][stage1] Add option suggestion for -Werror=foo and corresponding pragma.

2019-03-05 Thread David Malcolm
On Tue, 2019-03-05 at 15:42 +0100, Martin Liška wrote: > On 3/5/19 3:21 PM, David Malcolm wrote: > > On Tue, 2019-03-05 at 15:14 +0100, Martin Liška wrote: > > > Hi. > > > > > > The patch extends option suggestion for both -Werror and > > > corres

[wwwdocs] My changes to gcc-9/changes.html

2019-03-18 Thread David Malcolm
Here's a patch for the website to add my changes for GCC 9 (bearing a strong resemblance to my recent blog post) OK to commit? --- htdocs/gcc-9/changes.html | 310 +- 1 file changed, 305 insertions(+), 5 deletions(-) diff --git a/htdocs/gcc-9/changes.

[wwwdocs, committed] My changes to gcc-9/changes.html (v2)

2019-03-22 Thread David Malcolm
On Mon, 2019-03-18 at 10:27 -0600, Sandra Loosemore wrote: > On 3/18/19 9:48 AM, Gerald Pfeifer wrote: > > On Mon, 18 Mar 2019, David Malcolm wrote: > > > Here's a patch for the website to add my changes for GCC 9 > > > (bearing > > > a strong resemblance t

Re: [patch] PR jit/87808: Allow libgccjit to work without an external gcc driver

2019-03-22 Thread David Malcolm
On Thu, 2019-03-21 at 12:26 +0100, Matthias Klose wrote: > Fix PR jit/87808, the embedded driver still needing the external gcc > driver to > find the gcc_lib_dir. This can happen in a packaging context when > libgccjit > doesn't depend on the gcc package, but just on binutils and libgcc- > dev pac

[PATCH] optinfo-emit-json.cc: don't call get_fnname_from_decl (PR middle-end/89725)

2019-03-28 Thread David Malcolm
optrecord_json_writer::optinfo_to_json can in theory be called from any optimization pass, but currently uses get_fnname_from_decl, which is RTL-specific, which can lead to an ICE (PR middle-end/89725). In that PR, Jakub suggested using either DECL_ASSEMBLER_NAME or the "printable name" (via curre

Re: [PATCH] optinfo-emit-json.cc: don't call get_fnname_from_decl (PR middle-end/89725)

2019-03-28 Thread David Malcolm
On Thu, 2019-03-28 at 15:14 +0100, Jakub Jelinek wrote: > On Thu, Mar 28, 2019 at 11:02:52AM -0400, David Malcolm wrote: > > optrecord_json_writer::optinfo_to_json can in theory be called from > > any > > optimization pass, but currently uses get_fnname_from_decl, which >

[committed] Guard notes for -Waddress-of-packed-member on warning emission (PR c/89985)

2019-04-05 Thread David Malcolm
This patch fixes stray notes emitted by -Waddress-of-packed-member when disabled via -w. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r270169. gcc/c-family/ChangeLog: PR c/89985 * c-warn.c (check_address_or_pointer_of_packed_member): Add

Re: [PATCH] Remove some further trailing whitespaces from diagnostic messages (PR translation/90011)

2019-04-09 Thread David Malcolm
On Tue, 2019-04-09 at 09:21 +0200, Jakub Jelinek wrote: > Hi! > > Several further spots with trailing whitespace, only > bootstrapped/regtested > on x86_64-linux and i686-linux (so the ipa-devirt.c change is > covered), > the rest is just by eyeballing gcc.pot. > > Ok for trunk? > > I wonder whe

Re: [PATCH] Remove some further trailing whitespaces from diagnostic messages (PR translation/90011)

2019-04-09 Thread David Malcolm
On Tue, 2019-04-09 at 10:01 -0400, David Malcolm wrote: > On Tue, 2019-04-09 at 09:21 +0200, Jakub Jelinek wrote: > > Hi! > > > > Several further spots with trailing whitespace, only > > bootstrapped/regtested > > on x86_64-linux and i686-linux (so the ipa-devirt.

Re: [PATCH 5/12] fix diagnostic quoting/spelling in c-family

2019-05-17 Thread David Malcolm
On Thu, 2019-05-16 at 18:40 -0600, Martin Sebor wrote: > On 5/16/19 5:22 PM, Joseph Myers wrote: > > On Tue, 14 May 2019, Martin Sebor wrote: > > > > > The attached patch fixes quoting, spelling, and other formatting > > > issues in diagnostics issued from files in the c-family/ > > > directory >

Re: [PATCH 5/12] fix diagnostic quoting/spelling in c-family

2019-05-17 Thread David Malcolm
On Fri, 2019-05-17 at 09:02 -0600, Martin Sebor wrote: > On 5/17/19 7:43 AM, David Malcolm wrote: > > On Thu, 2019-05-16 at 18:40 -0600, Martin Sebor wrote: > > > On 5/16/19 5:22 PM, Joseph Myers wrote: > > > > On Tue, 14 May 2019, Martin Sebor wrote: > > >

Re: [PATCH 5/12] fix diagnostic quoting/spelling in c-family

2019-05-17 Thread David Malcolm
On Fri, 2019-05-17 at 12:07 -0600, Martin Sebor wrote: > On 5/17/19 11:16 AM, David Malcolm wrote: > > On Fri, 2019-05-17 at 09:02 -0600, Martin Sebor wrote: > > > On 5/17/19 7:43 AM, David Malcolm wrote: > > > > On Thu, 2019-05-16 at 18:40 -0600, Martin Sebor wrote

Re: [PATCH][jit] Add thread-local globals to the libgccjit frontend

2019-01-08 Thread David Malcolm
On Tue, 2019-01-08 at 14:31 +0100, Marc Nieper-Wißkirchen wrote: > Dear David, > > thank you very much for your timely response and for talking a > thorough > look at my proposed patch. > > Am 07.01.19 um 21:34 schrieb David Malcolm: > > > Have you done the le

[PATCH] tree-ssa-loop-unswitch.c: port to the dump_* API (PR tree-optimization/88763)

2019-01-09 Thread David Malcolm
PR tree-optimization/88763 reports difficulties in getting useful information from the log of tree-ssa-loop-unswitch.c. As work towards improving this, this patch eliminates all uses of dump_file from that source file, in favor of the dump API (to support -fopt-info* and -fsave-optimization-record

[PATCH] Fix ICE on class-template argument deduction (PR c++/88795)

2019-01-15 Thread David Malcolm
PR c++/88795 reports an ICE building a function_type for a deduction guide when the substitution into the function signature fails, due to an error_mark_node being returned from tsubst_arg_types but not being checked for. This error_mark_node gets used as the TYPE_ARG_TYPES, leading to ICEs in var

[PATCH] Fix ICE due to "combine" creating unreachable EH blocks (PR target/88861)

2019-01-16 Thread David Malcolm
PR target/88861 reports an ICE in "ce2" due to an unreachable basic block. The block becomes unreachable in "combine" when delete_noop_moves deletes an insn with a REG_EH_REGION, deleting the EH edge, the only edge leading to the basic block. Normally, rest_of_handle_combine would call cleanup_cf

[PATCH] C++: Fix ICE when adding overloaded operator via using_decl (PR c++/88699)

2019-01-16 Thread David Malcolm
PR c++/88699 reports an ICE within this assertion in add_method: gcc_assert (!current_fns || !DECL_DESTRUCTOR_P (method)); when adding an overloaded operator to a class via a using_decl, due to DECL_DESTRUCTOR_P requiring a FUNCTION_DECL, but "method" being a USING_DECL. This patch weakens the

[PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-18 Thread David Malcolm
PR rtl-optimization/88423 reports an ICE within sched-ebb.c's begin_move_insn, failing the assertion at line 175, where there's no fall-through edge: 171 rtx_insn *x = NEXT_INSN (insn); 172 if (e) 173 gcc_checking_assert (NOTE_P (x) || LABEL_P (x)); 174 else 175

Re: [PATCH] sched-ebb.c: avoid moving table jumps (PR rtl-optimization/88423)

2019-01-18 Thread David Malcolm
On Fri, 2019-01-18 at 12:32 -0500, David Malcolm wrote: [CCing Abel] > PR rtl-optimization/88423 reports an ICE within sched-ebb.c's > begin_move_insn, failing the assertion at line 175, where there's > no fall-through edge: > > 171 rtx_insn *x = NEXT_INSN (i

Re: [PATCH][gcc] libgccjit: introduce gcc_jit_context_add_driver_option

2019-01-18 Thread David Malcolm
On Fri, 2019-01-18 at 19:25 +, Andrea Corallo wrote: > Hi all, > this patch add gcc_jit_context_add_driver_option to the libgccjit ABI > and a testcase for it. > > Using this interface is now possible to pass options affecting > assembler and linker. > > Does not introduce any new regression

[PATCH] Provide suggestions for unrecognized -dump options (PR driver/88911)

2019-01-22 Thread David Malcolm
PR driver/88911 reports an issue where the user couldn't remember the spelling of the "-dumpspecs" option, and attempted various similar spellings, but many of them failed to contain a suggestion of the correct spelling: $ gcc q.c -dump-spec cc1: warning: unrecognized gcc debugging option: u

[PATCH] Update assertion in sched-ebb.c to cope with table jumps

2019-01-23 Thread David Malcolm
On Wed, 2019-01-23 at 16:52 +0300, Alexander Monakov wrote: > On Wed, 23 Jan 2019, Andrey Belevantsev wrote: > > > For that, I'm not sure. Your patch will leave the tablejump > > unscheduled at > > all, i.e. any fields like INSN_TICK would be unfilled and thus the > > later > > passes like bundli

[PATCH] aarch64: fix use-after-free in -march=native (PR driver/89014)

2019-01-23 Thread David Malcolm
Running: $ valgrind ./xgcc -B. -c test.c -march=native on aarch64 shows a use-after-free in host_detect_local_cpu due to the std::string result of aarch64_get_extension_string_for_isa_flags only living until immediately after a c_str call. This leads to corrupt "-march=" values being passed to c

[PATCH] C++ concepts: fix ICE with requires on dtors (PR c++/89036)

2019-01-25 Thread David Malcolm
PR c++/89036 reports an ICE due to this assertion failing 1136 /* A class should never have more than one destructor. */ 1137 gcc_assert (!current_fns || via_using || !DECL_DESTRUCTOR_P (method)); on this template with a pair of dtors, with mutually exclusive "requires" clauses: templ

[PATCH v2] C++ concepts: fix ICE with requires on dtors (PR c++/89036)

2019-01-25 Thread David Malcolm
On Fri, 2019-01-25 at 08:59 -0800, Nathan Sidwell wrote: > On 1/25/19 8:48 AM, David Malcolm wrote: > > PR c++/89036 reports an ICE due to this assertion failing > > > > 1136 /* A class should never have more than one > > destructor. */ > > 1137

[PATCH] Fix bogus fix-it for FLT_MAX (PR c/89122)

2019-01-30 Thread David Malcolm
PR c/89122 reports that we emit a bogus fix-it hint for the case where the code uses FLT_MAX, but has included rather than : x.c:3:11: error: 'FLT_MAX' undeclared here (not in a function); did you mean 'INT_MAX'? 3 | float f = FLT_MAX; | ^~~ | INT_MAX Th

Re: [PATCH] Fix bogus fix-it for FLT_MAX (PR c/89122)

2019-01-31 Thread David Malcolm
On Thu, 2019-01-31 at 10:35 +0100, Richard Biener wrote: > On Thu, Jan 31, 2019 at 12:09 AM David Malcolm > wrote: > > > > PR c/89122 reports that we emit a bogus fix-it hint for the case > > where > > the code uses FLT_MAX, but has included rather than > >

Late-breaking jit features (was Re: [PATCH][gcc] libgccjit: introduce gcc_jit_context_add_driver_option)

2019-02-01 Thread David Malcolm
On Mon, 2019-01-21 at 08:40 +, Andrea Corallo wrote: > Hi all, > Second version of the patch addressing David's comment about all-non- > failing-tests.h > > Adds gcc_jit_context_add_driver_option to the libgccjit ABI and a > testcase for it. > > Using this interface is now possible to pass op

Re: Late-breaking jit features (was Re: [PATCH][gcc] libgccjit: introduce gcc_jit_context_add_driver_option)

2019-02-02 Thread David Malcolm
On Sat, 2019-02-02 at 08:26 +0100, Richard Biener wrote: > On February 1, 2019 10:11:12 PM GMT+01:00, David Malcolm dhat.com> wrote: > > On Mon, 2019-01-21 at 08:40 +, Andrea Corallo wrote: > > > Hi all, > > > Second version of the patch addressing David&

[PATCH] Fix valgrind error in "has_include" (PR preprocessor/88937)

2019-02-04 Thread David Malcolm
PR preprocessor/88937 reports a valgrind error: "Conditional jump or move depends on uninitialised value(s)" when compiling: #if __has_include("x") #endif The issue is in parse_has_include, which has: 2211if (token->type == CPP_STRING || token->type == CPP_HEADER_NAME) 2212 {

Re: Late-breaking jit features (was Re: [PATCH][gcc] libgccjit: introduce gcc_jit_context_add_driver_option)

2019-02-05 Thread David Malcolm
On Sat, 2019-02-02 at 16:34 +0100, Jakub Jelinek wrote: > On Sat, Feb 02, 2019 at 10:18:43AM -0500, David Malcolm wrote: > > > > Alternatively, should these patches go into a branch of queued > > > > jit > > > > changes for gcc 10? > > > > &

Re: Late-breaking jit features (was Re: [PATCH][gcc] libgccjit: introduce gcc_jit_context_add_driver_option)

2019-02-05 Thread David Malcolm
On Tue, 2019-02-05 at 21:40 +, Andrea Corallo wrote: > David Malcolm writes: > > > On Sat, 2019-02-02 at 16:34 +0100, Jakub Jelinek wrote: > > > On Sat, Feb 02, 2019 at 10:18:43AM -0500, David Malcolm wrote: > > > > > > Alternatively, s

[committed] Fix locations in conversion_null_warnings (PR c++/71302)

2019-02-06 Thread David Malcolm
PR c++/71302 reports that g++ shows poor locations for -Wzero-as-null-pointer-constant for pointers in function calls, using the close parenthesis of the call, rather than showing the pertinent argument. This particular case was fixed in GCC 8, but regressed on trunk in r260973. This patch fixes

[PATCH] Fix excess warnings from -Wtype-limits with location wrappers (PR c++/88680)

2019-02-06 Thread David Malcolm
PR c++/88680 reports excess warnings from -Wtype-limits after the C++ FE's use of location wrappers was extended in r267272 for cases such as: const unsigned n = 8; static_assert (n >= 0 && n % 2 == 0, ""); t.C:3:18: warning: comparison of unsigned expression >= 0 is always true [-Wtype-lim

[PATCH] Fix more ICEs in -fsave-optimization-record (PR tree-optimization/89235)

2019-02-07 Thread David Malcolm
PR tree-optimization/89235 reports an ICE inside -fsave-optimization-record whilst reporting the inlining chain of of the location_t in the vect_location global. This is very similar to PR tree-optimization/86637, fixed in r266821. The issue is that the inlining chains are read from the location_

PING Re: [PATCH v2] C++ concepts: fix ICE with requires on dtors (PR c++/89036)

2019-02-08 Thread David Malcolm
Ping On Fri, 2019-01-25 at 15:02 -0500, David Malcolm wrote: > On Fri, 2019-01-25 at 08:59 -0800, Nathan Sidwell wrote: > > On 1/25/19 8:48 AM, David Malcolm wrote: > > > PR c++/89036 reports an ICE due to this assertion failing > > > > > > 1136/* A c

[committed] linemap_line_start: protect against location_t overflow (PR lto/88147)

2019-02-11 Thread David Malcolm
ks to Martin) is to check for overflow when determining whether to reuse an existing map, and to not reuse it if it would occur. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Committed to trunk as r268789. gcc/ChangeLog: David Malcolm PR lto/8814

PING^2 Re: [PATCH v2] C++ concepts: fix ICE with requires on dtors (PR c++/89036)

2019-02-13 Thread David Malcolm
Ping On Fri, 2019-02-08 at 12:03 -0500, David Malcolm wrote: > Ping > > On Fri, 2019-01-25 at 15:02 -0500, David Malcolm wrote: > > On Fri, 2019-01-25 at 08:59 -0800, Nathan Sidwell wrote: > > > On 1/25/19 8:48 AM, David Malcolm wrote: > > > > PR c++/89036

PING Re: [PATCH] Fix excess warnings from -Wtype-limits with location wrappers (PR c++/88680)

2019-02-13 Thread David Malcolm
Ping: https://gcc.gnu.org/ml/gcc-patches/2019-02/msg00363.html On Wed, 2019-02-06 at 21:23 -0500, David Malcolm wrote: > PR c++/88680 reports excess warnings from -Wtype-limits after the C++ > FE's use of location wrappers was extended in r267272 for cases such > as: > >

Re: [PATCH] Fix up and improve allow_blank_lines testsuite handling (PR other/69006, PR testsuite/88920, take 2)

2019-02-13 Thread David Malcolm
On Wed, 2019-02-13 at 20:08 +0100, Iain Buclaw wrote: > On Wed, 13 Feb 2019 at 14:37, Jakub Jelinek wrote: > > > > On Wed, Feb 13, 2019 at 10:22:14AM +, Andrew Stubbs wrote: > > > On 13/02/2019 09:09, Jakub Jelinek wrote: > > > > To make it work together with doing llvm_binutils only once, >

Re: [PATCH] Fix excess warnings from -Wtype-limits with location wrappers (PR c++/88680)

2019-02-14 Thread David Malcolm
On Thu, 2019-02-14 at 10:38 -0500, Jason Merrill wrote: > On 2/6/19 9:23 PM, David Malcolm wrote: > > PR c++/88680 reports excess warnings from -Wtype-limits after the > > C++ > > FE's use of location wrappers was extended in r267272 for cases > > such as:

[PATCH] v2: Fix excess warnings from -Wtype-limits with location wrappers (PR c++/88680)

2019-02-14 Thread David Malcolm
On Thu, 2019-02-14 at 17:32 +0100, Jakub Jelinek wrote: > On Thu, Feb 14, 2019 at 11:26:15AM -0500, David Malcolm wrote: > > There's an asymmetry in the warning; it's looking for a comparison > > of a > > LHS expression against an RHS constant 0, spelled as "0&q

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

2019-02-14 Thread David Malcolm
gcc/cp/ChangeLog: Backport of r259720 from trunk. 2018-04-27 David Malcolm PR c++/85515 * name-lookup.c (consider_binding_level): Skip compiler-generated variables. * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Flatten nested

[PATCH 4/7] docs: fix stray duplicated words

2019-02-14 Thread David Malcolm
gcc/ChangeLog: Backport of 263295 from trunk. 2018-08-03 David Malcolm * doc/gcov.texi (-x): Remove duplicate "to". * doc/invoke.texi (-Wnoexcept-type): Remove duplicate "calls". (-Wif-not-aligned): Remove duplicate "is&

Backport of various patches to gcc 8

2019-02-14 Thread David Malcolm
o_rtl" r267957: "Fix ICE on class-template argument deduction (PR c++/88795)" r268847: "C++ concepts: fix ICE with requires on dtors (PR c++/89036)" Are these OK for gcc-8-branch? Thanks Dave David Malcolm (7): Don't offer suggestions for compiler-generated va

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

2019-02-14 Thread David Malcolm
t when considering which names to suggest. gcc/cp/ChangeLog: Backport of r262199 from trunk. 2018-06-27 David Malcolm PR c++/86329 * name-lookup.c (consider_binding_level): Filter out names that match anon_aggrname_p. gcc/testsuite/ChangeLog: Backpor

[PATCH 7/7] C++ concepts: fix ICE with requires on dtors (PR c++/89036)

2019-02-14 Thread David Malcolm
assertion. gcc/cp/ChangeLog: 2019-02-13 David Malcolm Backport of r268847 from trunk. PR c++/89036 * class.c (add_method): Drop destructor assertion. gcc/testsuite/ChangeLog: 2019-02-13 David Malcolm Backport of r268847 from trunk. PR c++

[PATCH 6/7] Fix ICE on class-template argument deduction (PR c++/88795)

2019-02-14 Thread David Malcolm
from trunk. 2019-01-15 David Malcolm PR c++/88795 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types fails. gcc/testsuite/ChangeLog: Backport of r267957 from trunk. 2019-01-15 David Malcolm PR c++/88795 * g++.dg/template

[PATCH 3/7] Fix memory leak of pretty_printer prefixes

2019-02-14 Thread David Malcolm
inter "owns" the prefix if it's non-NULL, freeing it in the dtor and in pp_set_prefix. gcc/cp/ChangeLog: Backport of r263275 from trunk. 2018-08-02 David Malcolm * error.c (cxx_print_error_function): Duplicate "file" before passing it

[PATCH 5/7] Fix memory leak in selftest::test_expansion_to_rtl

2019-02-14 Thread David Malcolm
ed char, crtl->emit.regno_pointer_align_length); This patch fixes this leak (and makes the output of "make selftest-valgrind" clean) by calling free_after_compilation at the end of the selftest in question. gcc/ChangeLog: Backport of r263339 from trunk. 2018-08-06 David Malcolm *

Re: [PATCH][DOC] Document new features for GCC 9.

2019-02-14 Thread David Malcolm
On Thu, 2019-02-14 at 14:19 -0700, Martin Sebor wrote: > On 2/13/19 6:48 AM, Martin Liška wrote: > > Hi. > > > > I'm sending patch where I document changes I made during GCC 9 > > development. I would appreciate both language and factical comments > > about the patch. > > Nothing technical, just

[PATCH 1/4] selftest.h: Add ASSERT_TRUE_AT and ASSERT_FALSE_AT

2016-08-03 Thread David Malcolm
I split out the selftest.h changes from v2 of the kit for ease of review; here they are. Successfully bootstrapped®rtested in conjunction with the rest of the patch kit on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * selftest.h (ASSERT_TRUE): Reimplement in terms of... (AS

[PATCH 4/4] c-format.c: suggest the correct format string to use (PR c/64955)

2016-08-03 Thread David Malcolm
This adds fix-it hints to c-format.c so that it can (sometimes) suggest the format string the user should have used. The patch adds selftests for the new code in c-format.c. These selftests are thus lang-specific. This is the first time we've had lang-specific selftests, and hence the patch also

[PATCH 3/4] Use class substring_loc in c-format.c (PR c/52952)

2016-08-03 Thread David Malcolm
This patch updates c-format.c to use the new class substring_loc, added in the previous patch, replacing location_column_from_byte_offset. Hence with this patch, Wformat can underline the precise erroneous format string in many more cases. The patch also introduces two new functions for emitting W

[PATCH 2/4] (v3) On-demand locations within string-literals

2016-08-03 Thread David Malcolm
Changes in v3: - Avoid including cpplib.h from input.h - Properly handle stringified macro arguments (with tests for this) - Minor whitespace fixes - Move selftest.h changes to a separate patch Changes in v2: - Tweaks to substring location selftests - Many more selftests (EBCDIC, the various wide

Re: [PATCH] Teach VRP to truncate the case ranges of a switch

2016-08-03 Thread David Malcolm
On Wed, 2016-08-03 at 15:47 +0200, Richard Biener wrote: > On Wed, Aug 3, 2016 at 6:00 AM, Patrick Palka > wrote: > > VRP currently has functionality to eliminate case labels that lie > > completely outside of the switch operand's value range. This patch > > complements this functionality by teac

Re: [PATCH 1/3] (v2) On-demand locations within string-literals

2016-08-04 Thread David Malcolm
On Wed, 2016-08-03 at 09:59 -0600, Jeff Law wrote: > On 07/29/2016 03:42 PM, Joseph Myers wrote: > > On Tue, 26 Jul 2016, David Malcolm wrote: > > > > > This patch implements precise tracking of source locations for > > > the > > > individual chars

Re: [PING] Use correct location information for OpenACC shape and simple clauses in C/C++

2016-08-04 Thread David Malcolm
On Thu, 2016-08-04 at 16:54 +0200, Thomas Schwinge wrote: > Hi! > > On Wed, 27 Jul 2016 17:09:38 -0400, David Malcolm < > dmalc...@redhat.com> wrote: > > On Wed, 2016-07-27 at 17:17 +0200, Thomas Schwinge wrote: > > > I found that for a lot of OpenACC (and poten

Re: [PATCH 1/4] selftest.h: Add ASSERT_TRUE_AT and ASSERT_FALSE_AT

2016-08-04 Thread David Malcolm
On Wed, 2016-08-03 at 10:06 -0600, Jeff Law wrote: > On 08/03/2016 09:45 AM, David Malcolm wrote: > > I split out the selftest.h changes from v2 of the kit for ease of > > review; > > here they are. > > > > Successfully bootstrapped®rtested in conjunction with the

Re: [PATCH 2/4] (v3) On-demand locations within string-literals

2016-08-04 Thread David Malcolm
On Thu, 2016-08-04 at 11:37 -0600, Jeff Law wrote: > On 08/03/2016 09:45 AM, David Malcolm wrote: > > Changes in v3: > > - Avoid including cpplib.h from input.h > > - Properly handle stringified macro arguments (with tests for this) > > - Minor whitespace fixes > &g

Re: [PATCH 3/4] Use class substring_loc in c-format.c (PR c/52952)

2016-08-04 Thread David Malcolm
On Thu, 2016-08-04 at 12:08 -0600, Jeff Law wrote: > On 08/03/2016 09:45 AM, David Malcolm wrote: > > This patch updates c-format.c to use the new class substring_loc, > > added > > in the previous patch, replacing location_column_from_byte_offset. > > Hence with this p

Re: [PATCH 4/4] c-format.c: suggest the correct format string to use (PR c/64955)

2016-08-04 Thread David Malcolm
On Thu, 2016-08-04 at 13:55 -0600, Jeff Law wrote: > On 08/03/2016 09:45 AM, David Malcolm wrote: > > This adds fix-it hints to c-format.c so that it can (sometimes) > > suggest > > the format string the user should have used. > > > > The patch adds selftes

[PATCH] c-format.c: cleanup of check_format_info_main

2016-08-05 Thread David Malcolm
On Thu, 2016-08-04 at 14:22 -0600, Jeff Law wrote: > On 08/04/2016 01:24 PM, David Malcolm wrote: > > > > Do you realize that this isn't used for ~700 lines after this > > > point? > > > Is > > > there any sensible way to factor some code here

[committed] Fix crash in selftest::test_lexer_string_locations_ucn4 (PR bootstrap/72823)

2016-08-06 Thread David Malcolm
On Sat, 2016-08-06 at 11:29 +0530, Prathamesh Kulkarni wrote: > On 6 August 2016 at 11:16, Markus Trippelsdorf < > mar...@trippelsdorf.de> wrote: > > On 2016.08.05 at 14:16 -0400, David Malcolm wrote: > > > Successfully bootstrapped®rtested the updated patch on x86_64

Re: [RFC] ipa bitwise constant propagation

2016-08-08 Thread David Malcolm
On Mon, 2016-08-08 at 16:03 +0200, Martin Jambor wrote: > Hi, > > thanks for following through. You'll need an approval from Honza, > but > I think the code looks good (I have looked at the places that I > believe have changed since the last week). However, I have > discovered > one new thing I

Re: [PATCH 3/4] Use class substring_loc in c-format.c (PR c/52952)

2016-08-08 Thread David Malcolm
On Thu, 2016-08-04 at 12:08 -0600, Jeff Law wrote: > On 08/03/2016 09:45 AM, David Malcolm wrote: > > This patch updates c-format.c to use the new class substring_loc, > > added > > in the previous patch, replacing location_column_from_byte_offset. > > Hence with this p

[committed] Fix selftest::test_lexer_string_locations_ebcdic for systems without iconv (PR bootstrap/72844)

2016-08-08 Thread David Malcolm
selftest::test_lexer_string_locations_ebcdic has this clause: /* EBCDIC support requires iconv. */ if (!HAVE_ICONV) return; leading to a build failure on systems without iconv. This conditional works in libcpp due to this in libcpp/internal.h: #if HAVE_ICONV #include #else #de

[PATCH] toplev.c: set FILE * globals to NULL after fclose

2016-08-09 Thread David Malcolm
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * toplev.c (finalize): Set aux_info_file, asm_out_file, and stack_usage_file to NULL after fclose calls. --- gcc/toplev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH] Add selftests to selftest.c

2016-08-09 Thread David Malcolm
This patch adds some initial selftesting of selftest.c/h itself. This may seem like overdoing it, but I have some followup patches that add non-trivial logic to selftest.c, which we should verify, so it makes sense to test the existing functionality and then build on that. Successfully bootstrappe

[PATCH] Move class temp_source_file from input.c to selftest.c/h

2016-08-09 Thread David Malcolm
I have followup patches that use this class in selftests in various places, so this patch moves it to selftest.h. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * input.c (class selftest::temp_source_file): Move to selftest.h. (self

Re: [PATCH][RFC] Add the ability to record sub-timevars (-ftime-report-details)

2016-08-10 Thread David Malcolm
On Wed, 2016-08-10 at 14:04 +0200, Richard Biener wrote: > The following patch adds the ability to record time spent in utility > to the pass using it. For things like CFG cleanup, alias stmt > walking > or DF infrastructure work it is currently not visible which pass is > responsible for the time

[PATCH] Fix caret locations in format_type_warning (PR c/72857)

2016-08-10 Thread David Malcolm
In r239253 I introduced a bug in c-format.c:format_type_warning. In that patch I removed these lines from format_type_warning: - unsigned int offset_loc = type->offset_loc; [...snip...] - loc = location_from_offset (loc, offset_loc); which used the location from type->offset_loc. Instead, I e

[PATCH] RFC: -fasm-show-source

2016-08-11 Thread David Malcolm
I sometimes find myself scouring assembler output from the compiler and trying to figure out which instructions correspond to which lines of source code; I believe this is a common activity for some end-users. The following patch adds a new -fasm-show-source option, which emits comments into the g

[PATCH] Add source information to -fverbose-asm

2016-08-12 Thread David Malcolm
On Thu, 2016-08-11 at 20:00 -0600, Sandra Loosemore wrote: > On 08/11/2016 02:34 PM, David Malcolm wrote: > > I sometimes find myself scouring assembler output from the compiler > > and trying to figure out which instructions correspond to which > > lines of source code; I bel

Re: [PATCH] RFC: -fasm-show-source

2016-08-12 Thread David Malcolm
On Fri, 2016-08-12 at 11:00 +0530, Prathamesh Kulkarni wrote: > On 12 August 2016 at 02:04, David Malcolm > wrote: > > I sometimes find myself scouring assembler output from the compiler > > and trying to figure out which instructions correspond to which > > lines of sou

[PATCH] Fix suggestions for non-trivial Wformat type cases (PR c/72858)

2016-08-12 Thread David Malcolm
In r239260 I attempted to add fix-it hints for -Wformat type warnings. Unfortunately, my implementation was too simplistic, and only worked correctly for the most simple format strings: the fix-it hint would suggest replacement of an entire conversion specification, but the replacement would only

Re: [PATCH] Fix caret locations in format_type_warning (PR c/72857)

2016-08-17 Thread David Malcolm
hout warnings with both plain and --enable-checking=release configurations; bootstrapping it now) DaveFrom 397d1bed2f014416f0c287b7872d025fb8003705 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 17 Aug 2016 10:13:20 -0400 Subject: [PATCH] input.c: move test functions within #CHECKING_P an

Re: [PATCH] Fix caret locations in format_type_warning (PR c/72857)

2016-08-17 Thread David Malcolm
On Wed, 2016-08-17 at 09:51 -0400, David Malcolm wrote: > On Wed, 2016-08-17 at 10:12 +0200, Andreas Schwab wrote: > > ../../gcc/input.c:1470:1: error: 'const char* > > get_source_range_for_char(cpp_reader*, string_concat_db*, > > location_t, > > cpp_ttype, int,

[committed] Evict selftest tempfiles from the diagnostics file cache

2016-08-18 Thread David Malcolm
Selftests can use class selftest::temp_source_file to write out files for testing input-handling, and the files are unlinked in the dtor. This leads to stale entries in input.c's cache of file content, which could lead to errors if a temporary filename gets reused during a run of the selftests. W

[PATCH] Spelling suggestions for misspelled preprocessor directives

2016-08-18 Thread David Malcolm
This patch allows the preprocessor to offer suggestions for misspelled directives, taking us from e.g.: test.c:5:2: error: invalid preprocessing directive #endfi #endfi ^ to: test.c:5:2: error: invalid preprocessing directive #endfi; did you mean #endif? #endfi ^ endif I can sel

[committed] selftest.h: add class line_table_test

2016-08-18 Thread David Malcolm
input.c has a fixture class for running each selftest with a fresh line_table, and logic for looping over various interesting line_table test cases. This patch exposes the above in selftest.h so that such location-handling tests can be written in other files, renaming the class from temp_line_tabl

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-18 Thread David Malcolm
On Thu, 2016-08-18 at 15:50 +0200, Marek Polacek wrote: > Now that all various switch fallthrough bugfixes and adjustments were > committed, and this patch has shrunk considerably, I'm presenting the > latest > version. The changes from the last version are not huge; we don't > warn for a > fall t

[committed] Allow calling diagnostic_show_locus without a diagnostic_info

2016-08-18 Thread David Malcolm
Much of diagnostic-show-locus.c currently expects a diagnostic_info *, but it only uses the rich_location and the diagnostic_t. Change the signature of diagnostic_show_locus from: void diagnostic_show_locus (diagnostic_context *, const diagnostic_info *); to: void

Re: [libcpp] append "evaluates to 0" for Wundef diagnostic

2016-08-19 Thread David Malcolm
On Fri, 2016-08-19 at 14:15 +0530, Prathamesh Kulkarni wrote: > Hi David, > This trivial patch appends "evaluates to 0", in Wundef diagnostic, > similar to clang, which prints the following diagnostic for undefined > macro: > undef.c:1:5: warning: 'FOO' is not defined, evaluates to 0 [-Wundef] > #i

Re: Implement C _FloatN, _FloatNx types [version 6]

2016-08-19 Thread David Malcolm
On Fri, 2016-08-19 at 14:40 +, Joseph Myers wrote: > On Fri, 19 Aug 2016, Richard Biener wrote: > > > > > Can you quickly verify if LTO works with the new types? I > > > > don't see anything > > > > that would prevent it but having new global trees and backends > > > > initializing them > > >

Re: Implement C _FloatN, _FloatNx types [version 6]

2016-08-19 Thread David Malcolm
On Fri, 2016-08-19 at 16:51 +, Joseph Myers wrote: > On Fri, 19 Aug 2016, David Malcolm wrote: > > > Please could you take this opportunity to add some examples to the > > header comment for that function, both for the common cases e.g. > > "f", > >

[committed] Reimplement removal fix-it hints in terms of replace

2016-08-19 Thread David Malcolm
This patch eliminates class fixit_remove, reimplementing rich_location::add_fixit_remove in terms of replacement with the empty string. Deleting the removal subclass simplifies fixit-handling code, as we only have two concrete fixit_hint subclasses to deal with, rather than three. The patch also

[PATCH] selftest.h: add ASSERT_STR_CONTAINS

2016-08-19 Thread David Malcolm
More enabling work for some new selftests I'm working on. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * selftest.c (selftest::assert_str_contains): New function. (selftest::test_assertions): Verify ASSERT_STR_CONTAINS. * selftest

Re: [PATCH] Restrict jump threading statement simplifier to scalar types (PR71077)

2016-08-19 Thread David Malcolm
On Fri, 2016-08-19 at 19:25 -0400, Patrick Palka wrote: > On Fri, 19 Aug 2016, Yuri Rumyantsev wrote: > > > Hi, > > > > Here is a simple test-case to reproduce 176.gcc failure (I run it > > on > > Haswell machine). > > Using 20160819 compiler build we get: > > gcc -O3 -m32 -mavx2 test.c -o test.r

Re: [patch] [gsoc] [gimplefe] GIMPLE FE Project

2016-08-22 Thread David Malcolm
On Tue, 2016-08-23 at 00:10 +0530, Prasad Ghangal wrote: > On 22 August 2016 at 16:55, Trevor Saunders > wrote: > > On Sun, Aug 21, 2016 at 10:35:17PM +0530, Prasad Ghangal wrote: [...] > > @@ -228,6 +228,12 @@ struct GTY(()) function { > >/* GIMPLE body for this function. */ > >gimple_

Re: [PATCH] RFC: On-demand locations within string-literals

2016-08-23 Thread David Malcolm
On Mon, 2016-08-22 at 21:25 -0600, Martin Sebor wrote: > > > Beyond that, the range normally works fine, except when macros > > > are involved like they are in my tests. You can see the effect > > > in the range.out file. (This works without your patch but it > > > could very well be because I di

Re: [Java,wwwdocs] java/news.html -- remove broken link

2016-08-23 Thread David Malcolm
On Tue, 2016-08-23 at 13:43 +0200, Gerald Pfeifer wrote: > I could not find a replacement link, and in any case, isn't the plan > still to remove the Java frontend before the GCC 7 release? > > Applied. > FWIW I found the article inside a PDF at: https://www.redhat.com/en/files/resources/rh-ma

[committed] line-map.h: add source_range::from_locations

2016-08-23 Thread David Malcolm
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. Committed to trunk as r239711. libcpp/ChangeLog: * include/line-map.h (source_range::from_locations): New method. --- libcpp/include/line-map.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libcpp/include/line-ma

<    21   22   23   24   25   26   27   28   29   30   >