Running cc1 etc under valgrind (was Re: [PATCH 13/21] PR jit/63854: Add support for running "make check-jit" under valgrind)

2014-11-19 Thread David Malcolm
On Wed, 2014-11-19 at 09:57 -0700, Jeff Law wrote: > On 11/19/14 03:46, David Malcolm wrote: > > This commit updates jit.exp so that if RUN_UNDER_VALGRIND is present > > in the environment, all of the built client code using libgccjit.so is > > run under valgrind, w

Re: [PATCH 10/21] PR jit/63854: Fix leak of worklist within jit-recording.c

2014-11-19 Thread David Malcolm
On Wed, 2014-11-19 at 09:59 -0700, Jeff Law wrote: > On 11/19/14 03:46, David Malcolm wrote: > > Fix this leak: > > > > 160 bytes in 5 blocks are definitely lost in loss record 154 of 228 > > at 0x4A0645D: malloc (in > > /usr/lib64/valgrind/vgpreload_me

Re: "gimple-classes-v2-option-3" git branch committed to svn trunk as r217787

2014-11-19 Thread David Malcolm
On Wed, 2014-11-19 at 22:36 +0100, Richard Biener wrote: > On November 19, 2014 10:09:56 PM CET, Andrew MacLeod > wrote: > >On 11/19/2014 03:43 PM, Richard Biener wrote: > >> On November 19, 2014 8:26:23 PM CET, Andrew MacLeod > > wrote: > >>> On 1

Re: "gimple-classes-v2-option-3" git branch committed to svn trunk as r217787

2014-11-19 Thread David Malcolm
On Wed, 2014-11-19 at 17:24 -0500, David Malcolm wrote: > On Wed, 2014-11-19 at 22:36 +0100, Richard Biener wrote: > > On November 19, 2014 10:09:56 PM CET, Andrew MacLeod > > wrote: > > >On 11/19/2014 03:43 PM, Richard Biener wrote: > > >> On November 19,

[PATCH] PR jit/63969: Fix segfault in error-handling when driver isn't found

2014-11-19 Thread David Malcolm
K for trunk? >From 0901383f1a1ad296b939687298b8321446bc54e3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 20 Nov 2014 01:06:14 -0500 Subject: [PATCH] PR jit/63969: Fix segfault in error-handling when driver isn't found If the driver isn't found on the path, pex_one attempts

Re: [PATCH] PR jit/63969: Fix segfault in error-handling when driver isn't found

2014-11-20 Thread David Malcolm
On Wed, 2014-11-19 at 23:09 -0800, Mike Stump wrote: > On Nov 19, 2014, at 10:23 PM, David Malcolm > wrote: > > It's not clear to me if I can approve my own patches to the jit > > So, to answer that, we look at MAINTAINERS, and look up your name: > >

Re: [RFC] First steps towards segregating types.

2014-11-21 Thread David Malcolm
On Fri, 2014-11-21 at 21:13 +0100, Richard Biener wrote: > On November 21, 2014 8:45:09 PM CET, Diego Novillo > wrote: > >On Fri, Nov 21, 2014 at 1:48 PM, Andrew MacLeod > >wrote: > > > >> 1 - introduce a TYPE_REF tree node, which is effectively just a > >'typed' tree > >> node, and the TREE_TYPE

Re: [PATCH] mn10300: Fix an ICE

2014-11-25 Thread David Malcolm
On Tue, 2014-11-25 at 10:15 -0700, Jeff Law wrote: > On 11/25/14 10:14, Segher Boessenkool wrote: > > On Tue, Nov 25, 2014 at 09:44:35AM -0700, Jeff Law wrote: > >> On 11/24/14 20:37, Segher Boessenkool wrote: > >>> `lcc' is not an insn but just a pattern. This caused a build error in > >>> libgcc

[PATCH 00/05] Fixes to jit.exp

2014-11-25 Thread David Malcolm
Various fixes/improvements to jit.exp Successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk? (am not yet officially blessed as the JIT maintainer, so I require review for the non-obvious patches)

[PATCH 00/05] Fixes to jit.exp

2014-11-25 Thread David Malcolm
Various fixes/improvements to jit.exp Successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk? (am not yet officially blessed as the JIT maintainer, so I require review for the non-obvious patches)

[PATCH 03/05] jit.exp: fix timeout bug inherited from dejagnu.exp

2014-11-25 Thread David Malcolm
DejaGnu's host_execute has an erroneous line that appears to be a merge conflict that went awry followed up by a reindent, and jit.exp has inherited this bug within "fixed_host_execute". Fix it within jit.exp. Reported to DejaGnu as: http://lists.gnu.org/archive/html/dejagnu/2014-11/msg1.ht

[PATCH 01/05] jit.exp: Avoid embedding full paths into test results

2014-11-25 Thread David Malcolm
This makes it easier to compare jit.sum files from different runs gcc/testsuite/ChangeLog: * jit.dg/jit.exp (jit-dg-test): Use $name rathen than $prog when calling jit_check_compile to avoid embedding the full path of the testcase into the test results. --- gcc/testsuite/j

[PATCH 02/05] PR jit/63854: Add support for running "make check-jit" under valgrind

2014-11-25 Thread David Malcolm
This commit updates jit.exp so that if RUN_UNDER_VALGRIND is present in the environment, all of the built client code using libgccjit.so is run under valgrind, with --leak-check=full. Hence: RUN_UNDER_VALGRIND= make check-jit will run all jit testcases under valgrind (taking 27 mins on my machin

[PATCH 05/05] Add command-line option-parsing to jit testcases

2014-11-25 Thread David Malcolm
Add command-line option-parsing to the testcases, so that we can manipulate them without needing a recompile (e.g. varying optimization levels etc). This uses getopt_long, which is a GNU extension to libc. Is that acceptable? Implement a --num-iterations option, to override the default of 5. Wh

[PATCH 04/05] jit.exp: Verify the exit status of the spawnee

2014-11-25 Thread David Malcolm
gcc/testsuite/ChangeLog: * jit.dg/jit.exp (verify_exit_status): New function. (fixed_host_execute): Verify the exit status of the spawnee. --- gcc/testsuite/jit.dg/jit.exp | 30 ++ 1 file changed, 30 insertions(+) diff --git a/gcc/testsuite/jit.dg/jit.e

[PATCH 00/08] More memory leak fixes

2014-11-25 Thread David Malcolm
Various fixes/improvements to jit.exp Successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk?

[PATCH 01/08] PR jit/63854: Fix leak in tree-ssa-math-opts.c

2014-11-25 Thread David Malcolm
Running testsuite/jit.dg/test-functions.c under valgrind showed this leak (amongst others): 400 bytes in 10 blocks are definitely lost in loss record 142 of 181 at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x5DCDF2F: xrealloc (xmalloc.c:177) by 0x537

[PATCH 02/08] PR jit/63854: Fix leak within jit-builtins.c

2014-11-25 Thread David Malcolm
Running testsuite/jit.dg/test-functions.c under valgrind showed this leak (amongst others): 520 (320 direct, 200 indirect) bytes in 5 blocks are definitely lost in loss record 144 of 181 at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by

[PATCH 03/08] PR jit/63854: Fix leak in real.c for i386:init_ext_80387_constants

2014-11-25 Thread David Malcolm
Valgrind of testsuite/jit.dg/test-types.c showed this leak in real.c when converting the strings in init_ext_80387_constants to real. 160 bytes in 5 blocks are definitely lost in loss record 89 of 144 at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x30AF4

[PATCH 05/08] PR jit/63854: Fix double-initialization within tree-pretty-print.c

2014-11-25 Thread David Malcolm
Running various JIT testcases under valgrid showed this one-time leak: 8,464 (336 direct, 8,128 indirect) bytes in 1 blocks are definitely lost in loss record 144 of 147 at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x5DF4EA0: xcalloc (xmalloc.c:162)

[PATCH 04/08] PR jit/63854: Remove xstrdup from ipa/cgraph fprintf calls

2014-11-25 Thread David Malcolm
cgraph*.c and ipa-*.c use xstrdup on strings when dumping them via fprintf, leaking all of the duplicated buffers. Is/was there a reason for doing this? Taking them out fixes these leaks (seen when dumping is enabled): 12 bytes in 1 blocks are definitely lost in loss record 11 of 148 at 0x4A0645

[PATCH 07/08] PR jit/63854: Fix leaks in toyvm.c

2014-11-25 Thread David Malcolm
Introduce a struct toyvm_compiled_function so that we can clean things up fully, avoiding warnings from valgrind. gcc/jit/ChangeLog: PR jit/63854 (toyvm_compiled_function): New typedef. (toyvm_compiled_func) Rename to... (toyvm_compiled_code) ...this. (struc

[PATCH 08/08] PR/64003 workaround (uninit memory in i386.md)

2014-11-25 Thread David Malcolm
I suspect this is papering over a real problem, but I've been applying this workaround locally to keep my valgrind output clean. gcc/ChangeLog: PR/64003 * final.c (shorten_branches): Allocate insn_lengths with XCNEWVEC rather than XNEWVEC; remove subsequent per-element

[PATCH 06/08] Avoid overuse of name "buffer" in tree-pretty-print.c

2014-11-25 Thread David Malcolm
Various functions in tree-pretty-print.c take a param pretty_printer *buffer and there's also a static pretty_printer *buffer; Additionally, pretty_printer instances are not buffers; they *contain* buffers (inasmuch as they have a field "buffer"). This patch renames such params from "buffer" to

[PATCH 03/03] jit-playback: Move dso-creation into its own function

2014-11-25 Thread David Malcolm
Continue to refactor playback::context::compile, moving the DSO-generation into its own function. gcc/jit/ChangeLog: * jit-playback.c (gcc::jit::playback::context::compile): Move DSO creation code into... (gcc::jit::playback::context::convert_to_dso): New function.

[PATCH 00/03] JIT refactoring

2014-11-25 Thread David Malcolm
Various cleanups of the jit code Successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk? (am not yet officially blessed as the JIT maintainer, so I require review for the non-obvious patches)

[PATCH 01/03] Move gcc_jit_result implementation to a new files jit-result.{h|c}

2014-11-25 Thread David Malcolm
a/gcc/jit/jit-result.c b/gcc/jit/jit-result.c new file mode 100644 index 000..9e1e6d8 --- /dev/null +++ b/gcc/jit/jit-result.c @@ -0,0 +1,73 @@ +/* Internals of libgccjit: implementation of gcc_jit_result + Copyright (C) 2013-2014 Free Software Foundation, Inc. + Contributed by David Malcolm

[PATCH 02/03] jit-playback: Move argv-creation to its own function

2014-11-25 Thread David Malcolm
The body of playback::context::compile is rather long, at 200 lines. Start splitting it out parts of it into smaller member functions. Also, eliminate a fixed-size buffer with bounds check in favor of an auto_vec<>. gcc/jit/ChangeLog: * jit-playback.c (gcc::jit::playback::context::compil

[PATCH 02/02] Improvements to documentation of gcc_jit_context_release

2014-11-25 Thread David Malcolm
gcc/jit/ChangeLog: * docs/examples/tut02-square.c (main): Release the context earlier, to show that this is possible. Update error-handling to avoid a double-release of the context, and to avoid releasing a NULL result. * docs/intro/tutorial02.rst: Discuss g

[PATCH 00/02] Improvements to jit documentation

2014-11-25 Thread David Malcolm
Various improvements to jit documentation Touches one of the tutorial examples, which is also used as part of the testsuite: successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk? (am not yet officially blessed as the JIT maintainer, so I require review for

[PATCH 01/02] PR jit/64018: Add description of error-handling to the JIT tutorial

2014-11-25 Thread David Malcolm
gcc/jit/ChangeLog: PR jit/64018 * docs/intro/tutorial02.rst: Spell out lifetime of generated code. Add description of error-handling, taken in part from... * docs/topics/contexts.rst (Error-handling): Expand, and move some content to tutorial02.rst. --- gcc/

[PATCH 00/02] jit: Fixes to builtins handling

2014-11-25 Thread David Malcolm
Various fixes/improvements to builtins-handling within jit. Successfully bootstrapped & regrtested on x86_64-unknown-linux-gnu (Fedora 20). OK for trunk? (am not yet officially blessed as the JIT maintainer, so I require review for the non-obvious patches)

[PATCH 01/02] jit-builtins.c: Fix segfault on unsupported builtins

2014-11-25 Thread David Malcolm
jit-builtins.c only supports a subset of builtin-types.def, and can fail if the user requests a builtin that uses the unsupported types. Whilst fixing PR jit/64020 I noticed that these failures read through NULL and segfault. Fix it by checking for get_type and make_builtin_function returning NUL

[PATCH 02/02] PR jit/64020: Fixes to handling of builtins

2014-11-25 Thread David Malcolm
Investigating PR jit/64020 showed that tree-ssa-math-opts.c was failing to optimize sin/cos operations within the JIT since this: fndecl = mathfn_built_in (type, BUILT_IN_CEXPI); was returning NULL. Several issues were present: (A) In the JIT we don't pre-build all builtins, just the ones that

Re: [PATCH 04/08] PR jit/63854: Remove xstrdup from ipa/cgraph fprintf calls

2014-11-26 Thread David Malcolm
On Wed, 2014-11-26 at 09:13 +0100, Uros Bizjak wrote: > Hello! > > > cgraph*.c and ipa-*.c use xstrdup on strings when dumping them via > > fprintf, leaking all of the duplicated buffers. > > > > Is/was there a reason for doing this? > > Yes, please see [1] and PR 53136 [2]. As said in [1]: > >

PING Re: [PATCH 19/21] PR jit/63854: Fix leak of ipa hooks

2014-12-01 Thread David Malcolm
On Wed, 2014-11-19 at 12:58 -0700, Jeff Law wrote: > On 11/19/14 03:46, David Malcolm wrote: > > This fixes three leaks in IPA seen in jit testcases with valgrind: > > > > This one: > > 96 bytes in 4 blocks are definitely lost in loss record 102 of 205 > > a

Re: [PATCH 08/08] PR/64003 workaround (uninit memory in i386.md)

2014-12-02 Thread David Malcolm
On Wed, 2014-11-26 at 10:41 -0700, Jeff Law wrote: > On 11/25/14 18:39, David Malcolm wrote: > > I suspect this is papering over a real problem, but I've been > > applying this workaround locally to keep my valgrind output clean. > > > > gcc/ChangeLog: &g

[PATCH] Update docs to reflect use of gimple subclasses

2014-12-02 Thread David Malcolm
On Tue, 2014-12-02 at 08:49 +0100, Jakub Jelinek wrote: Hi! > > Here is an attempt to adjust gimple_build_assign* documentation. > Ok for trunk? > > Note, apparently the documentation has not been adjusted for > the gimple -> gassign * etc. changes, David, can you please work on > adjusting gimpl

Re: re-build problem with ln -s

2014-12-03 Thread David Malcolm
On Mon, 2014-12-01 at 19:31 -0500, Ulrich Drepper wrote: > I think the jit patches introduced a problem when you rebuild within a > directory that contains an old build (i.e., no brand new build > directory). The gcc/Makefile creates a symlink for xgcc with the full > driver name without first re

Re: [Ada] convert GNAT doc to sphinx

2015-02-26 Thread David Malcolm
On Wed, 2015-02-25 at 16:47 +0100, Arnaud Charlet wrote: > > > I've added a -I gcc/gcc/ada/doc/gnat_ugn there, that's as far as my > > > knowledge goes for this script so I hope this is enough. > > > > Well, since by default the find command deletes all files except those > > known to be documenta

[PING] [wwwdocs, patch] Add libgccjit to gcc-5/changes.html

2015-02-26 Thread David Malcolm
On Thu, 2015-02-05 at 21:47 -0500, David Malcolm wrote: > This patch adds an -level section about libgccjit between the > sections on languages and targets. > > It has various links to the documentation (now that that's on the > website), and to a couple of 3rd party rep

[RFC/patch for stage1] Embed compiler dumps into generated .o files (was Re: Obscure crashes due to gcc 4.9 -O2 => -fisolate-erroneous-paths-dereference)

2015-02-27 Thread David Malcolm
On Thu, 2015-02-26 at 11:17 -0500, David Malcolm wrote: > On Fri, 2015-02-20 at 10:29 -0700, Jeff Law wrote: > > On 02/19/15 14:56, Chris Johns wrote: > > > On 20/02/2015 8:23 am, Joel Sherrill wrote: > > >> > > >> On 2/19/2015 2:56 PM, Sandra Lo

Re: [wwwdocs, patch] Add libgccjit to gcc-5/changes.html

2015-03-02 Thread David Malcolm
On Fri, 2015-02-27 at 01:06 +0100, Gerald Pfeifer wrote: > Hi David, > > On Thu, 5 Feb 2015, David Malcolm wrote: > > This patch adds an -level section about libgccjit > > between the sections on languages and targets. > > this is a very nice idea. > >

[PATCH, committed] jit documentation fixes

2015-03-05 Thread David Malcolm
On Thu, 2015-03-05 at 07:37 +0100, Bert Wesarg wrote: > Hi David, > > while reading the very good tutorial at > > https://gcc.gnu.org/onlinedocs/jit/intro/tutorial03.html > > I noticed that the calls to gcc_jit_block_end_with_conditional() > misses the on_true and on_false parameters. Good cat

[PATCH] jit docs: Add "Packaging notes" section

2015-03-13 Thread David Malcolm
On Wed, 2015-03-04 at 11:09 -0500, David Malcolm wrote: > On Tue, 2015-03-03 at 11:49 +0100, Matthias Klose wrote: > > Both gccjit and gnat now use sphinx to build the documentation. While not a > > direct part of the build process, it would be nice to document the > > requi

Re: [PATCH, jit]: Robustify vasprintf error checks

2015-03-13 Thread David Malcolm
On Fri, 2015-03-13 at 17:53 +0100, Uros Bizjak wrote: > Hello! > > As documented in [1] asprintf and vasprintf return: > > --quote-- > Return value: > > Both functions set *ret to be a pointer to a malloc()'d buffer > sufficiently large to hold the formatted string. This pointer should > be pass

[RFC, stage1] Richer source location information for gcc 6 (location ranges etc)

2015-03-16 Thread David Malcolm
I've been experimenting with revamping our diagnostics to better show source locations. Some of the ideas are inspired by Clang's diagnostics, but I'm going beyond what it does in some areas. I'm attaching a patch (against r221423), which is very much a work-in-progress, but in a "release early,

[PATCH, stage1] Better error recovery for merge-conflict markers

2015-03-20 Thread David Malcolm
@@ COMPILER_FLAGS = $(ALL_CXXFLAGS) DEPMODE = $(CXXDEPMODE) -libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \ - expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \ +libcpp_a_OBJS = charset.o conflict-markers.o directives.o directives-only.o \ + errors.

Re: [PATCH] Make split_block and create_basic_block type-safe

2015-03-20 Thread David Malcolm
On Thu, 2015-03-12 at 14:20 +0100, Richard Biener wrote: > After noticing tree-parloop.c passing crap to split_block (a tree > rather than a gimple or an rtx) I noticed those CFG functions simply > take void * pointers. The following patch fixes that and adds > two overloads, one for GIMPLE use an

Re: [patch, fortran, RFC] First steps towards inlining matmul

2015-04-07 Thread David Malcolm
On Sun, 2015-04-05 at 14:32 +0200, Thomas Koenig wrote: > Hello world, > > this is a first draft of a patch to inline matmul (PR 37171). This is (FWIW, the above PR# looks like it should be PR 37131)

[PATCH, committed] PR jit/65691: Fix copy&paste error in jit docs

2015-04-09 Thread David Malcolm
I've committed the following trivial patch to trunk (as r221959). gcc/jit/ChangeLog: PR jit/65691 * docs/cp/topics/expressions.rst (Simple expressions): Fix copy and paste error in description of gccjit::context::one. * docs/topics/expressions.rst (Simple expression

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread David Malcolm
On Sun, 2015-06-07 at 16:06 -0400, Patrick Palka wrote: > This patch refactors the entry point of -Wmisleading-indentation Thanks for working on this. I was hoping to submit a patch to propose putting -Wmisleading-indentation into -Wall, and have been testing the warning on the linux kernel to tr

Re: [patch] [jit] Install headers using INSTALL_DATA

2015-06-09 Thread David Malcolm
On Tue, 2015-06-09 at 18:19 +0200, Matthias Klose wrote: > Install the gcc/jit header files without the x bit set. Ok for the trunk and > the > 5 branch? OK.

[PATCH 00/17] RFC: Addding a unit testing framework to gcc

2015-06-10 Thread David Malcolm
onment tear-down [==] 56 tests from 16 test cases ran. (338 ms total) [ PASSED ] 56 tests. Thoughts? Dave [1] though it's not clear to me if LLVM is actually still using it; see e.g. http://blog.llvm.org/2009/12/lit-it.html [2] the test of chain_next/chain_prev in test-ggc.c, which neede

[PATCH 02/17] Add test-bitmap.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-bitmap.c: New file. --- gcc/unittests/test-bitmap.c | 117 1 file changed, 117 insertions(+) create mode 100644 gcc/unittests/test-bitmap.c diff --git a/gcc/unittests/test-bitmap.c b/gcc/unittests/test-bitmap.c

[PATCH 01/17] Add Make-lang.in and config-lang.in to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * Make-lang.in: New file. * config-lang.in: New file. --- gcc/unittests/Make-lang.in | 200 +++ gcc/unittests/config-lang.in | 34 2 files changed, 234 insertions(+) create mode 100644 gcc/unittests/Make-

[PATCH 03/17] Add test-cfg.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-cfg.c: New file. --- gcc/unittests/test-cfg.c | 319 +++ 1 file changed, 319 insertions(+) create mode 100644 gcc/unittests/test-cfg.c diff --git a/gcc/unittests/test-cfg.c b/gcc/unittests/test-cfg.c new file mod

[PATCH 10/17] Add test-locations.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-locations.c: New file. --- gcc/unittests/test-locations.c | 148 + 1 file changed, 148 insertions(+) create mode 100644 gcc/unittests/test-locations.c diff --git a/gcc/unittests/test-locations.c b/gcc/unittests/test-

[PATCH 12/17] Add test-tree.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-tree.c: New file. --- gcc/unittests/test-tree.c | 102 ++ 1 file changed, 102 insertions(+) create mode 100644 gcc/unittests/test-tree.c diff --git a/gcc/unittests/test-tree.c b/gcc/unittests/test-tree.c new file

[PATCH 09/17] Add test-hash-set.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-hash-set.c: New file. --- gcc/unittests/test-hash-set.c | 54 +++ 1 file changed, 54 insertions(+) create mode 100644 gcc/unittests/test-hash-set.c diff --git a/gcc/unittests/test-hash-set.c b/gcc/unittests/test-hash

[PATCH 11/17] Add test-rtl.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-rtl.c: New file. --- gcc/unittests/test-rtl.c | 94 1 file changed, 94 insertions(+) create mode 100644 gcc/unittests/test-rtl.c diff --git a/gcc/unittests/test-rtl.c b/gcc/unittests/test-rtl.c new file mode

[PATCH 04/17] Add test-folding.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-folding.c: New file. --- gcc/unittests/test-folding.c | 121 +++ 1 file changed, 121 insertions(+) create mode 100644 gcc/unittests/test-folding.c diff --git a/gcc/unittests/test-folding.c b/gcc/unittests/test-foldin

[PATCH 05/17] Add test-functions.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-functions.c: New file. --- gcc/unittests/test-functions.c | 634 + 1 file changed, 634 insertions(+) create mode 100644 gcc/unittests/test-functions.c diff --git a/gcc/unittests/test-functions.c b/gcc/unittests/test-

[PATCH 08/17] Add test-hash-map.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-hash-map.c: New file. --- gcc/unittests/test-hash-map.c | 78 +++ 1 file changed, 78 insertions(+) create mode 100644 gcc/unittests/test-hash-map.c diff --git a/gcc/unittests/test-hash-map.c b/gcc/unittests/test-hash

[PATCH 07/17] Add test-gimple.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-gimple.c: New file. --- gcc/unittests/test-gimple.c | 179 1 file changed, 179 insertions(+) create mode 100644 gcc/unittests/test-gimple.c diff --git a/gcc/unittests/test-gimple.c b/gcc/unittests/test-gimple.c

[PATCH 17/17] toplev.c: move location_adhoc_data_fini call

2015-06-10 Thread David Malcolm
test-functions.c: representation_test.building_cfg and others need the call to location_adhoc_data_fini to happen later, otherwise we get a segfault inside gimple_set_block here due to the adhoc-location data being finalized: #0 0x00687800 in ?? () #1 0x77504c22 in htab_find_sl

[PATCH 16/17] Add unittests-main.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * unittests-main.c: New file. --- gcc/unittests/unittests-main.c | 108 + 1 file changed, 108 insertions(+) create mode 100644 gcc/unittests/unittests-main.c diff --git a/gcc/unittests/unittests-main.c b/gcc/unittests/unitt

[PATCH 13/17] Add test-vec.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-vec.c: New file. --- gcc/unittests/test-vec.c | 162 +++ 1 file changed, 162 insertions(+) create mode 100644 gcc/unittests/test-vec.c diff --git a/gcc/unittests/test-vec.c b/gcc/unittests/test-vec.c new file mod

[PATCH 15/17] Add unittests-frontend.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * unittests-frontend.c: New file. --- gcc/unittests/unittests-frontend.c | 250 + 1 file changed, 250 insertions(+) create mode 100644 gcc/unittests/unittests-frontend.c diff --git a/gcc/unittests/unittests-frontend.c b/gcc/un

[PATCH 06/17] Add test-ggc.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-ggc.c: New file. --- gcc/unittests/test-ggc.c | 292 +++ 1 file changed, 292 insertions(+) create mode 100644 gcc/unittests/test-ggc.c diff --git a/gcc/unittests/test-ggc.c b/gcc/unittests/test-ggc.c new file mod

[PATCH 14/17] Add test-wide-int.c to gcc/unittests

2015-06-10 Thread David Malcolm
gcc/unittests/ChangeLog: * test-wide-int.c: New file. --- gcc/unittests/test-wide-int.c | 186 ++ 1 file changed, 186 insertions(+) create mode 100644 gcc/unittests/test-wide-int.c diff --git a/gcc/unittests/test-wide-int.c b/gcc/unittests/test-wid

Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc

2015-06-10 Thread David Malcolm
On Wed, 2015-06-10 at 17:34 +0200, Jakub Jelinek wrote: > On Wed, Jun 10, 2015 at 11:24:41AM -0400, David Malcolm wrote: > > I picked the Google Test framework: > > http://code.google.com/p/googletest/ > > I must say I'm not very excited about using this, it won&#x

Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc

2015-06-10 Thread David Malcolm
On Wed, 2015-06-10 at 17:34 +0200, Jakub Jelinek wrote: > On Wed, Jun 10, 2015 at 11:24:41AM -0400, David Malcolm wrote: (...snip...) > Also, no matter what testsuite framework is used, including any > headers before #include "config.h" line is a big no-no. The issue was

[PATCH, committed] PR jit/66539: Add parentheses as needed to gcc_jit_object_get_debug_string

2015-06-16 Thread David Malcolm
gcc_jit_object_get_debug_string wasn't adding parentheses, leading to misleading dumps for certain compound expressions. This patch adds: rvalue::get_debug_string_parens rvalue::get_precedence methods, mimicing C's precedence rules, using them in the get_debug_string implementation so that we

[PATCH, committed] PR jit/66539: Properly add testcase

2015-06-16 Thread David Malcolm
This hunk was omitted from r224531. Tested with "make check-jit"; takes jit.sum from 7699 to 7829 passes. Committed to trunk as r224535. gcc/testsuite/ChangeLog: PR jit/66539 * jit.dg/all-non-failing-tests.h: Add test-debug-strings.c to "testcases" array. --- gcc/testsui

[PATCH, committed] jit: Add a test for compound assignment

2015-06-16 Thread David Malcolm
Add a testcase of assignment to structs and unions to the libgccjit testsuite. Tested with "make check-jit"; takes jit.sum from 7829 to 7974 passes. Committed to trunk as r224536. gcc/testsuite/ChangeLog: * jit.dg/all-non-failing-tests.h: Add test-compound-assignment.c. * jit.dg/

[PATCH, committed] jit: Add missing type-checking to gcc_jit_{l|r}value_access_field

2015-06-17 Thread David Malcolm
gcc_jit_rvalue_dereference_field has error-checking to ensure that the field is of the correct struct, but it turned out that gcc_jit_lvalue_access_field and gcc_jit_rvalue_access_field were missing this check, and this just bit a user. Add the missing validation, along with testcases. Takes "mak

[PATCH/RFC]: unittesting v2: as a plugin (was Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc)

2015-06-17 Thread David Malcolm
On Thu, 2015-06-11 at 00:18 +0200, Jakub Jelinek wrote: > On Wed, Jun 10, 2015 at 01:16:20PM -0400, David Malcolm wrote: > > On Wed, 2015-06-10 at 17:34 +0200, Jakub Jelinek wrote: > > > On Wed, Jun 10, 2015 at 11:24:41AM -0400, David Malcolm wrote: > > > > I pi

Re: [PATCH 3/3] Improve -Wmissing-indentation heuristics

2015-06-18 Thread David Malcolm
On Tue, 2015-06-09 at 13:31 -0400, Patrick Palka wrote: > This patch improves the heuristics of the warning in a number of ways. > The improvements are hopefully adequately documented in the code > comments. > > The additions to the test case also highlight the improvements. > > I tested an earli

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-18 Thread David Malcolm
On Thu, 2015-06-18 at 11:41 -0400, Patrick Palka wrote: > On Tue, Jun 9, 2015 at 1:31 PM, Patrick Palka wrote: > > This patch refactors the entry point of -Wmisleading-indentation from: > > > > void > > warn_for_misleading_indentation (location_t guard_loc, > >

Re: [PATCH 03/17] Add test-cfg.c to gcc/unittests

2015-06-25 Thread David Malcolm
On Tue, 2015-06-23 at 13:17 -0600, Jeff Law wrote: > On 06/10/2015 09:24 AM, David Malcolm wrote: > > gcc/unittests/ChangeLog: > > * test-cfg.c: New file. > > --- > > gcc/unittests/test-cfg.c | 319 > > +++ >

[PATCH 1/2] Add gcc/typed-splay-tree.h

2015-06-25 Thread David Malcolm
I found when implementing switch statements for the jit that it was much easier to work with libiberty's splay-tree.h by first wrapping it in a C++ wrapper to add typesafety. This patch adds such a wrapper, implementing the methods I needed. It's unused in this patch, but is used in the followup

[PATCH 2/2] jit: add switch statements

2015-06-25 Thread David Malcolm
Some interpreters/VMs support a switch statement (for example the JVM has opcodes "lookupswitch" and "tableswitch"). GCC has a set of optimizations for efficiently handling switch statements, so it makes sense to directly expose switch statements in the libgccjit API. This patch implements a swit

Re: [PATCH 2/2] jit: add switch statements

2015-06-25 Thread David Malcolm
On Thu, 2015-06-25 at 21:47 +0200, Basile Starynkevitch wrote: > On 06/25/2015 09:13 PM, David Malcolm wrote: > > Some interpreters/VMs support a switch statement (for example the JVM > > has opcodes "lookupswitch" and "tableswitch"). GCC has a set of > &g

[PATCH 0/4] Add source-location metadata to GCC passes

2015-06-25 Thread David Malcolm
..dump goes here...) ; end of dump from pass_fre (../../src/gcc/tree-ssa-pre.c:4933) identifying clearly where to look next. Successfully bootstrapped®rtested on x86_64-unknown-linux-gnu OK for trunk? David Malcolm (4): Add classname/filename/line metadata to struct pass_data Autogenera

[PATCH 1/4] Add classname/filename/line metadata to struct pass_data

2015-06-25 Thread David Malcolm
gcc/ChangeLog: * tree-pass.h (struct pass_data): Add fields "classname", "filename", "line_num". (PASS_DATA_INIT): New macro. --- gcc/tree-pass.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 4545556

[PATCH 4/4] Print pass metadata at the start and end of dumpfiles

2015-06-25 Thread David Malcolm
This patch adds information to the top and bottom of dumpfiles giving metadata on the pass that they're associated with e.g.: ; start of dump from pass_forwprop (../../src/gcc/tree-ssa-forwprop.c:2103) (dump goes here) ; end of dump from pass_forwprop (../../src/gcc/tree-ssa-forwprop.c:2103) My

[PATCH 3/4] Manual fixes for PASS_DATA_INIT missed by the script

2015-06-25 Thread David Malcolm
gcc/ChangeLog: * auto-profile.c (pass_data_ipa_auto_profile): Use PASS_DATA_INIT macro and supply a value for "classname". * ipa-chkp.c (pass_data_ipa_chkp_versioning): Likewise. (pass_data_ipa_chkp_early_produce_thunks): Likewise. (pass_data_ipa_chkp_produce

Managing ABI compatibility (was Re: [PATCH 2/2] jit: add switch statements)

2015-06-26 Thread David Malcolm
On Thu, 2015-06-25 at 13:16 -0600, Jeff Law wrote: > On 06/25/2015 01:13 PM, David Malcolm wrote: > > > >* It extends the libgccjit API. It's not clear to me yet how to > > manage extensions of the libgccjit API: should I use symbol maps > > and vers

Re: Managing ABI compatibility (was Re: [PATCH 2/2] jit: add switch statements)

2015-06-26 Thread David Malcolm
On Fri, 2015-06-26 at 13:57 -0400, David Malcolm wrote: > On Thu, 2015-06-25 at 13:16 -0600, Jeff Law wrote: > > On 06/25/2015 01:13 PM, David Malcolm wrote: > > > > > >* It extends the libgccjit API. It's not clear to me yet how to > > > manage

Four jit backports to gcc 5 branch

2015-06-29 Thread David Malcolm
I've gone over the changes to the gcc/jit and gcc/testsuite/jit.dg directories in trunk since gcc 5 and backported the following 4 changes from trunk to the gcc-5-branch: gcc-5-branch's r225123: * trunk's r222863 (8120405bda9bf28b004e09b23e74eda57ae1, addition of test-benchmark.c): https:/

Re: [PATCH 1/2] Add gcc/typed-splay-tree.h

2015-06-29 Thread David Malcolm
On Thu, 2015-06-25 at 13:18 -0600, Jeff Law wrote: > On 06/25/2015 01:13 PM, David Malcolm wrote: > > I found when implementing switch statements for the jit that it > > was much easier to work with libiberty's splay-tree.h by first > > wrapping it in a C++ wrapper to ad

Thinking about libgccjit SONAME bump for gcc 5.2 (was Re: Four jit backports to gcc 5 branch)

2015-06-29 Thread David Malcolm
On Mon, 2015-06-29 at 21:57 +0100, Dibyendu Majumdar wrote: > On 29 June 2015 at 16:44, David Malcolm wrote: > > I've gone over the changes to the gcc/jit and gcc/testsuite/jit.dg > > directories in trunk since gcc 5 and backported the following 4 changes > > from

Re: Thinking about libgccjit SONAME bump for gcc 5.2 (was Re: Four jit backports to gcc 5 branch)

2015-06-29 Thread David Malcolm
On Mon, 2015-06-29 at 18:34 -0400, Ulrich Drepper wrote: > On Mon, Jun 29, 2015 at 5:26 PM, David Malcolm wrote: > > I'm looking at ways to manage libgccjit API/ABI as per this thread: > > https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01982.html > > by transitioning to u

Re: Four jit backports to gcc 5 branch

2015-06-30 Thread David Malcolm
On Tue, 2015-06-30 at 08:43 +0200, Basile Starynkevitch wrote: > On Mon, Jun 29, 2015 at 11:44:31AM -0400, David Malcolm wrote: > > I've gone over the changes to the gcc/jit and gcc/testsuite/jit.dg > > directories in trunk since gcc 5 and backported the following 4 changes &

[PATCH, committed] jit: fix some .rst issues in docs

2015-06-30 Thread David Malcolm
gcc/jit/ChangeLog: * docs/cp/topics/expressions.rst: Remove stray semicolon. * docs/cp/topics/functions.rst: Remove stray backslash. * docs/_build/texinfo/libgccjit.texi: Regenerate. Committed to trunk as r225203. --- gcc/jit/docs/cp/topics/expressions.rst | 2 +- gcc/jit

[PATCH, committed] fixes to gcc_jit_context_dump_reproducer_to_file

2015-06-30 Thread David Malcolm
Tested with "make check-jit" and visual inspection; jit.sum continues to have 8014 passes. Committed to trunk as r225204. gcc/jit/ChangeLog: * jit-recording.c (gcc::jit::recording::context::dump_reproducer_to_file): Add pragma to generated reproducers to disable -Wunused-v

[PATCH, committed] PR jit/66628: add gcc_jit_context_add_command_line_option

2015-06-30 Thread David Malcolm
ty.rst new file mode 100644 index 000..dff1d0b --- /dev/null +++ b/gcc/jit/docs/topics/compatibility.rst @@ -0,0 +1,90 @@ +.. Copyright (C) 2015 Free Software Foundation, Inc. + Originally contributed by David Malcolm + + This is free software: you can redistribute it and/or modify it + under

[PATCH, committed] PR jit/66546: Add gcc_jit_context_set_bool_allow_unreachable_blocks

2015-06-30 Thread David Malcolm
Normally libgccjit verifies that all blocks within a function are reachable by some path from the entry block, issuing a hard error if it encounters an unreachable block, which is useful for the common case. However, some bytecode interpreters can generate unreachable bytecodes, so it's useful whe

[PATCH, committed] jit: add switch statements

2015-06-30 Thread David Malcolm
This is a revised, combined version of the patches posted here: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01858.html ("[PATCH 1/2] Add gcc/typed-splay-tree.h") https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01859.html ("[PATCH 2/2] jit: add switch statements") with the fix to patch

<    16   17   18   19   20   21   22   23   24   25   >