[PATCH, libstdc++] More

2019-11-15 Thread Ed Smith-Rowland via gcc-patches
First of all, the redo of the iterator portion in response to https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01467.html passed testing. This patch contains constexpr char_traits. I also found an old extension that had been left out of the constexpr bandwagon that I caught up. This patch also

Re: Symver attribute

2019-11-15 Thread Martin Sebor
On 11/15/19 9:04 AM, Jan Hubicka wrote: Hi, thanks for feedback. Here is updated patch that incorporates Martin's changes, formatting corrections and makes symvers of aliases work. Just a couple of questions and a few minor nits, mostly having to do with my favorite subject of quoting things in

[PATCH 43/49] analyzer: new file: exploded-graph.h

2019-11-15 Thread David Malcolm
This patch adds exploded_graph and related classes, for managing exploring paths through the user's code as a directed graph of pairs. gcc/ChangeLog: * analyzer/exploded-graph.h: New file. --- gcc/analyzer/exploded-graph.h | 754 ++ 1 file changed,

[PATCH 45/49] analyzer: new files: engine.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds the core analysis code, which explores "interesting" interprocedual paths in the code, updating state machines to check for API misuses, and issuing diagnostics for such misuses. gcc/ChangeLog: * analyzer/engine.cc: New file. * analyzer/engine.h: New file. --- gcc/

[PATCH 47/49] analyzer: new files: diagnostic-manager.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds diagnostic_manager and related support classes for saving, deduplicating, and emitting analyzer diagnostics. gcc/ChangeLog: * analyzer/diagnostic-manager.cc: New file. * analyzer/diagnostic-manager.h: New file. --- gcc/analyzer/diagnostic-manager.cc | 1117

[PATCH 46/49] analyzer: new files: checker-path.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds a family of classes for representing paths of events for analyzer diagnostics. gcc/ChangeLog: * analyzer/checker-path.cc: New file. * analyzer/checker-path.h: New file. --- gcc/analyzer/checker-path.cc | 899 +++ gcc/analyzer

[PATCH 48/49] gdbinit.in: add break-on-saved-diagnostic

2019-11-15 Thread David Malcolm
This patch adds a "break-on-saved-diagnostic" command to gdbinit.in, useful for debugging when a diagnostic is queued by the analyzer. gcc/ChangeLog: * gdbinit.in (break-on-saved-diagnostic): New command. --- gcc/gdbinit.in | 10 ++ 1 file changed, 10 insertions(+) diff --git a/g

[PATCH 39/49] analyzer: new files: analysis-plan.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds an analysis_plan class, which encapsulate decisions about how the analysis should happen (e.g. the order in which functions should be traversed). gcc/ChangeLog: * analyzer/analysis-plan.cc: New file. * analyzer/analysis-plan.h: New file. --- gcc/analyzer/analysis-p

[PATCH 41/49] analyzer: new files: program-point.{cc|h}

2019-11-15 Thread David Malcolm
This patch introduces function_point and program_point, classes for tracking locations within the program (the latter adding a call_string for tracking interprocedural location). gcc/ChangeLog: * analyzer/program-point.cc: New file. * analyzer/program-point.h: New file. --- gcc/an

[PATCH 44/49] analyzer: new files: state-purge.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds classes for tracking what state can be safely purged at any given point in the program. gcc/ChangeLog: * analyzer/state-purge.cc: New file. * analyzer/state-purge.h: New file. --- gcc/analyzer/state-purge.cc | 516 gcc/a

[PATCH 42/49] analyzer: new files: program-state.{cc|h}

2019-11-15 Thread David Malcolm
This patch introduces classes for tracking the state at a particular path of analysis. gcc/ChangeLog: * analyzer/program-state.cc: New file. * analyzer/program-state.h: New file. --- gcc/analyzer/program-state.cc | 1284 + gcc/analyzer/progr

[PATCH 40/49] analyzer: new files: call-string.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds call_string, a class for representing the call stacks at a program_point, so that we can ensure that paths through the code are interprocedurally valid. gcc/ChangeLog: * analyzer/call-string.cc: New file. * analyzer/call-string.h: New file. --- gcc/analyzer/call-st

[PATCH 37/49] analyzer: new file: sm-sensitive.cc

2019-11-15 Thread David Malcolm
This patch adds a state machine checker for tracking exposure of sensitive data (e.g. writing passwords to log files). This checker isn't ready for production, and is presented as a proof-of-concept of the sm-based approach. gcc/ChangeLog: * analyzer/sm-sensitive.cc: New file. --- gcc/an

[PATCH 38/49] analyzer: new file: sm-taint.cc

2019-11-15 Thread David Malcolm
This patch adds a state machine checker for tracking "taint", where data potentially under an attacker's control is used for things like array indices without sanitization (CWE-129). This checker isn't ready for production, and is presented as a proof-of-concept of the sm-based approach. gcc/Chan

[PATCH 36/49] analyzer: new file: sm-pattern-test.cc

2019-11-15 Thread David Malcolm
This patch adds a custom state machine checker intended purely for DejaGnu testing of the sm "machinery". gcc/ChangeLog: * analyzer/sm-pattern-test.cc: New file. --- gcc/analyzer/sm-pattern-test.cc | 165 1 file changed, 165 insertions(+) create m

[PATCH 34/49] analyzer: new file: sm-malloc.cc

2019-11-15 Thread David Malcolm
This patch adds a state machine checker for malloc/free. gcc/ChangeLog: * analyzer/sm-malloc.cc: New file. --- gcc/analyzer/sm-malloc.cc | 799 ++ 1 file changed, 799 insertions(+) create mode 100644 gcc/analyzer/sm-malloc.cc diff --git a/gcc/

[PATCH 33/49] analyzer: new files: sm.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds a "state_machine" base class for describing API checkers in terms of state machine transitions. Followup patches use this to add specific API checkers. gcc/ChangeLog: * analyzer/sm.cc: New file. * analyzer/sm.h: New file. --- gcc/analyzer/sm.cc | 135 +

[PATCH 30/49] analyzer: new files: constraint-manager.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds classes for tracking the equivalence classes and constraints that hold at a point on an execution path. gcc/ChangeLog: * analyzer/constraint-manager.cc: New file. * analyzer/constraint-manager.h: New file. --- gcc/analyzer/constraint-manager.cc | 2263 +

[PATCH 32/49] analyzer: new files: pending-diagnostic.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds classes used by the analyzer for handling its diagnostics (queueing them, deduplicating them, precision-of-wording hooks). gcc/ChangeLog: * analyzer/pending-diagnostic.cc: New file. * analyzer/pending-diagnostic.h: New file. --- gcc/analyzer/pending-diagnostic.cc |

[PATCH 35/49] analyzer: new file: sm-file.cc

2019-11-15 Thread David Malcolm
This patch adds a state machine checker for stdio's FILE stream API. gcc/ChangeLog: * analyzer/sm-file.cc: New file. --- gcc/analyzer/sm-file.cc | 338 1 file changed, 338 insertions(+) create mode 100644 gcc/analyzer/sm-file.cc diff --gi

[PATCH 28/49] analyzer: new files: analyzer.{cc|h}

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * analyzer/analyzer.cc: New file. * analyzer/analyzer.h: New file. --- gcc/analyzer/analyzer.cc | 125 ++ gcc/analyzer/analyzer.h | 126 +++ 2 files changed, 251 insertions(+) c

[PATCH 27/49] analyzer: new files: supergraph.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds a "supergraph" class that combines CFGs and callgraph into one directed graph, along with "supernode" and "superedge" classes. gcc/ChangeLog: * analyzer/supergraph.cc: New file. * analyzer/supergraph.h: New file. --- gcc/analyzer/supergraph.cc | 936 +++

[PATCH 29/49] analyzer: new files: tristate.{cc|h}

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * analyzer/tristate.cc: New file. * analyzer/tristate.h: New file. --- gcc/analyzer/tristate.cc | 222 +++ gcc/analyzer/tristate.h | 82 + 2 files changed, 304 insertions(+) create mode 100644 gcc/analyze

[PATCH 26/49] analyzer: new files: digraph.{cc|h} and shortest-paths.h

2019-11-15 Thread David Malcolm
This patch adds template classes for directed graphs, their nodes and edges, and for finding the shortest path through such a graph. gcc/ChangeLog: * analyzer/digraph.cc: New file. * analyzer/digraph.h: New file. * analyzer/shortest-paths.h: New file. --- gcc/analyzer/digr

[PATCH 12/49] Add diagnostic paths

2019-11-15 Thread David Malcolm
This patch adds support for associating a "diagnostic_path" with a diagnostic: a sequence of events predicted by the compiler that leads to the problem occurring, with their locations in the user's source, text descriptions, and stack information (for handling interprocedural paths). For example,

[PATCH 23/49] analyzer: logging support

2019-11-15 Thread David Malcolm
This patch adds a logging framework to the analyzer which handles hierarchical messages (showing the nested structure of the calls). This code is largely based on that in the "jit" subdirectory (with a few changes). An alternative would be to generalize that code and move it to the gcc parent dir

[PATCH 25/49] analyzer: new files: graphviz.{cc|h}

2019-11-15 Thread David Malcolm
This patch adds a simple wrapper class to make it easier to write human-readable .dot files. gcc/ChangeLog: * analyzer/graphviz.cc: New file. * analyzer/graphviz.h: New file. --- gcc/analyzer/graphviz.cc | 81 gcc/analyzer/graphviz.

[PATCH 24/49] analyzer: new file: analyzer-pass.cc

2019-11-15 Thread David Malcolm
This patch adds the IPA pass boilerplate for the analyzer. gcc/ChangeLog: * analyzer/analyzer-pass.cc: New file. --- gcc/analyzer/analyzer-pass.cc | 103 ++ 1 file changed, 103 insertions(+) create mode 100644 gcc/analyzer/analyzer-pass.cc diff --

[PATCH 22/49] analyzer: params.def: new parameters

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * params.def (PARAM_ANALYZER_BB_EXPLOSION_FACTOR): New param. (PARAM_ANALYZER_MAX_ENODES_PER_PROGRAM_POINT): New param. (PARAM_ANALYZER_MAX_RECURSION_DEPTH): New param. (PARAM_ANALYZER_MIN_SNODES_FOR_CALL_SUMMARY): New param. --- gcc/params.def | 25 +

[PATCH 20/49] analyzer: new builtins

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * builtins.def (BUILT_IN_ANALYZER_BREAK): New builtin. (BUILT_IN_ANALYZER_DUMP): New builtin. (BUILT_IN_ANALYZER_DUMP_EXPLODED_NODES): New builtin. (BUILT_IN_ANALYZER_DUMP_NUM_HEAP_REGIONS): New builtin. (BUILT_IN_ANALYZER_DUMP_PATH): New built

[PATCH 21/49] analyzer: command-line options

2019-11-15 Thread David Malcolm
This patch contains the command-line options for the analyzer. gcc/ChangeLog: * analyzer/plugin.opt: New file. * common.opt (--analyzer): New driver option. --- gcc/analyzer/plugin.opt | 161 gcc/common.opt | 3 + 2 files

[PATCH 16/49] Add support for in-tree plugins

2019-11-15 Thread David Malcolm
This patch adds support for "in-tree" plugins i.e. GCC plugins that live in the GCC source tree and are shipped as part of the GCC tarball. The patch adds Makefile/configure machinery for handling in-tree GCC plugins, adapted from how we support frontends. Each in-tree plugin should provide a Mak

[PATCH 19/49] analyzer: new files: analyzer-selftests.{cc|h}

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * analyzer/analyzer-selftests.cc: New file. * analyzer/analyzer-selftests.h: New file. --- gcc/analyzer/analyzer-selftests.cc | 61 ++ gcc/analyzer/analyzer-selftests.h | 46 2 files changed, 107 inser

[PATCH 18/49] Add in-tree plugin: "analyzer"

2019-11-15 Thread David Malcolm
This patch supplies the {Make|config}-plugin.in files for the analyzer, along with the entrypoint to the plugin, and the driver logic for converting "--analyzer" into the option to inject the plugin. gcc/ChangeLog: * analyzer/Make-plugin.in: New file. * analyzer/analyzer-plugin.cc:

[PATCH 15/49] Add ordered_hash_map

2019-11-15 Thread David Malcolm
This patch adds an ordered_hash_map template, which is similar to hash_map, but preserves insertion order. gcc/ChangeLog: * Makefile.in (OBJS): Add ordered-hash-map-tests.o. * ordered-hash-map-tests.cc: New file. * ordered-hash-map.h: New file. * selftest-run-tests.

[PATCH 17/49] Support for adding selftests via a plugin

2019-11-15 Thread David Malcolm
This patch provides a plugin callback for invoking selftests, so that a plugin can add tests to those run by -fself-test=DIR. The callback invocation uses invoke_plugin_callbacks, which is a no-op if plugin support is disabled. gcc/ChangeLog: * plugin.c (register_callback): Add case for P

[PATCH 09/49] gimple const-correctness fixes

2019-11-15 Thread David Malcolm
This patch converts various "gimple *" to "const gimple *" and similar fixes for gimple subclasses, adding is_a_helper for gimple subclasses to support the const form of as_a, and adding a few "const" overloads of accessors. This is enough to make pp_gimple_stmt_1's stmt const. gcc/ChangeLog:

[PATCH 14/49] hash-map-tests.c: add a selftest involving int_hash

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * hash-map-tests.c (selftest::test_map_of_int_to_strings): New selftest. (selftest::hash_map_tests_c_tests): Call it. --- gcc/hash-map-tests.c | 41 + 1 file changed, 41 insertions(+) diff --git a/gcc/hash-map-tests.c

[PATCH 11/49] Add diagnostic_metadata and CWE support

2019-11-15 Thread David Malcolm
This patch adds support for associating a diagnostic with an optional diagnostic_metadata object, so that plugins can add extra data to their diagnostics (e.g. mapping a diagnostic to a taxonomy or coding standard such as from CERT or MISRA). Currently this only supports associating a CWE identifi

[PATCH 08/49] Introduce pretty_printer::clone vfunc

2019-11-15 Thread David Malcolm
This patch provides a way to clone a pretty_printer. This is needed so that we can capture text in a label_text and make layout decisions based on it, using the policy of global_dc's printer, whilst within a call to diagnostic_show_locus. We can't print with the pretty_printer itself within a cal

[PATCH 13/49] function-tests.c: expose selftest::make_fndecl for use elsewhere

2019-11-15 Thread David Malcolm
This is used by new selftests later on in the patch kit. gcc/ChangeLog: * function-tests.c (selftest::make_fndecl): Make non-static. * selftest.h (selftest::make_fndecl): New decl. --- gcc/function-tests.c | 4 ++-- gcc/selftest.h | 7 +++ 2 files changed, 9 insertions(+

[PATCH 07/49] Replace label_text ctor with "borrow" and "take"

2019-11-15 Thread David Malcolm
libcpp's label_text class wraps a text buffer, along with a flag to determine if it "owns" the buffer. The existing ctor exposed this directly, but I found it difficult to remember the sense of flag, so this patch hides the ctor, in favor of static member functions "borrow" and "take", to make the

[PATCH 02/49] analyzer: internal documentation

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * Makefile.in (TEXI_GCCINT_FILES): Add analyzer.texi. * doc/analyzer.texi: New file. * doc/gccint.texi ("Static Analyzer") New menu item. (analyzer.texi): Include it. --- gcc/Makefile.in | 2 +- gcc/doc/analyzer.texi | 470

[PATCH 10/49] Add -fdiagnostics-nn-line-numbers

2019-11-15 Thread David Malcolm
This patch implements -fdiagnostics-nn-line-numbers, a new option which makes diagnostic_show_locus print "NN" rather than specific line numbers when printing the left margin. This is intended purely to make it easier to write certain kinds of DejaGnu test; various integration tests for diagnostic

[PATCH 00/49] RFC: Add a static analysis framework to GCC

2019-11-15 Thread David Malcolm
This patch kit introduces a static analysis pass for GCC that can diagnose various kinds of problems in C code at compile-time (e.g. double-free, use-after-free, etc). The analyzer runs as an IPA pass on the gimple SSA representation. It associates state machines with data, with transitions at cer

[PATCH 06/49] timevar.h: add auto_client_timevar class

2019-11-15 Thread David Malcolm
This patch adds a class "auto_client_timevar", similar to auto_timevar, but for plugins to use on their own timing items that aren't in timevar.def gcc/ChangeLog: * timevar.h (class auto_client_timevar): New class. --- gcc/timevar.h | 33 + 1 file changed,

[PATCH 05/49] vec.h: add auto_delete_vec

2019-11-15 Thread David Malcolm
This patch adds a class auto_delete_vec, a subclass of auto_vec that deletes all of its elements on destruction; it's used in many places later in the kit. This is a crude way for a vec to "own" the objects it points to and clean up automatically (essentially a workaround for not being able to us

[PATCH 01/49] analyzer: user-facing documentation

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * doc/invoke.texi ("Static Analyzer Options"): New list and new section. ("Warning Options"): Add static analysis warnings to the list. (-Wno-analyzer-double-fclose): New option. (-Wno-analyzer-double-free): New option. (-Wno-analyzer-exposure-

[PATCH 03/49] diagnostic_show_locus: move initial newline to callers

2019-11-15 Thread David Malcolm
diagnostic_show_locus adds a newline before doing anything (including the do-nothing-else case). This patch removes this initial newline, adding it to all callers of diagnostic_show_locus instead. Doing so makes diagnostic_show_locus more flexible, allowing it to be used later in this patch kit w

[PATCH 04/49] sbitmap.h: add operator const sbitmap & to auto_sbitmap

2019-11-15 Thread David Malcolm
gcc/ChangeLog: * sbitmap.h (auto_sbitmap): Add operator const sbitmap &. --- gcc/sbitmap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h index a33175d..3c5b0a4 100644 --- a/gcc/sbitmap.h +++ b/gcc/sbitmap.h @@ -295,6 +295,7 @@ public: /* Allow calli

[PATCH], V9, #4 of 4, Add PCREL_OPT tests

2019-11-15 Thread Michael Meissner
This patch adds the tests for PCREL_OPT. These tests all pass with the compiler using the previous 3 patches. Can I check these tests in once the previous patches have been checked in? 2019-11-15 Michael Meissner * gcc.target/powerpc/pcrel-opt-inc-di.c: New PCREL_OPT test. *

[PATCH], V9, #3 of 4, Add PCREL_OPT store support

2019-11-15 Thread Michael Meissner
This patch adds support for the PCREL_OPT optimization with stores. I have built a bootstrap compiler with these changes on a little endian power8 system, and there were no regressions in the test suite. Can I check this patch in after the preceeding 3 patches have been checked in? 2019-11-15 M

[C++ PATCH] Fix up spaceship diagnostics

2019-11-15 Thread Jakub Jelinek
Hi! While working on the __builtin_source_location patch, I've noticed that these two messages are weird: spaceship-err3.C:11:12: error: ‘std::std::strong_ordering’ is not a type spaceship-err3.C:11:12: note: forming type of ‘operator<=>’ spaceship-err3.C:13:14: error: ‘std::partial_ordering::std

[PATCH], V9, #2 of 4, Add PCREL_OPT for sign, zero, and float extend

2019-11-15 Thread Michael Meissner
This patch builds on the previous patch, and it adds the PCREL_OPT optimization for loads of external variables that involve sign extension, zero extension, or float extension as part of the load. I have built a bootstrap compiler on a little endian power8 system and it caused no regressions in th

[PATCH], V9, #1 of 4, Add basic PCREL_OPT support for loads

2019-11-15 Thread Michael Meissner
This patch adds the basic support for the PCREL_OPT optimization for loads. It is on the long side, because I needed to create the infrastructure for the support. It creates a new pass that is run just before final to see if it can find appropriate load external addresses and a single load/store

PowerPC V9 patches, Add the PCREL_OPT optimization

2019-11-15 Thread Michael Meissner
This series of patches adds the PCREL_OPT optimization for the PC-relative support in the PowerPC compiler. This optimization convert a single load or store of an external variable to use the R_PPC64_PCREL_OPT relocation. For example, a normal load of an external int variable (with -mcpu=future)

Re: [PATCH 0/4] Eliminate cc0 from m68k

2019-11-15 Thread Bernd Schmidt
On 11/15/19 11:50 PM, Andreas Schwab wrote: > On Nov 15 2019, Bernd Schmidt wrote: > >> I meant the compiler command line of course... for any -mcpu flags that >> might differ from my test run. > > There are none. Well, there has to be some difference between what you are doing and what I am doi

Re: [PATCH 0/2] Introduce a new GCC option, --record-gcc-command-line

2019-11-15 Thread Jeff Law
On 11/14/19 2:15 AM, Martin Liška wrote: > On 11/13/19 8:23 PM, Jeff Law wrote: >> On 11/13/19 2:37 AM, Martin Liška wrote: As Nick also mentioned many times, -grecord-gcc-switches is in DWARF and this causes a great disadvantage: it gets stripped out. >>> >>> Well, that's still some

Re: [PATCH] Add support for C++2a stop_token

2019-11-15 Thread Jonathan Wakely
On 15/11/19 14:40 +, Jonathan Wakely wrote: On 15/11/19 14:38 +, Jonathan Wakely wrote: On 13/11/19 17:59 -0800, Thomas Rodgers wrote: + // TODO verify the standard requires this +#if 0 + // register another callback + bool cb3called{false}; + std::stop_callback scb3{stok, [&] +

Re: [PATCH] [MIPS] Prevent MSA branches from being put into delay slots

2019-11-15 Thread Jeff Law
On 11/15/19 10:27 AM, Dragan Mladjenovic wrote: > From: "Dragan Mladjenovic" > > This patch tightens the instruction definitions to make sure > that MSA branch instructions cannot be put into delay slots and have their > delay slots eligible for being filled. Also, MSA *div*3 patterns use MSA

Re: [PATCH] Remove vestiges of MODIFY_JNI_METHOD_CALL

2019-11-15 Thread Jeff Law
On 11/13/19 2:50 PM, Tom Tromey wrote: > I happened to notice that MODIFY_JNI_METHOD_CALL was defined in > cygming.h and documented in tm.texi. However, because it was only > needed for gcj, it is obsolete. This patch removes the vestiges. > > Tested by grep, and rebuilding the documentation. >

[PATCH] Proposal for IPA init() constant propagation

2019-11-15 Thread erick . ochoa
Hello, we've been working on an lto optimization and would like to receive some feedback on this candidate patch. At the moment the patch compiles correctly when applied to master. We have some initial test cases in a separate repository and have compiled and ran a small subset of CPU 2017 ben

Re: [PATCH] Split X86_TUNE_AVX128_OPTIMAL into X86_TUNE_AVX256_SPLIT_REGS and X86_TUNE_AVX128_OPTIMAL

2019-11-15 Thread Jeff Law
On 11/14/19 5:21 AM, Richard Biener wrote: > On Tue, Nov 12, 2019 at 11:35 AM Hongtao Liu wrote: >> >> Hi: >> As mentioned in https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00832.html >>> So yes, it's poorly named. A preparatory patch to clean this up >>> (and maybe split it into TARGET_AVX256_S

Diagnose duplicate C2x standard attributes

2019-11-15 Thread Joseph Myers
For each of the attributes currently included in C2x, it has a constraint that the attribute shall appear at most once in each attribute list (attribute-list being what appear between a single [[ and ]]). This patch implements that check. As the corresponding check in the C++ front end (cp_parser

[PATCH] Only warn for maybe-uninitialized SRAed bits in -Wextra (PR 80635)

2019-11-15 Thread Martin Jambor
Hi, On Fri, Nov 08 2019, Martin Jambor wrote: > Hi, > > this patch is an attempt to implement my idea from a previous thread > about moving -Wmaybe-uninitialized to -Wextra: > > https://gcc.gnu.org/ml/gcc-patches/2019-02/msg00220.html > > Specifically, it attempts to split -Wmaybe-uninitialized in

[RFC PATCH] cgraph support for late declare variant resolution

2019-11-15 Thread Jakub Jelinek
Hi! The following patch is a so far non-working attempt at #pragma omp declare variant late resolution. To sum up, during gimplification we resolve direct calls to their variants whenever possible. There can be some cases that can't be resolved at that point yet, e.g. whether some context depends

Re: [PATCH 0/4] Eliminate cc0 from m68k

2019-11-15 Thread Andreas Schwab
On Nov 15 2019, Bernd Schmidt wrote: > I meant the compiler command line of course... for any -mcpu flags that > might differ from my test run. There are none. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now fo

Re: introduce -fcallgraph-info option

2019-11-15 Thread Alexandre Oliva
On Nov 15, 2019, Richard Biener wrote: > Hmm, -dwo-base-name to the rescue? ;) I'd rather have less rather than more complexity. I.e., make the objcopy command match the dumpdir location, that defaults to the output location. The more such options we have, the harder it is to document, underst

Re: [PATCH 0/4] Eliminate cc0 from m68k

2019-11-15 Thread Bernd Schmidt
On 11/15/19 10:58 PM, Andreas Schwab wrote: > On Nov 15 2019, Bernd Schmidt wrote: > >> Any chance you could show the command lines from the log files or some >> other way of reproducing the issue? > > Executing on aranym: OMP_NUM_THREADS=2 > LD_LIBRARY_PATH=.:/da

Re: [PATCH 0/4] Eliminate cc0 from m68k

2019-11-15 Thread Andreas Schwab
On Nov 15 2019, Bernd Schmidt wrote: > Any chance you could show the command lines from the log files or some > other way of reproducing the issue? Executing on aranym: OMP_NUM_THREADS=2 LD_LIBRARY_PATH=.:/daten/aranym/gcc/gcc-20191115/Build/m68k-linux/./libstdc++-v3/src/.libs:/daten/aran

[PATCH 13/13] Enable worker partitioning for AMD GCN

2019-11-15 Thread Julian Brown
This patch flips the switch to enable worker partitioning on AMD GCN. OK? Thanks, Julian ChangeLog gcc/ * config/gcn/gcn.c (gcn_goacc_validate_dims): Remove no-flag_worker-partitioning assertion. (TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.

[PATCH 12/13] Fix parallel-dims.f90 for AMD GCN

2019-11-15 Thread Julian Brown
This patch provides AMD GCN support for the parallel-dims.f90 test's parallel-dims-aux.c helper. OK? Thanks, Julian ChangeLog libgomp/ * testsuite/libgomp.oacc-fortran/parallel-dims-aux.c: Support AMD GCN. --- .../testsuite/libgomp.oacc-fortran/parallel-dims-aux.c | 9 ++

[PATCH 11/13] AMD GCN symbol output with null cfun

2019-11-15 Thread Julian Brown
This patch checks that cfun is valid in the gcn_asm_output_symbol_ref function. This prevents a crash when that function is called with NULL cfun, i.e. when outputting debug symbols. OK? Thanks, Julian ChangeLog gcc/ * config/gcn/gcn.c (gcn_asm_output_symbol_ref): Handle null c

[PATCH 10/13] Race conditions in OpenACC async tests

2019-11-15 Thread Julian Brown
This patch provides some race-condition fixes for tests that broke for AMD GCN. OK? Thanks, Julian ChangeLog libgomp/ * testsuite/libgomp.oacc-c-c++-common/lib-94.c: Fix race condition. * testsuite/libgomp.oacc-fortran/lib-16-2.f90: Likewise. --- libgomp/testsuite/libg

[PATCH 09/13] AMD GCN libgomp plugin queue-full condition locking fix

2019-11-15 Thread Julian Brown
This patch corrects a possible race condition in locking for the asynchronous queue-full condition check in the AMD GCN libgomp plugin. OK? Julian ChangeLog libgomp/ * plugin/plugin-gcn.c (wait_for_queue_nonfull): Don't lock/unlock aq->mutex here. (queue_push_lau

[PATCH 08/13] Fix host-to-device copies from rodata for AMD GCN

2019-11-15 Thread Julian Brown
It appears that the hsa_memory_copy API routine has problems copying from read-only data: in the libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-8.c test, a "const" variable cannot be successfully copied to the target. I think the problem is with read-only page mappings (in the HSA runtime).

[PATCH 07/13] Fix OpenACC "ephemeral" asynchronous host-to-device copies

2019-11-15 Thread Julian Brown
The AMD GCN runtime support appears to exercise asynchronous operations more heavily than other offload targets. As such, latent problems with asynchronous host-to-device copies have come to light with GCN. This patch provides a solution to those. Previously posted for the og9 branch (with some ra

[PATCH 04/13] OpenACC middle-end worker-partitioning support

2019-11-15 Thread Julian Brown
This is the main patch implementing worker-partitioning support on AMD GCN. The following description is taken from the version of the patch submitted on the openacc-gcc-9-branch: This patch implements worker-partitioning support in the middle end, by rewriting gimple. The OpenACC execution model

[PATCH 06/13] Fix up tests for oaccdevlow pass split

2019-11-15 Thread Julian Brown
This patch adjusts expected output for several tests after the oaccdevlow pass is split into three by an earlier patch in this series. OK? Julian ChangeLog gcc/testsuite/ * c-c++-common/goacc/classify-kernels-unparallelized.c, c-c++-common/goacc/classify-kernels.c,

[PATCH 05/13] AMD GCN adjustments for middle-end worker partitioning

2019-11-15 Thread Julian Brown
This patch provides AMD GCN-specific parts supporting middle-end worker partitioning. The adjust_propagation_record hook is now called create_propagation_record. Several builtins are redefined to take an argument in a special address space (corresponding to GPU shared memory). Tested alongside oth

[PATCH 03/13] Rewrite OpenACC private or reduction reference variables

2019-11-15 Thread Julian Brown
Reference-type private variables or reference-type variables used as reduction targets do not work well with the scheme to implement worker partitioning on AMD GCN. This patch (originally by Cesar Philippidis, but modified somewhat) provides support for replacing such variables with new non-referen

[PATCH 02/13] Target-dependent gang-private variable decl rewriting

2019-11-15 Thread Julian Brown
This patch provides support for the adjust_private_decl hook introduced by the previous patch changing the type of its decl argument, e.g. if the offload target forces it into another address space. Any ADDR_EXPR nodes that have the decl as an argument will have the wrong type: this patch implement

[PATCH 00/13] AMD GCN worker partitioning support

2019-11-15 Thread Julian Brown
This patch series brings together support for worker partitioning on AMD GCN and various support patches to ensure no testsuite regressions. Some of these patches have been sent upstream previously. Most are present on the openacc-gcc-9-branch, and have been tested with both AMD GCN and nVidia GPU

[PATCH 01/13] Add support for gang local storage allocation in shared memory

2019-11-15 Thread Julian Brown
This patch provides support for gang local storage allocation in shared memory. It is mostly identical to the version posted previously, with one cosmetic fix (a duplicated identical condition): https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00448.html Tested alongside other patches in this series

Re: [PATCH 0/4] Eliminate cc0 from m68k

2019-11-15 Thread Bernd Schmidt
On 11/15/19 5:34 PM, Andreas Schwab wrote: > On Nov 15 2019, Bernd Schmidt wrote: > >> Are these with the patch? > > Yes. > >> Are you on real hardware > > No, I'm using aranym. Any chance you could show the command lines from the log files or some other way of reproducing the issue? Bernd

Re: [WIP PATCH] add object access attributes (PR 83859)

2019-11-15 Thread Martin Sebor
On 10/27/19 11:31 AM, Jeff Law wrote: On 9/29/19 1:51 PM, Martin Sebor wrote: -Wstringop-overflow detects a subset of past-the-end read and write accesses by built-in functions such as memcpy and strcpy.  It relies on the functions' effects the knowledge of which is hardwired into GCC.  Although

Re: [PATCH] libgo/test: Pass $GOLIBS to compilation in DejaGNU testing

2019-11-15 Thread Ian Lance Taylor
On Tue, Nov 12, 2019 at 4:43 PM Maciej W. Rozycki wrote: > > Pass $GOLIBS to compilation in DejaGNU testing like with direct compiler > invocation from `libgo/testsuite/gotest', removing link problems in > cross-toolchain testing like: > > .../bin/riscv64-linux-gnu-ld: _gotest_.o: in function > `

Re: [C++ Patch] Improve cp_truthvalue_conversion locations and more

2019-11-15 Thread Jason Merrill
On 11/12/19 8:57 AM, Paolo Carlini wrote: Hi, a few days ago I noticed that we weren't doing the right thing location-wise for the first test of g++.dg/warn/Waddress-1.C: it seems clear that the ultimate reason is that we didn't pass an accurate location to build_binary_op called from cp_trut

Re: [PATCH] Refactor rust-demangle to be independent of C++ demangling.

2019-11-15 Thread Eduard-Mihai Burtescu
> This is OK. > > Thanks. > > Ian > Ping for someone to commit this (as mentioned before, I have no commit access). I've tried pinging some people on IRC, but saw no response. Approved version of the patch: https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00647.html Original email, containing th

Re: [PATCH, libstdc++] Implement C++20 p1032 default_searcher constexprosity.

2019-11-15 Thread Jonathan Wakely
On 15/11/19 20:15 +, Smith-Rowland, Edward M wrote: --- testsuite/20_util/function_objects/constexpr_searcher.cc(nonexistent) +++ testsuite/20_util/function_objects/constexpr_searcher.cc(working copy) @@ -0,0 +1,52 @@ +// Copyright (C) 2014-2019 Free Software Foundation, Inc. Just 2

Re: [PATCH, libstdc++] Implement C++20 p1032 default_searcher constexprosity.

2019-11-15 Thread Ville Voutilainen
On Fri, 15 Nov 2019 at 22:16, Smith-Rowland, Edward M wrote: > > Pretty self-explanatory. LGTM. Jonathan still needs to ack it.

Re: [External]_Re: Implement the part of C++20 p1032 Misc constexpr bits.

2019-11-15 Thread Smith-Rowland, Edward M
From: Jonathan Wakely Sent: Friday, November 15, 2019 2:33 PM To: Smith-Rowland, Edward M Cc: libstd...@gcc.gnu.org; gcc-patches@gcc.gnu.org Subject: Re: [External]_Re: Implement the part of C++20 p1032 Misc constexpr bits. Oh I see the problem, it's because I made synopsis_c++20.cc include

Re: [PATCH] extend missing nul checks to all built-ins (PR 88226)

2019-11-15 Thread Jeff Law
On 11/14/19 10:38 AM, Martin Sebor wrote: > GCC 9 added checks for usafe uses of unterminated constant char > arrays to a few string functions but the checking is far from > comprehensive.  It's been on my list of things to do to do > a more thorough review and add the checks where they're missing.

Re: [PATCH] fold strncmp of unterminated arrays (PR 92501)

2019-11-15 Thread Jeff Law
On 11/14/19 10:11 AM, Martin Sebor wrote: > Adding tests for unsafe uses of unterminated constant char arrays > in string functions exposed the limitation in strncmp folding > described in PR 92501: GCC only folds strncmp calls involving > nul-terminated constant strings. > > The attached patch im

[PATCH, libstdc++] Implement C++20 p1032 default_searcher constexprosity.

2019-11-15 Thread Smith-Rowland, Edward M
Pretty self-explanatory. Ed 2019-11-15 Edward Smith-Rowland <3dw...@verizon.net> Implement the default_searcher part of C++20 p1032 Misc constexpr bits. * include/std/functional (default_searcher, default_searcher::operator()): Constexpr. * testsuite/20_util/function_objects/constexpr_search

[PATCH] libstdc++: Implement LWG 3149 for std::default_constructible

2019-11-15 Thread Jonathan Wakely
The change approved in Belfast did not actually rename the concept from std::default_constructible to std::default_initializable, even though that was intended. That is expected to be done soon as a separate issue, so I'm implementing that now too. * include/bits/iterator_concepts.h (weak

[PATCH] libstdc++: Implement LWG 3070 in path::lexically_relative

2019-11-15 Thread Jonathan Wakely
* src/c++17/fs_path.cc [_GLIBCXX_FILESYSTEM_IS_WINDOWS] (is_disk_designator): New helper function. (path::_Parser::root_path()): Use is_disk_designator. (path::lexically_relative(const path&)): Implement resolution of LWG 3070. * testsuite/27_io/file

Re: [PATCH] m68k: add musl support

2019-11-15 Thread Szabolcs Nagy
On 15/11/2019 19:16, Jeff Law wrote: > On 11/15/19 10:22 AM, Szabolcs Nagy wrote: >> Add the dynamic linker name and fix a type name to use the public name >> instead of the glibc internal name. >> >> Build tested on m68k-linux-musl and m68k-linux-gnu. >> >> gcc/ChangeLog: >> >> 2019-11-15 Szabolc

Re: [PATCH] musl: use correct long double abi by default

2019-11-15 Thread Szabolcs Nagy
On 15/11/2019 19:22, Segher Boessenkool wrote: > On Fri, Nov 15, 2019 at 06:58:24PM +, Szabolcs Nagy wrote: >> 2019-11-15 Szabolcs Nagy >> >> * configure.ac (gcc_cv_target_ldbl128): Set for *-musl* targets. > > That is not what the patch does. It sets it to yes for s390*-linux-musl*,

[PATCH] MAINTAINERS: Change to my personal email address

2019-11-15 Thread Kelvin Nilsen
I'm leaving IBM and am changing my email to my my personal address. ChangeLog: 2019-11-15 Kelvin Nilsen * MAINTAINERS: Change my email address as maintainer. Index: MAINTAINERS === --- MAINTAINERS (revision 278306) +++ M

  1   2   3   >