[PATCH 14/21] analyzer: fix skipping of debug stmts [PR113253]

2024-05-09 Thread David Malcolm
gcc/testsuite/ChangeLog: PR analyzer/113253 * gcc.dg/analyzer/deref-before-check-pr113253.c: New test. (cherry picked from commit r14-8670-gcc7aebff74d896) Signed-off-by: David Malcolm --- gcc/analyzer/region-model.cc | 5 + gcc/analyzer/state-purge.cc

[PATCH 17/21] analyzer: fix ICE due to type mismatch when replaying call summary [PR114473]

2024-05-09 Thread David Malcolm
::convert_region_from_summary_1): Add missing cast for the deref of RK_SYMBOLIC case. gcc/testsuite/ChangeLog: PR analyzer/114473 * gcc.dg/analyzer/call-summaries-pr114473.c: New test. (cherry picked from commit r14-9697-gfdd59818e2abf6) Signed-off-by: David Malcolm --- gcc/analyzer/call

[PATCH 08/21] testsuite, analyzer: add test case [PR108171]

2024-05-09 Thread David Malcolm
) Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pr108171.c | 31 1 file changed, 31 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr108171.c diff --git a/gcc/testsuite/gcc.dg/analyzer/pr108171.c b/gcc/testsuite/gcc.dg/analyzer/pr108171.c

[PATCH 09/21] jit: dump string literal initializers correctly

2024-05-09 Thread David Malcolm
From: Vibhav Pant Signed-off-by: David Malcolm gcc/jit/ChangeLog: * jit-recording.cc (recording::global::write_to_dump): Fix dump of string literal initializers. (cherry picked from commit r14-4923-gac66744d94226a) Signed-off-by: David Malcolm --- gcc/jit/jit-recording.cc

[PATCH 16/21] analyzer: fix -Wanalyzer-deref-before-check false positive seen in loop header macro [PR109251]

2024-05-09 Thread David Malcolm
. (deref_before_check::loop_header_p): New. gcc/testsuite/ChangeLog: PR analyzer/109251 * gcc.dg/analyzer/deref-before-check-pr109251-1.c: New test. * gcc.dg/analyzer/deref-before-check-pr109251-2.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/sm-malloc.cc

[PATCH 20/21] Fix ICE in -fdiagnostics-generate-patch [PR112684]

2024-05-09 Thread David Malcolm
Backported from r14-8255-ge254d1224df306. gcc/ChangeLog: PR middle-end/112684 * toplev.cc (toplev::main): Don't ICE in -fdiagnostics-generate-patch when exiting after options, since no edit context will have been created. Signed-off-by: David Malcolm ---

[PATCH 11/21] analyzer: fix deref-before-check false positives due to inlining [PR112790]

2024-05-09 Thread David Malcolm
: Include "analyzer/inlining-iterator.h". (maybe_complain_about_deref_before_check): Reject stmts that were inlined from another function. gcc/testsuite/ChangeLog: PR analyzer/112790 * gcc.dg/analyzer/deref-before-check-pr112790.c: New test. Signed-off-by: Dav

[PATCH 03/21] testsuite: Add more allocation size tests for conjured svalues [PR110014]

2024-05-09 Thread David Malcolm
. (cherry picked from commit r14-1685-g39adc5eebd61fd276f3f1ef9d7228756a35bd0cb) Signed-off-by: David Malcolm --- .../gcc.dg/analyzer/realloc-pr110014.c| 25 +++ 1 file changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/realloc-pr110014.c diff --git a

[PATCH 18/21] analyzer: fix ICE and false positive with -Wanalyzer-deref-before-check [PR114408]

2024-05-09 Thread David Malcolm
: New test. Signed-off-by: David Malcolm --- gcc/analyzer/engine.cc| 7 ++ gcc/analyzer/kf.cc| 22 +++ .../ubsan/analyzer-ice-pr114408.c | 9 .../analyzer/deref-before-check-pr114408.c| 22

[PATCH 15/21] analyzer: fix -Wanalyzer-va-arg-type-mismatch false +ve on int types [PR111289]

2024-05-09 Thread David Malcolm
types. (kf_va_arg::impl_call_pre): Pass arg_sval to va_arg_compatible_types_p. gcc/testsuite/ChangeLog: PR analyzer/111289 * gcc.dg/analyzer/stdarg-pr111289-int.c: New test. * gcc.dg/analyzer/stdarg-pr111289-ptr.c: New test. Signed-off-by: David Malcolm

[PATCH 10/21] analyzer: fix ICE for 2 bits before the start of base region [PR112889]

2024-05-09 Thread David Malcolm
::is_empty): Likewise. gcc/testsuite/ChangeLog: PR analyzer/112889 * gcc.dg/analyzer/ice-pr112889.c: New test. Signed-off-by: David Malcolm --- gcc/analyzer/store.h | 10 +- gcc/testsuite/gcc.dg/analyzer/ice-pr112889.c | 17 + 2 files

[PATCH 13/21] analyzer: fix defaults in compound assignments from non-zero offsets [PR112969]

2024-05-09 Thread David Malcolm
/compound-assignment-pr112969.c: New test. * gcc.dg/plugin/infoleak-pr112969.c: New test. * gcc.dg/plugin/plugin.exp: Add infoleak-pr112969.c to analyzer_kernel_plugin.c tests. Signed-off-by: David Malcolm --- gcc/analyzer/store.cc | 11

[PATCH 19/21] diagnostics: fix ICE on sarif output when source file is unreadable [PR111700]

2024-05-09 Thread David Malcolm
lookup_or_add_file failing. gcc/testsuite/ChangeLog: PR driver/111700 * c-c++-common/diagnostic-format-sarif-file-pr111700.c: New test. Signed-off-by: David Malcolm --- gcc/input.cc | 12 ++-- .../diagnostic-format-sarif-file

[PATCH 21/21] diagnostics: fix corrupt json/SARIF on stderr [PR114348]

2024-05-09 Thread David Malcolm
one of the machine-readable diagnostic output formats on stderr. (diagnostic_output_format_init): Set output_format. Signed-off-by: David Malcolm --- gcc/diagnostic.cc | 24 1 file changed, 24 insertions(+) diff --git a/gcc/diagnostic.cc b/gcc/diagnosti

Re: [EXTERNAL] [COMMITTED] Regenerate cygming.opt.urls and mingw.opt.urls

2024-05-13 Thread David Malcolm
On Mon, 2024-05-13 at 11:14 +0200, Mark Wielaard wrote: > Hi Evgeny, > > Adding David to the CC, who might know the details. > > On Mon, May 13, 2024 at 08:44:12AM +, Evgeny Karpov wrote: > > Sunday, May 12, 2024 > > > > Thank you for reviewing our changes related to the refactoring of > > e

Re: [EXTERNAL] [COMMITTED] Regenerate cygming.opt.urls and mingw.opt.urls

2024-05-13 Thread David Malcolm
On Mon, 2024-05-13 at 09:42 -0400, David Malcolm wrote: > On Mon, 2024-05-13 at 11:14 +0200, Mark Wielaard wrote: > > Hi Evgeny, > > > > Adding David to the CC, who might know the details. > > > > On Mon, May 13, 2024 at 08:44:12AM +, Evgeny Karpov

[pushed 3/4] pretty-print: reimplement pp_format with a new struct pp_token

2024-08-29 Thread David Malcolm
token_list &. * tree-diagnostic.h: Likewise for decl. gcc/fortran/ChangeLog: * error.cc (gfc_format_decoder): Convert final param from const char **buffer_ptr to pp_token_list &formatted_token_list, and update call to default_tree_printer accordingly. Signed-off-

Re: [PATCH] gdbhooks: Fix printing of vec with vl_ptr layout

2024-08-30 Thread David Malcolm
On Fri, 2024-08-30 at 12:08 +0100, Alex Coplan wrote: > Hi, > > As it stands, the pretty printing of GCC's vecs by gdbhooks.py only > handles vectors with vl_embed layout.  As such, when encountering a > vec > with vl_ptr layout, GDB would print a diagnostic like: > >   gdb.error: There is no mem

[pushed 1/3] pretty-print: naming cleanups

2024-09-03 Thread David Malcolm
(output_buffer::m_flush_p): ...this. (output_buffer_formatted_text): Prefix all output_buffer fields with "m_". (output_buffer_append_r): Likewise. (output_buffer_last_position_in_text): Likewise. (pretty_printer::set_output_stream): Likewise. (pp_s

[pushed 2/3] pretty-print: add selftest of pp_format's stack

2024-09-03 Thread David Malcolm
New. (ASSERT_TEXT_TOKEN): New macro. (selftest::test_pp_format_stack): New test. (selftest::pretty_print_cc_tests): New. Signed-off-by: David Malcolm --- gcc/pretty-print-format-impl.h | 3 ++ gcc/pretty-print.cc| 78 ++ 2 files changed, 81 insert

[pushed 3/3] pretty-print: split up pretty_printer::format into subroutines

2024-09-03 Thread David Malcolm
mat. (format_phase_2): Likewise. * pretty-print.h (pretty_printer::format): Convert param from a text_info * to a text_info &. (pp_format): Update for above change. Assert that text_info is non-null. Signed-off-by: David Malcolm --- gcc/pretty-print-markup

Re: Handle 'NUM' in 'PUSH_INSERT_PASSES_WITHIN' (was: [PATCH 03/11] Handwritten part of conversion of passes to C++ classes)

2024-09-04 Thread David Malcolm
On Fri, 2024-06-28 at 15:06 +0200, Thomas Schwinge wrote: > Hi! > > As part of this: > > On 2013-07-26T11:04:33-0400, David Malcolm > wrote: > > This patch is the hand-written part of the conversion of passes > > from > > C structs to C++ classes. >

[pushed: r15-3551] analyzer: fix "unused variable 'summary_cast_reg'" warning

2024-09-09 Thread David Malcolm
t; Signed-off-by: David Malcolm --- gcc/analyzer/call-summary.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/analyzer/call-summary.cc b/gcc/analyzer/call-summary.cc index ec36fdfd9f1a..663a89567a79 100644 --- a/gcc/analyzer/call-summary.cc +++ b/gcc/analyzer/call-summary.cc @@ -72

[pushed: r15-3553] SARIF output: fix schema URL [§3.13.3, PR116603]

2024-09-09 Thread David Malcolm
-missing-semicolon.py: Likewise. * gcc.dg/sarif-output/test-no-diagnostics.py: Likewise. * gcc.dg/sarif-output/test-werror.py: Likewise. * lib/sarif-schema-2.1.0.json: Update with copy downloaded from https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif

[pushed: r15-3554] diagnostics: rename dc.printer to m_printer [PR116613]

2024-09-09 Thread David Malcolm
quot;printer" to "m_printer". * gcc.dg/plugin/diagnostic_group_plugin.c (test_diagnostic_starter): Likewise. (test_diagnostic_start_span_fn): Likewise. (test_output_format::on_begin_group): Likewise. (test_output_format::on_end_group): Likewise. * g

[pushed: r15-3555] diagnostics: replace option_hooks with a diagnostic_option_manager class

2024-09-09 Thread David Malcolm
stic_option_manager. Signed-off-by: David Malcolm --- gcc/diagnostic.cc | 23 --- gcc/diagnostic.h | 94 +++ gcc/lto-wrapper.cc| 24 --- gcc/opts-common.cc| 7 gcc/opts-diagnostic.h | 44 +--- gcc/opt

[pushed: r15-3556] diagnostics: introduce struct diagnostic_option_id

2024-09-09 Thread David Malcolm
diagnostic_t::emit_warning_n_va): Likewise. (format_string_diagnostic_t::emit_warning_va): Likewise. (format_string_diagnostic_t::emit_warning): Likewise. (format_string_diagnostic_t::emit_warning_n): Likewise. * substring-locations.h (format_string_diagnostic_t::emit_w

Re: [PATCH] JSON dumping for GENERIC trees

2024-09-12 Thread David Malcolm
On Wed, 2024-09-11 at 20:49 -0500, tcpreimesber...@gmail.com wrote: > From: Thor C Preimesberger > > This patch allows the compiler to dump GENERIC trees as JSON objects. > > The dump flag -fdump-tree-original-json dumps each fndecl node in the > C frontend's gimplifier as a JSON object and trav

Re: [PATCH] libcpp: Implement clang -Wheader-guard warning [PR96842]

2024-09-12 Thread David Malcolm
On Wed, 2024-09-11 at 23:26 +0200, Jakub Jelinek wrote: > Hi! > > The following patch implements the clang -Wheader-guard warning, > which warns > if a valid multiple inclusion header guard's #ifndef/#if !defined > directive > is immediately (no other non-line directives nor other (non-comment) >

Re: [PATCH] libcpp: Implement clang -Wheader-guard warning [PR96842]

2024-09-12 Thread David Malcolm
On Thu, 2024-09-12 at 17:18 +0200, Jakub Jelinek wrote: > On Thu, Sep 12, 2024 at 11:12:26AM -0400, David Malcolm wrote: > > We were chatting on IRC about how it would be nice to be able to > > use > > %qs in libcppp diagnostics; here is an example (rather than using > &

v2 of GDB hooks for debugging GCC

2013-08-21 Thread David Malcolm
On Mon, 2013-08-05 at 08:26 -0600, Tom Tromey wrote: > >>>>> "David" == David Malcolm writes: > > David> GDB 7.0 onwards supports hooks written in Python to improve the > David> quality-of-life within the debugger. The best known are the > David>

Re: v2 of GDB hooks for debugging GCC

2013-08-26 Thread David Malcolm
On Wed, 2013-08-21 at 15:01 -0600, Tom Tromey wrote: > >>>>> "David" == David Malcolm writes: [...] > David> How would one go about toggling the enabledness of a prettyprinter? Is > David> this something that can only be done from python? > > Yo

v3 of GDB hooks for debugging GCC

2013-08-26 Thread David Malcolm
On Wed, 2013-08-21 at 15:01 -0600, Tom Tromey wrote: > >>>>> "David" == David Malcolm writes: > > Tom> Naughty. > > David> We chatted about this at Cauldron; I haven't yet had a chance to > David> implement the magic bullet approach we d

Re: GDB hooks for debugging GCC

2013-08-26 Thread David Malcolm
On Mon, 2013-08-19 at 13:56 -0600, Jeff Law wrote: > On 08/02/2013 07:48 PM, David Malcolm wrote: > > GDB 7.0 onwards supports hooks written in Python to improve the > > quality-of-life within the debugger. The best known are the > > pretty-printing hooks [1], which we alrea

Re: [PATCH 0/2] Port symtab/cgraph/varpool nodes to use C++ inheritance

2013-08-26 Thread David Malcolm
On Tue, 2013-08-20 at 23:01 +0200, Jan Hubicka wrote: [...] > > > > In summary, > > struct GTY(()) symtab_node_base > > becomes: > > class GTY((user)) symtab_node_base > > > > and the subclasses: > > struct GTY(()) cgraph_node > > and: > > struct GTY(()) varpool_node > > > > become (resp

Re: v3 of GDB hooks for debugging GCC

2013-08-27 Thread David Malcolm
On Tue, 2013-08-27 at 09:58 -0600, Jeff Law wrote: > On 08/26/2013 12:42 PM, David Malcolm wrote: > > The patch also adds me a maintainer of gdbhooks.py into the MAINTAINERS > > file. (There doesn't seem to be any sort order to the maintainer part > > of

[PATCH 4/6] Implement is_a_helper <>::test specializations for various gimple types

2013-08-29 Thread David Malcolm
* gimple.h (is_a_helper ::test): New. (is_a_helper ::test): New. (is_a_helper ::test): New. (is_a_helper ::test): New. --- gcc/gimple.h | 30 ++ 1 file changed, 30 insertions(+) diff --git a/gcc/gimple.h b/gcc/gimple.h index 43573a1..e2c

[PATCH 2/6] Hand-written port of various accessors within gimple.h

2013-08-29 Thread David Malcolm
* gimple.h (gimple_use_ops): Port from union to usage of dyn_cast. (gimple_set_use_ops): Port from union to usage of as_a. (gimple_set_vuse): Likewise. (gimple_set_vdef): Likewise. (gimple_call_internal_fn): Port from union to a static_cast, g

[PATCH 1/6] Convert gimple types from a union to a C++ class hierarchy

2013-08-29 Thread David Malcolm
* coretypes.h (union gimple_statement_d): Remove declaration. (gimple): Convert from being a "union gimple_statement_d *" to a "struct gimple_statement_base *". (const_gimple): Likewise (with "const"). * ggc.h (ggc_alloc_cleared_gimple_statement_d_stat): Repl

[PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-08-29 Thread David Malcolm
The various gimple types are currently implemented using a hand-coded C inheritance scheme, with a "union gimple_statement_d" holding the various possible structs for a statement. The following series of patches convert it to a C++ class hierarchy, using the existing structs, eliminating the union

[PATCH 6/6] Add manual GTY hooks

2013-08-29 Thread David Malcolm
* gimple.c (gt_ggc_mx (gimple)): New, as required by GTY((user)). (gt_pch_nx (gimple)): Likewise. (gt_pch_nx (gimple, gt_pointer_operator, void *)): Likewise. * gimple.h (gt_ggc_mx (gimple)): Declare. (gt_pch_nx (gimple)): Declare. (gt_pch_nx (gimple

[PATCH 5/6] Port various places from union access to subclass access.

2013-08-29 Thread David Malcolm
* gimple-streamer-in.c (input_gimple_stmt): Port from union access to use of as_a. * gimple.c (gimple_build_asm_1): Likewise. (gimple_build_try): Likewise. Also, return a specific subclass rather than just gimple. (gimple_build_resx): Port from union

[PATCH 3/6] Autogenerated conversion of gimple to C++

2013-08-29 Thread David Malcolm
This patch is 110KB in size, so to avoid mailing-list size limits I've uploaded it to: http://dmalcolm.fedorapeople.org/gcc/large-patches/a89d361b4f95dd216e1d29cb44fbaf90372c48b8-0003-Autogenerated-conversion-of-gimple-to-C.patch The ChangeLog entry and diffstat follow: gcc/ Patch auto

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-08-30 Thread David Malcolm
On Fri, 2013-08-30 at 09:12 -0500, Gabriel Dos Reis wrote: > On Fri, Aug 30, 2013 at 9:02 AM, Jakub Jelinek wrote: > > On Fri, Aug 30, 2013 at 08:58:43AM -0500, Gabriel Dos Reis wrote: > >> On Fri, Aug 30, 2013 at 8:44 AM, Michael Matz wrote: > >> > >> > And the manual GTY markers are so not main

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-08-30 Thread David Malcolm
On Fri, 2013-08-30 at 15:44 +0200, Michael Matz wrote: > Hi, > > On Thu, 29 Aug 2013, David Malcolm wrote: > > > Successfully bootstrapped and tested on x86_64-unknown-linux-gnu: all > > testcases show the same results as an unpatched build (relative to > > r2020

Re: [PATCH 6/6] Add manual GTY hooks

2013-08-30 Thread David Malcolm
On Fri, 2013-08-30 at 10:40 +0200, Richard Biener wrote: > On Thu, Aug 29, 2013 at 6:20 PM, David Malcolm wrote: > > * gimple.c (gt_ggc_mx (gimple)): New, as required by GTY((user)). > > (gt_pch_nx (gimple)): Likewise. > > (gt_pch_nx (gimple, gt_p

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-08-30 Thread David Malcolm
On Thu, 2013-08-29 at 12:20 -0400, David Malcolm wrote: [...] > Successfully bootstrapped and tested on x86_64-unknown-linux-gnu: all > testcases show the same results as an unpatched build (relative to > r202029). I messed up the testing for this by accidentally configuring the bu

[PATCH 3/6 v2] Autogenerated conversion of gimple to C++

2013-08-31 Thread David Malcolm
On Thu, 2013-08-29 at 12:20 -0400, David Malcolm wrote: > This patch is 110KB in size, so to avoid mailing-list size limits I've > uploaded it to: > > http://dmalcolm.fedorapeople.org/gcc/large-patches/a89d361b4f95dd216e1d29cb44fbaf90372c48b8-0003-Autogenerated-conversion-of-

[PATCH 6/6 v2] Add manual GTY hooks

2013-08-31 Thread David Malcolm
On Fri, 2013-08-30 at 10:04 +0200, Richard Biener wrote: > On Thu, Aug 29, 2013 at 6:20 PM, David Malcolm wrote: > > * gimple.c (gt_ggc_mx (gimple)): New, as required by GTY((user)). > > (gt_pch_nx (gimple)): Likewise. > > (gt_pch_nx (gimple, gt_p

Re: [PATCH 6/6] Add manual GTY hooks

2013-08-31 Thread David Malcolm
On Fri, 2013-08-30 at 10:09 +0200, Richard Biener wrote: > On Thu, Aug 29, 2013 at 9:44 PM, Steven Bosscher > wrote: > > On Thu, Aug 29, 2013 at 6:20 PM, David Malcolm wrote: > >> * gimple.c (gt_ggc_mx (gimple)): New, as required by GTY((user)). > >&

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-09-03 Thread David Malcolm
On Mon, 2013-09-02 at 13:44 +0200, Michael Matz wrote: > Hi, > > On Fri, 30 Aug 2013, David Malcolm wrote: > > > Here's the result of a pair of builds of r202029 without and with the > > patches, configured with --enable-checking=release, running "make

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-09-03 Thread David Malcolm
On Mon, 2013-09-02 at 13:44 +0200, Michael Matz wrote: > Hi, > > On Fri, 30 Aug 2013, David Malcolm wrote: > [...] > > > And the manual GTY markers are so not maintainable in the long run, > > > gengtype or something else really needs to be taught to cr

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-09-03 Thread David Malcolm
On Mon, 2013-09-02 at 14:35 +0200, Martin Jambor wrote: > Hi, > > On Fri, Aug 30, 2013 at 03:21:22PM -0400, David Malcolm wrote: > > Apart from the GTY aspect, how do people feel about the patch series? > > FWIW I have vague thoughts about doing something similar for tree

Re: [PATCH 6/6] Add manual GTY hooks

2013-09-04 Thread David Malcolm
On Sat, 2013-08-31 at 19:27 +0200, Richard Biener wrote: > David Malcolm wrote: > >On Fri, 2013-08-30 at 10:09 +0200, Richard Biener wrote: > >> On Thu, Aug 29, 2013 at 9:44 PM, Steven Bosscher > > wrote: > >> > On Thu, Aug 29, 2013 at 6:20 PM, David Malcolm &

[PATCH v2 1/6] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-09 Thread David Malcolm
This patch is the handwritten part of the conversion of these types to C++; it requires the followup patch, which is autogenerated. It converts: struct GTY(()) symtab_node_base to: class GTY((user)) symtab_node_base and converts: struct GTY(()) cgraph_node to: struct GTY((user)) cgraph_no

[PATCH v2 2/6] Automated conversion of symtab to class hierarchy

2013-09-09 Thread David Malcolm
This patch is 439KB in size, so to avoid mailing-list limitations I've uploaded it to: http://dmalcolm.fedorapeople.org/gcc/large-patches/fd607e77883b8d3f8fb7c8091d0626dbbd31b9a5-0002-Automated-conversion-of-symtab-to-class-hierarchy.patch ChangeLog entry and diffstat follow: gcc/ Patch

[PATCH v2 6/6] Update hand-written GTY routines for type renaming

2013-09-09 Thread David Malcolm
* cgraph.c (gt_ggc_mx): Update for renaming of symtab_node_base to symtab_node (gt_pch_nx): Likewise. --- gcc/cgraph.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/cgraph.c b/gcc/cgraph.c index bb2626d..abbffa1 100644 --

[PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.

2013-09-09 Thread David Malcolm
de to compile. I've successfully bootstrapped: patches (1+2) and all 6 patches together on top of r202339 on x86_64-unknown-linux-gnu. For both builds all tests showed the same test results as an unpatched bootstrap of r202339. OK for trunk? David Malcolm (6): Convert symtab, cg

[PATCH v2 3/6] Split symtab_node declarations onto multiple lines

2013-09-09 Thread David Malcolm
Amongst other things, the rename_symtab.py script converts "symtab_node" to "symtab_node *". This will lead to broken code on declarations that declare more than one variable (only the first would get a "*"), so split up such declarations. gcc/ * cgraphunit.c (analyze_functions): Split sy

[PATCH v2 4/6] Remove symtab_node and const_symtab_node typedefs.

2013-09-09 Thread David Malcolm
gcc/ * ipa-ref.h (symtab_node): Remove typedef to pointer type, as it clashes with the preferred name for the base class. (const_symtab_node): Remove redundant typedef. --- gcc/ipa-ref.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/ipa-ref.h b/gcc/ipa-ref.h ind

Re: [PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.

2013-09-10 Thread David Malcolm
On Tue, 2013-09-10 at 14:52 +0200, Jan Hubicka wrote: > > Here's version 2 of this patch series. [...] > > The remaining 4 patches rename some types: > > > > "symtab_node_base" becomes "symtab_node" (Honza's preferred name, AIUI). > > > > This would clash with the pre-existing "symtab_node", whic

Re: [PATCH v2 1/6] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-17 Thread David Malcolm
On Tue, 2013-09-10 at 15:34 +0200, Jan Hubicka wrote: Thanks for reviewing this, and sorry for the late response (I lost most of last week to illness). Some questions inline below... > > This patch is the handwritten part of the conversion of these types > > to C++; it requires the followup patc

[PATCH 2/3] Handle simple inheritance in gengtype.

2013-09-20 Thread David Malcolm
Treat GTY structs that have a "desc" as being the root of an inheritance hierarchy. Generate a switch on desc within the marking function with cases for each subclass, visiting all fields of the type (including inherited ones). Don't create marking functions for subclasses, instead using the base

[PATCH 3/3] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-20 Thread David Malcolm
This patch is the handwritten part of the conversion of these types to C++; it requires the followup patch, which is autogenerated. It converts: struct symtab_node_base to: class symtab_node_base and converts: struct cgraph_node to: struct cgraph_node : public symtab_node_base and: stru

[PATCH 1/3] Parse base classes for GTY-marked types

2013-09-20 Thread David Malcolm
Extend gengtype (and gtype.state reading/writing) so that it is able to parse base classes in simple cases, and only attempt to do it for GTY-marked types. * gengtype-parse.c (require_without_advance): New. (type): For GTY-marked types, parse any base classes, requiring the

[PATCH 0/3] Support some cases of inheritance in gengtype; use it for symtab

2013-09-20 Thread David Malcolm
_sharing_asm_name); gt_ggc_m_16symtab_node_base ((*sub).same_comdat_group); gt_ggc_m_20vec_ipa_ref_t_va_gc_ ((*sub).ref_list.references); gt_ggc_m_9tree_node ((*sub).alias_target); gt_ggc_m_18lto_file_decl_data ((*sub).lto_file_data); } b

Re: gimple build interface

2013-09-23 Thread David Malcolm
On Mon, 2013-09-23 at 12:21 -0400, Andrew MacLeod wrote: > On 09/20/2013 04:08 AM, Richard Biener wrote: > > On Thu, Sep 19, 2013 at 6:56 PM, Andrew MacLeod wrote: > >> On 09/19/2013 09:24 AM, Andrew MacLeod wrote: > >>> > >>> I think this is of most use to ssa passes that need to construct code >

[PATCH v2 1/4] Ignore access-control keywords when parsing fields.

2013-09-24 Thread David Malcolm
Classes containing access-control keywords such as "public:" confuse struct_field_seq, leading it to call consume_until_eos i.e. ignore text until after the next semicolon. This leads to the first field after an access-control keyword being ignored by gengtype. This can be seen in: http://gcc.g

[PATCH v2 0/4] Support some cases of inheritance in gengtype

2013-09-24 Thread David Malcolm
h port symtab/cgraph/varpool to use this machinery. OK for trunk? David Malcolm (4): Ignore access-control keywords when parsing fields. Parse base classes for GTY-marked types Handle simple inheritance in gengtype. Add documentation about gengtype and inheritance gcc/doc/gty.t

[PATCH v2 4/4] Add documentation about gengtype and inheritance

2013-09-24 Thread David Malcolm
gcc/ * doc/gty.texi (GTY Options): Add note about inheritance to description of desc and tag. (Inheritance and GTY): New. --- gcc/doc/gty.texi | 52 1 file changed, 52 insertions(+) diff --git a/gcc/doc/gty.texi b/gcc/do

[PATCH v2 2/4] Parse base classes for GTY-marked types

2013-09-24 Thread David Malcolm
Extend gengtype (and gtype.state reading/writing) so that it is able to parse base classes in simple cases, and only attempt to do it for GTY-marked types. * gengtype-parse.c (require_without_advance): New. (type): For GTY-marked types that are not GTY((user)), parse any ba

[PATCH v2 3/4] Handle simple inheritance in gengtype.

2013-09-24 Thread David Malcolm
Treat GTY structs that have a "desc" as being the root of an inheritance hierarchy. Generate a switch on desc within the marking function with cases for each subclass, visiting all fields of the type (including inherited ones). Don't create marking functions for subclasses, instead using the base

Re: [PATCH 0/3] Support some cases of inheritance in gengtype; use it for symtab

2013-09-24 Thread David Malcolm
On Mon, 2013-09-23 at 13:19 +0200, Richard Biener wrote: > On Fri, Sep 20, 2013 at 4:05 PM, David Malcolm wrote: > > There have been various discussions about how to handle inheritance > > within ggc and PCH: whether to extend gengtype to support C++ syntax > > such as tem

Re: [PATCH] libgccjit.so: an embeddable JIT-compiler based on GCC

2013-10-03 Thread David Malcolm
On Wed, 2013-10-02 at 21:32 -0400, David Malcolm wrote: [...] > FWIW I > also have the beginnings of Python bindings for the library (doing the > interface as pure C makes language-bindings easier), though that would > probably live in a separate repository (so not part of this p

Re: [PATCH] libgccjit.so: an embeddable JIT-compiler based on GCC

2013-10-03 Thread David Malcolm
On Thu, 2013-10-03 at 21:42 +, Joseph S. Myers wrote: > On Wed, 2 Oct 2013, David Malcolm wrote: > > > The idea is that GCC is configured with a special --enable-host-shared > > option, which leads to it being built as position-independent code. You > > would config

Re: [PATCH] libgccjit.so: an embeddable JIT-compiler based on GCC

2013-10-03 Thread David Malcolm
On Wed, 2013-10-02 at 21:32 -0400, David Malcolm wrote: [...] > Shall I get this into a "jit" branch? I greatly prefer git to svn, so > I'd probably do: > http://gcc.gnu.org/wiki/GitMirror#Git-only_branches > assuming that this allows a sane path to (I hope) eventu

Re: New attribute: returns_nonnull

2013-10-07 Thread David Malcolm
On Mon, 2013-10-07 at 16:17 +0200, Marc Glisse wrote: > Hello, > > this patch adds an attribute to let the compiler know that a function > never returns NULL. I saw some ECF_* flags, but the attribute seems > sufficient. I considered using nonnull(0), but then it would have been > confusing tha

Re: Attribute returns_null (was: New attribute: returns_nonnull)

2013-10-07 Thread David Malcolm
On Mon, 2013-10-07 at 19:51 +0200, Marc Glisse wrote: > On Mon, 7 Oct 2013, David Malcolm wrote: > > > On Mon, 2013-10-07 at 16:17 +0200, Marc Glisse wrote: > >> Hello, > >> > >> this patch adds an attribute to let the compiler know that a function > >

Re: [PATCH] libgccjit.so: an embeddable JIT-compiler based on GCC

2013-10-07 Thread David Malcolm
On Wed, 2013-10-02 at 21:32 -0400, David Malcolm wrote: [...] > * I'm running into configure/Makefile issues with > --enable-host-shared, where CFLAGS contains -fPIC, but only on > invocations of leaf Makefiles, not on recursive "make" - so it works if > you cd into

Re: [PATCH] libgccjit.so: an embeddable JIT-compiler based on GCC

2013-10-07 Thread David Malcolm
On Fri, 2013-10-04 at 15:00 +, Joseph S. Myers wrote: > On Thu, 3 Oct 2013, David Malcolm wrote: > > > Right now all you get back from the result is a "void*" which you're > > meant to cast to machine code for the CPU. I guess we could add an > > And

[PATCH] Fix memory leak within ipa_inline

2013-10-09 Thread David Malcolm
Seen using valgrind; I've already committed this on my dmalcolm/jit branch as: http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=8c61655effbb29cba2cc342c35bd47a6dda2df16 ) commit 090cc42be462de08068014ce371fb68d15945f8e Author: David Malcolm Date: Wed Oct 9 13:50:23 2013 -0400 ipa-inline.c:

coverage.c: Fix leak of da_file_name

2013-10-09 Thread David Malcolm
regtested against trunk on x86_64-unknown-linux. OK for trunk? (Seen using valgrind; I've already committed this on my dmalcolm/jit branch as: http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=963eb9c93e3e599ff577f9c3a19c6ccdcc9779c5 ) commit 88e2ca9c4f0e031bd1479840e4e1739ca4457ab3 Author:

[PATCH] Add --enable-host-shared configuration option

2013-10-09 Thread David Malcolm
My JIT branch requires embedding GCC's code as a shared library on the host. To do requires building the host code as position-independent, which unfortunately incurs a small speed hit. Hence we need a configuration option, so that you can opt-in to position-independent host code. This patch add

[PATCH 1/2] Handwritten part of conversion of IPA pass hooks to virtual functions

2013-10-09 Thread David Malcolm
* passes.c (ipa_opt_pass_d::generate_summary): New. (ipa_opt_pass_d::write_summary): New. (ipa_opt_pass_d::read_summary): New. (ipa_opt_pass_d::write_optimization_summary): New. (ipa_opt_pass_d::read_optimization_summary): New. (ipa_opt_pass_d::stmt_f

[PATCH 0/2] Convert IPA pass hooks to virtual functions

2013-10-09 Thread David Malcolm
me repository: test_refactor_ipa_passes.py Successfully bootstrapped and regtesting on x86_64-unknown-linux. OK for trunk? David Malcolm (2): Handwritten part of conversion of IPA pass hooks to virtual functions Automated conversion of IPA passes to new API gcc/ipa-cp.c

[PATCH 2/2] Automated conversion of IPA passes to new API

2013-10-09 Thread David Malcolm
gcc/ Patch autogenerated by refactor_ipa_passes.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 9518113a5604ede755ea1dc1f073a1863f5a6de5 * ipa-cp.c (pass_ipa_cp): Convert to new API for IPA passes. * ipa-devirt.c (pass_ipa_devirt):

Re: coverage.c: Fix leak of da_file_name

2013-10-10 Thread David Malcolm
On Wed, 2013-10-09 at 19:56 -0700, Ian Lance Taylor wrote: > On Wed, Oct 9, 2013 at 5:18 PM, David Malcolm wrote: > > coverage_init allocates da_file_name using XNEWVEC, but it is never > > freed. This shows up as a slow memory leak in my JIT code when > > repeatedly invok

Re: [PATCH] Fix memory leak within ipa_inline

2013-10-10 Thread David Malcolm
On Thu, 2013-10-10 at 09:53 +0200, Richard Biener wrote: > On Thu, Oct 10, 2013 at 2:10 AM, David Malcolm wrote: > > ipa-inline.c:ipa_inline leaks "order" when optimizations are disabled. > > This potentially becomes significant in my JIT branch since the > > co

Re: Apply attribute returns_nonnull in libiberty

2013-10-11 Thread David Malcolm
On Fri, 2013-10-11 at 19:53 +0200, Marc Glisse wrote: > With the patch now... [...] > -extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL; > +extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL > ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURNS_NONNULL; An aesthet

Re: [PATCH] Add --enable-host-shared configuration option

2013-10-11 Thread David Malcolm
On Thu, 2013-10-10 at 01:05 +, Joseph S. Myers wrote: > On Wed, 9 Oct 2013, David Malcolm wrote: > > > This patch adds an "--enable-host-shared" option throughout the various > > configure/Make machinery for host code, adding "-fPIC" where appropriate

Re: [PATCH] Add --enable-host-shared configuration option

2013-10-11 Thread David Malcolm
On Fri, 2013-10-11 at 20:45 +, Joseph S. Myers wrote: > On Fri, 11 Oct 2013, David Malcolm wrote: > > > On Thu, 2013-10-10 at 01:05 +, Joseph S. Myers wrote: > > > On Wed, 9 Oct 2013, David Malcolm wrote: > > > > > > > This patch adds an &q

[PATCH] Introduce gcc::dump_manager class

2013-10-11 Thread David Malcolm
When repeatedly compiling within one process, the dumpfile numbering doesn't reset, leading to dumpfiles after the initial ones having unpredictable numbers like here (-fdump-tree-all at -O0): fake.c.000i.cgraph fake.c.004t.gimple fake.c.1477t.omplower fake.c.1478t.lowe

Re: [PATCH] Introduce gcc::dump_manager class

2013-10-14 Thread David Malcolm
On Mon, 2013-10-14 at 12:13 +0200, Richard Biener wrote: > On Sat, Oct 12, 2013 at 3:31 AM, David Malcolm wrote: > > When repeatedly compiling within one process, the dumpfile numbering > > doesn't reset, leading to dumpfiles after the initial ones having > > unpre

[jit] Implement source code location support (API change)

2013-10-14 Thread David Malcolm
it +++ b/gcc/jit/ChangeLog.jit @@ -1,3 +1,61 @@ +2013-10-14 David Malcolm + + * internal-api.c (gcc::jit::context::new_field): Implement + location support, by calling set_tree_location. + (gcc::jit::context::new_struct_type): Likewise. + (gcc::jit::context::new_

[jit] libgccjit.map: Sort the symbols alphabetically

2013-10-14 Thread David Malcolm
/jit/ChangeLog.jit +++ b/gcc/jit/ChangeLog.jit @@ -1,5 +1,9 @@ 2013-10-14 David Malcolm + * libgccjit.map: Alphabetize the exported symbols. + +2013-10-14 David Malcolm + * internal-api.c (gcc::jit::context::new_field): Implement location support, by calling

[jit] jit.exp: Detect compilation errors

2013-10-14 Thread David Malcolm
/ChangeLog.jit +++ b/gcc/testsuite/ChangeLog.jit @@ -1,5 +1,10 @@ 2013-10-14 David Malcolm + * jit.dg/jit.exp (jit-dg-test): Detect compilation errors and + make them be test failures. + +2013-10-14 David Malcolm + * jit.dg/test-factorial.c (code_making_callback): Update

Re: [PATCH] Add --enable-host-shared configuration option

2013-10-15 Thread David Malcolm
On Tue, 2013-10-15 at 10:29 -0600, Jeff Law wrote: > On 10/09/13 18:25, David Malcolm wrote: [...] > Presumably other host libraries we depend on such as gmp, mpc, etc are > available in shared (or at least PIC) form as well? Obviously these are > out of our source tree and largel

[jit] Update TODO for jit.

2013-10-15 Thread David Malcolm
/ChangeLog.jit @@ -1,3 +1,7 @@ +2013-10-15 David Malcolm + + * TODO.rst: Update. + 2013-10-14 David Malcolm * libgccjit.map: Alphabetize the exported symbols. diff --git a/gcc/jit/TODO.rst b/gcc/jit/TODO.rst index 65d4dc8..feb4d2b 100644 --- a/gcc/jit/TODO.rst +++ b/gcc/jit/TODO.rst

[jit] Improvements to documentation.

2013-10-15 Thread David Malcolm
ex 18101f1..da3e75a 100644 --- a/gcc/jit/ChangeLog.jit +++ b/gcc/jit/ChangeLog.jit @@ -1,5 +1,13 @@ 2013-10-15 David Malcolm + * libgccjit.h (gcc_jit_location): Rewrite comment to reflect + that this part of the API is now implemented. + ("Functions for use within the code

Re: [PATCH v2 1/4] Ignore access-control keywords when parsing fields.

2013-10-16 Thread David Malcolm
On Tue, 2013-10-15 at 12:36 -0600, Jeff Law wrote: > On 09/24/13 11:49, David Malcolm wrote: [...] > > * gengtype-parse.c (struct_field_seq): Ignore access-control > > keywords ("public:" etc). > OK. Thanks; committed to trunk as r203708.

<    3   4   5   6   7   8   9   10   11   12   >