On Mon, 2014-10-27 at 13:50 -0400, David Malcolm wrote:
> I've merged svn trunk into the git dmalcolm/jit branch, specifically
> from trunk r216746 aka fddbd0194b01f44c5b5f16379fd5405dcf6d71c0
> (2014-10-27) bringing in all changes since r216524 aka
> d14cac46135326115f0dc589b0b3d
TURN
Dave
[1]
https://github.com/davidmalcolm/gcc-refactoring-scripts/blob/master/refactor_gimple_patches.py
and
https://github.com/davidmalcolm/gcc-refactoring-scripts/blob/master/gimple_approvals.py
David Malcolm (92):
Introduce gimple_switch and use it in various places
Introduce gimple_bi
22 insertions(+), 6 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 33a4f87..bd635c6 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,21 @@
2014-10-24 David Malcolm
+ Update ssa_prop_visit_phi_fn callbacks to tak
ngeLog.gimple-classes
index 08dbf95..dc1edc86 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,94 @@
2014-10-24 David Malcolm
+ Introduce gimple_bind and use it for accessors.
+
+ * coretypes.h (gimple_bind): New typedef.
+ (const_gimple_bin
es
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,70 @@
2014-10-24 David Malcolm
+ Introduce gimple_assign and use it in various places
+
+ * coretypes.h (gimple_assign): New typedef.
+ (const_gimple_assign): New typedef.
+
+ * gimple.h (struct gimp
-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 68eb669..ec16551 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,42 @@
2014-10-24 David Malcolm
+ Introduce gimple_debug and use it in a few places
+
+
+1,37 @@
2014-10-24 David Malcolm
+ Introduce gimple_label and use it in a few places
+
+ * coretypes.h (gimple_label): New typedef.
+ (const_gimple_label): New typedef.
+
+ * gimple.h (struct gimple_statement_label): New subclass of
+ gimple_statement_with_ops,
| 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 533002f..1e636be 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,13 @@
2014-10-24 David Malcolm
+ tree-ss
gcc/ChangeLog.gimple-classes
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
new file mode 100644
index 000..08dbf95
--- /dev/null
+++ b/gcc/ChangeLog.gimple-classes
@@ -0,0 +1,100 @@
+2014-10-24 David Malcolm
+
+ Introduce gimple_switch and use it in various places
angeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index dc1edc86..a7d756e 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,71 @@
2014-10-24 David Malcolm
+ Introduce gimple_cond and use it in various places
+
+ * coretypes.h (gimple_cond
le-classes
index ba0bde6..5508788 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,48 @@
2014-10-24 David Malcolm
+ Introduce gimple_return
+
+ * coretypes.h (gimple_return): New typedef.
+ (const_gimple_return): New typedef.
+
+ *
le-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,32 @@
2014-10-24 David Malcolm
+ Introduce gimple_eh_must_not_throw
+
+ * coretypes.h (gimple_eh_must_not_throw): New typedef.
+ (const_gimple_eh_must_not_throw): New typedef.
+
+ * gimple-pretty-print.c (dump_gimple_eh_must
hangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 5508788..bba6c7d 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,32 @@
2014-10-24 David Malcolm
+ Introduce gimple_goto
+
+ * coretypes.h (gimple_goto): New typedef.
+ (
insertions(+), 79 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index bd88371..b3a475e 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,88 @@
2014-10-24 David Malcolm
+ Introduce gimple_transact
On Fri, 2014-06-13 at 12:24 +0200, mliska wrote:
[...snip...]
> Statistics about the pass:
> Inkscape: 11.95 MB -> 11.44 MB (-4.27%)
> Firefox: 70.12 MB -> 70.12 MB (-3.07%)
FWIW, you wrote 70.12 MB here for both before and after for Firefox, but
give a -3.07% change, which seems like a typo
On Mon, 2014-06-09 at 20:32 +0100, Richard Sandiford wrote:
> Steven Bosscher writes:
> > On Sat, Jun 7, 2014 at 7:54 PM, Richard Sandiford wrote:
> >> The two parts of the loop condition are really handling two different
> >> kinds of block: ones like entry and exit that are completely empty
> >>
On Wed, 2014-06-25 at 14:39 -0600, Jeff Law wrote:
> On 06/25/14 03:36, Richard Sandiford wrote:
> >
> > I think this is an example of another problem with gcc coding style:
> > that we're far too afraid of temporary variables. In David's scheme
> > I think this would be:
> Historical coding style
On Wed, 2014-06-25 at 10:36 +0100, Richard Sandiford wrote:
> Oleg Endo writes:
> > Personally, I'd like to see usage of standard STL-like iterator usage.
> > I've proposed something for edge_iterator a while ago, but people don't
> > seem very fond of it. See also
> > https://gcc.gnu.org/ml/gcc-
The patch:
https://gcc.gnu.org/ml/gcc-patches/2015-05/msg00600.html
broke the build of the jit:
In file included from ../../src/gcc/jit/jit-builtins.c:23:0:
../../src/gcc/target.h:188:60: error: expected ‘;’ at end of member declaration
#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NA
On Mon, 2015-05-11 at 15:23 -0600, Jeff Law wrote:
> On 04/28/2015 06:02 PM, David Malcolm wrote:
> > This is an updated implementation of the proposed
> > -Wmisleading-indentation warning.
> >
> > Changes since last patch:
> >
> > * I've rewritten it
On Tue, 2015-05-12 at 17:21 -0400, David Malcolm wrote:
[...]
> Thanks; I've removed the new warning from -Wall, making the appropriate
> trivial doc changes, and committed it to trunk (r223098; attached).
...having bootstrapped®rtested it on x86_64-unknown-linux-gnu
(Fedora 20).
On Mon, 2015-05-04 at 13:19 -0600, Jeff Law wrote:
> On 05/01/2015 06:56 PM, David Malcolm wrote:
> > As a relative newcomer to GCC, one of the issues I had was
> > becoming comfortable with the linemap API and its internal
> > representation.
> >
> > To fami
This might qualify as "obvious".
OK for trunk? (if it passes bootstrap and regrtest)
gcc/c-family/ChangeLog:
* c-indentation.c (warn_for_misleading_indentation): Bail out
immediately if -Wmisleading-indentation isn't enabled.
---
gcc/c-family/c-indentation.c | 6 ++
1 file c
Before this patch, jit.dg/test-benchmark.c at optlevel 0, 100 iterations
showed "rest of compilation" as taking a significant chunk of time:
rest of compilation : 1.53 (64%) usr 0.06 (32%) sys 1.60 (27%) wall
1388 kB ( 6%) ggc
This turned out to be almost entirely spent inside initi
Running jit.dg/test-sum-of-squares.c under valgrind showed a couple of leaks:
608 bytes in 4 blocks are definitely lost in loss record 184 of 229
at 0x4A081D4: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5BC88B0: xcalloc (xmalloc.c:162)
by 0x524F72D: alloc_mem(
Add various new tests to Wmisleading-indentation.c:
* Ensure that users can use pragma to turn off
-Wmisleading-indentation for a range of code.
* Add functions demonstrating a variety of indentation styles
seen:
(a) on http://en.wikipedia.org/wiki/Indent_style
(b) via t
This patch fixes the false positive seen from -Wmisleading-indentation
on this code:
if (v == 2)
{
res = 27;
} else
{
res = 18;
}
return res;
^ FALSE POSITIVE HERE
along with similar code seen when I tested it with linux-4.0.3.
The patch adds a reject
On Wed, 2015-05-27 at 15:56 +0200, mliska wrote:
> gcc/ChangeLog:
>
> 2015-04-30 Martin Liska
>
> * ira-color.c (init_update_cost_records): Use new type-based pool
> allocator.
> (get_update_cost_record): Likewise.
> (free_update_cost_record_list): Likewise.
> (finish_
[Crossposting to both gcc-patches and binutils lists, since this
patch kit touches both source trees].
Binutils devs: GCC 5 gained a way to build GCC as a shared library,
libgccjit.so.
I'm been experimenting with ways of optimizing libgccjit, and the
following patch kit (touching both gcc and bin
gcc/ChangeLog:
* gcc.c (g_driver): New.
(driver::driver): Set "g_driver".
(driver::~driver): Unset "g_driver".
---
gcc/gcc.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7314317..46e750d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -
gcc provides a timing mechanism, with a C++-based API.
This patch provide a C-based API so that we can call into it
from binutils.
include/ChangeLog:
* libiberty.h (struct ctimer): New.
(CTIMER_PUSH): New macro.
(CTIMER_POP): New macro.
---
include/libiberty.h | 32 ++
This may be something of a hack; it appears to work for x86_64.
Before:
initialize rtl : 1.50 (63%) usr 0.02 (10%) sys 1.34 (23%) wall
1156 kB ( 5%) ggc
rest of compilation : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.03 ( 1%) wall
232 kB ( 1%) ggc
TOTAL :
gcc/ChangeLog:
* gcc.c (execute): Identify certain commands, and account their
time to specific timevars.
* gcc.h (driver::get_timer): New accessor.
* timevar.def (TV_DRIVER_EXECUTE_AS): New.
(TV_DRIVER_EXECUTE_COLLECT2): New.
(TV_DRIVER_EXECUTE_LD):
This patch allows a "timer" instance to be passed to the driver
and adds some timevars for activities within the driver.
This is for use by libgccjit when embedding the driver, though
in theory we could use this to time the driver as a whole.
gcc/ChangeLog:
* Makefile.in (GCC_OBJS): Add t
e.rst
diff --git a/gcc/jit/docs/topics/performance.rst
b/gcc/jit/docs/topics/performance.rst
new file mode 100644
index 000..b7de28e
--- /dev/null
+++ b/gcc/jit/docs/topics/performance.rst
@@ -0,0 +1,208 @@
+.. Copyright (C) 2015 Free Software Foundation, Inc.
+ Originally contributed
Provide a way to clean up state within the driver code, and use this
from libgccjit to embed it in-process, rather that via pex. Part of
this requires restoring the environment after any putenv calls, so the
patch introduces an env_manager class. No effort is made to restore
the environment for t
This patch adds a new API entrypoint to libbfd: bfd_uninit,
which resets global state within the library.
The patch (and subsequent ones) follow a pattern I used in gcc for
cleaning up global state: for each source file e.g. foo.c to have a
function:
extern void foo_c_finalize (void);
to explici
include/ChangeLog:
* libiberty.h (CLEAR_VAR): New macro.
---
include/libiberty.h | 4
1 file changed, 4 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index b33dd65..93e4131 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -699,6 +699,10 @@ extern v
This is a nasty hack, but I noticed a lot of time spent executing the
linker within jit.dg/test-benchmark, with link lines like:
run_embedded_ld: 24 args
argv[0]: ld
argv[1]: --eh-frame-hdr
argv[2]: -m
argv[3]: elf_x86_64
argv[4]: -shared
argv[5]: -o
argv[6]: /tmp/lib
Similarly to "libgas.la" before , this introduces a libld.la, moving
everything from "ld" into it, with ld built from ldmainmain.c.
As before with the libgas.la patch, this patch isn't ready yet, but
seems to be good enough for prototyping the libgccjit.so integration.
---
ld/Makefile.am | 64 +++
Currently this has only been tested on x86_64, and hardcodes this
cleanup:
extern void config_obj_elf_c_finalize (void);
extern void config_tc_i386_c_finalize (void);
Clearly this would need generalizing.
gas/ChangeLog:
* app.c (app_c_finalize): New function.
* as.c: Include ne
This patch adds the ability for gcc to be configured with:
--with-embedded-as
--with-embedded-ld
If so, invocations of "as" and "ld" are detected in the gcc driver, and
specialcased by invoking these in-process as shared libraries. This is
intended for use by libgccjit, when the driver itself
This patch introduces a libgas.la, using it for the "as" executable.
I'm not convinced I've got this correct, but it seems to work well
enough to prototype the embedding within libgccjit.so.
---
gas/Makefile.am | 26 +-
1 file changed, 17 insertions(+), 9 deletions(-)
dif
As before in "gas", introduce code to ld to restore state.
I've only tested this on x86_64, and there are some hacks in here
that hardcode that, but hopefully this is enough to show the idea.
---
ld/emultempl/elf32.em | 77 +
ld/ld.h | 8
include/ChangeLog:
* libiberty.h (struct ctimer): New.
(CTIMER_PUSH): New.
(CTIMER_POP): New.
---
include/libiberty.h | 32
1 file changed, 32 insertions(+)
diff --git a/include/libiberty.h b/include/libiberty.h
index b33dd65..a2c73ae 10064
On Mon, 2015-06-01 at 17:47 -0400, DJ Delorie wrote:
> > +/* Fill an lvalue with zero bits. */
> > +#define CLEAR_VAR(S) \
> > + do { memset (&(S), 0, sizeof (S)); } while (0)
>
> Hmmm... I don't see the point in this. The macro is almost as long as
> a bare memset() would be, and replaces a we
"jit" isn't part of "all" languages, and currently fails to build on
the aldyh/debug-early branch:
../../src/gcc/jit/jit-playback.c: In member function ‘void
gcc::jit::playback::context::write_global_decls_2()’:
../../src/gcc/jit/jit-playback.c:710:20: error: ‘const struct gcc_debug_hooks’
has n
On Fri, 2015-06-05 at 15:37 -0400, Aldy Hernandez wrote:
> On 06/05/2015 03:00 PM, David Malcolm wrote:
> > "jit" isn't part of "all" languages, and currently fails to build on
> > the aldyh/debug-early branch:
>
> The debug-early work is now in m
On Fri, 2015-06-05 at 16:18 -0400, David Malcolm wrote:
> On Fri, 2015-06-05 at 15:37 -0400, Aldy Hernandez wrote:
> > On 06/05/2015 03:00 PM, David Malcolm wrote:
> > > "jit" isn't part of "all" languages, and currently fails to build on
> > &
/gcc/testsuite/c-c++-common/Wmisleading-indentation-8.c
@@ -0,0 +1,6 @@
+/* { dg-options "-Wmisleading-indentation" } */
+int foo (int a, int b, int c)
+{
+ /* This should *not* be flagged as misleading indentation. */
+ if (a) return b; else return c;
+}
diff --git a/gcc/testsuite/c-c++-co
On Fri, 2015-03-20 at 17:50 +, Joseph Myers wrote:
> On Fri, 20 Mar 2015, David Malcolm wrote:
>
> > I believe that the presense of these markers in source code is almost
> > always a bug (are there any GCC frontends in which the markers are
> > parsable as som
On Thu, 2015-04-16 at 10:26 -0700, Mike Stump wrote:
> On Apr 16, 2015, at 8:01 AM, David Malcolm wrote:
> > Attached is a work-in-progress patch for a new
> > -Wmisleading-indentation
> > warning I've been experimenting with, for GCC 6.
>
> Seems like a nice id
On Tue, 2015-04-21 at 20:14 +0200, Manuel López-Ibáñez wrote:
> On 21/04/15 18:07, David Malcolm wrote:
> >
> > I have the patch working now for the C++ frontend. Am attaching the
> > work-in-progress (sans ChangeLog). This one (v2) bootstrapped and
> > regrtested
On Tue, 2015-04-21 at 11:29 -0400, Trevor Saunders wrote:
> On Tue, Apr 21, 2015 at 07:57:19AM -0600, Jeff Law wrote:
> > On 04/21/2015 07:24 AM, tbsaunde+...@tbsaunde.org wrote:
> > >From: Trevor Saunders
> > >
> > >Hi,
> > >
> > >This is a first round of patches to reduce the amount of code with
This is an updated implementation of the proposed
-Wmisleading-indentation warning.
Changes since last patch:
* I've rewritten it to use Manuel's approach from
https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01225.html
I took Manuel's proposed patch for the C frontend and generalized
it to
An earlier version of the -Wmisleading-indentation patch issued
warnings for spurious trailing semicolons guarded by a conditional.
Although the latest version of -Wmisleading-indentation no longer
warns about these, I fixed the ones that were reported, thusly.
gcc/ChangeLog:
* builtins.c
This patch fixes the places in our tree where -Wmisleading-indentation
correctly identifies code that's misleadingly indented.
In particular, a couple of places in
gcc/cp/parser.c:cp_parser_asm_definition
appeared to be missing braces, both of the form:
if (complicated_multiline_condition ())
This patch updates and expands some comments in libcpp, adding
a big table to try to clarify what an individual source_location
value can mean.
libcpp/ChangeLog:
* include/line-map.h: Fix comment at the top of the file.
(source_location): Rewrite and expand the comment for this
look? (for trunk)
I've successfully bootstrapped®rtested the cumulative effect of the
patches on x86_64-unknown-linux-gnu (Fedora 20). I would verify the
bootstrap®rtest of each patch before applying them.
I didn't do any performance testing; what would be appropriate?
David Malcolm (4)
As a relative newcomer to GCC, one of the issues I had was
becoming comfortable with the linemap API and its internal
representation.
To familiarize myself with it, I wrote a dumping routine
to try to visualize how the source_location space is carved
up between line maps, and what each number can
libcpp makes extensive use of the C preprocessor. Whilst this has a
pleasingly self-referential quality, I find the code hard-to-read;
implementing source location support in my JIT branch was much harder than
I felt it should have been.
In an attempt at making the code easier to follow, and to b
This patch eliminates the union in struct line_map in favor of
a simple class hierarchy, making struct line_map a base class,
with line_map_ordinary and line_map_macro subclasses.
The patch eliminates all usage of linemap_check_ordinary and
linemap_check_macro from line-map.h, updating return type
On Mon, 2015-05-04 at 13:15 -0600, Jeff Law wrote:
On 05/01/2015 06:56 PM, David Malcolm wrote:
> > libcpp makes extensive use of the C preprocessor. Whilst this has a
> > pleasingly self-referential quality, I find the code hard-to-read;
> > implementing source location suppor
---
libcpp/include/line-map.h | 71 ---
1 file changed, 36 insertions(+), 35 deletions(-)
diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h
index e1681ea..7001552 100644
--- a/libcpp/include/line-map.h
+++ b/libcpp/include/line-map.h
@@
libcpp/ChangeLog:
* include/line-map.h (MAX_SOURCE_LOCATION): Convert from a macro
to a const source_location.
(RESERVED_LOCATION_COUNT): Likewise.
(linemap_check_ordinary): Convert from a macro to a pair of inline
functions, for const/non-const arguments.
gcc/java/ChangeLog:
* jcf-parse.c (set_source_filename): Replace write through
ORDINARY_MAP_FILE_NAME with direct access to "to_file".
libcpp/ChangeLog:
* include/line-map.h (MAP_START_LOCATION): Eliminate the non-const
variant, and tweak comment for the const varia
On Wed, 2015-04-29 at 14:10 +0200, Mikael Morin wrote:
> Hello,
>
> Le 29/04/2015 02:02, David Malcolm a écrit :
> > diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
> > index 2c7c554..30e4eab 100644
> > --- a/gcc/fortran/parse.c
> > +++ b/gcc/fortr
Add a simple benchmark to the jit testsuite: measuring the wallclock
time of:
* building a simple function (sum of squares from 0..n-1)
* compiling it in-memory
* running it (with n=100)
doing this combined test 100 times, at each optimization level.
On this machine I get this output:
PASSED
On Thu, 2015-05-07 at 17:30 -0700, Aldy Hernandez wrote:
> Hi folks.
>
> I have divided the patches into 10 pieces. The patches are
> interdependent and cannot be applied independently. I am merely
> dividing them up to aid the relevant reviewers.
>
> As I've mentioned elsewhere, the patchset
I want to make the timevar infrastructure be more flexible,
to better serve some JIT use-cases.
The following is a "removal of global state" patch which gathers
together the state within timevar.c into a new "timer" class.
Within the classic cc1/cc1plus/etc use-case, this timer class
is a singlet
On Thu, 2014-11-13 at 11:22 +0100, Richard Biener wrote:
> On Wed, Nov 12, 2014 at 11:04 PM, David Malcolm wrote:
> > On Wed, 2014-11-12 at 13:16 -0500, David Malcolm wrote:
> >> We make assumptions in the codebase about when the GC can run, and when
> >> it can
On Thu, 2014-11-13 at 11:45 +0100, Richard Biener wrote:
> On Thu, Nov 13, 2014 at 2:41 AM, David Malcolm wrote:
> > On Tue, 2014-11-11 at 11:43 +0100, Richard Biener wrote:
> >> On Tue, Nov 11, 2014 at 8:26 AM, Jakub Jelinek wrote:
> >> > On Mon, Nov 10, 2014 at 0
On Thu, 2014-11-13 at 11:45 +0100, Richard Biener wrote:
> On Thu, Nov 13, 2014 at 2:41 AM, David Malcolm wrote:
> > On Tue, 2014-11-11 at 11:43 +0100, Richard Biener wrote:
> >> On Tue, Nov 11, 2014 at 8:26 AM, Jakub Jelinek wrote:
> >> > On Mon, Nov 10, 2014 at 0
On Mon, 2014-11-17 at 11:06 +0100, Richard Biener wrote:
> On Sat, Nov 15, 2014 at 12:00 PM, David Malcolm wrote:
> > On Thu, 2014-11-13 at 11:45 +0100, Richard Biener wrote:
> >> On Thu, Nov 13, 2014 at 2:41 AM, David Malcolm wrote:
> >> > On Tue, 2014-11-11 at 11:
On Tue, 2014-11-18 at 10:53 +0100, Richard Biener wrote:
> On Tue, Nov 18, 2014 at 2:59 AM, David Malcolm wrote:
> > On Mon, 2014-11-17 at 11:06 +0100, Richard Biener wrote:
> >> On Sat, Nov 15, 2014 at 12:00 PM, David Malcolm
> >> wrote:
> >> > On Thu, 20
Valgrind shows this fixes ~1 KB of leak per iteration (on x86_64) by
plugging these leaks allocated at opts.c lines 286 and 289:
==57820== 2,752 bytes in 4 blocks are definitely lost in loss record 875 of 917
==57820==at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux
Valgrind shows this fixes ~4 KB of leak per iteration (on x86_64) by
plugging this leak allocated at reginfo.c:1327:
gcc_obstack_init (&valid_mode_changes_obstack);
==57820== 16,256 bytes in 4 blocks are definitely lost in loss record 906 of 917
==57820==at 0x4A0645D: malloc (in
/usr/lib64/
This was leaking about 4KB per iteration:
16,256 bytes in 4 blocks are definitely lost in loss record 233 of 239
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75C17: xmalloc (xmalloc.c:147)
by 0x30958842DB: _obstack_begin (obstack.c:184)
by 0x5
We weren't cleaning up the context, pass_manager or dump_manager.
An earlier version of the context and pass_manager classes had them
allocated in the GC-heap, but they were moved to the system heap
before that patch was committed; they were never cleaned up, so e.g.
all passes leak on each in-pro
such testing?).
Successfully bootstrapped®rtested the cumulative effect of the
patches on x86_64-unknown-linux-gnu (Fedora 20).
Are the non-JIT parts OK for trunk?
(Presumably I can give myself approval for the JIT parts)
David Malcolm (21):
PR jit/63854: Fix memory leak within gcc_options
P
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_memcheck-amd64-linux.so)
by 0x5D75D4F: xrealloc (xmalloc.c:177)
by 0x4DE1710: void
va_heap::reserve(vec*&, unsigned int, bool) (vec.h:310)
by 0x4D
this_target_ira_int->free_ira_costs () is called by ira_init_costs,
but this isn't called after the compile, causing noise when running
under valgrind.
This patch adds a ira_costs_c_finalize function to clean this up,
and calls it from toplev::finalize (and hence this isn't called by
cc1/cc1plus/e
This was leaking ~4KB per iteration:
16,256 bytes in 4 blocks are definitely lost in loss record 234 of 239
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75C17: xmalloc (xmalloc.c:147)
by 0x30958842DB: _obstack_begin (obstack.c:184)
by 0x4DFECD
Fix this leak:
120 bytes in 5 blocks are definitely lost in loss record 141 of 227
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75D8F: xrealloc (xmalloc.c:177)
by 0x550DEBA: void va_heap::reserve(vec*&, unsigned int, bool) (vec.h:310)
by 0x550
Valgrind complains about uninitialized data within sparseset_bit_p.
Provide a suppression file to silence these warnings.
Valgrind requires suppression files for C++ code to use the mangled
names, so we do that here.
contrib/ChangeLog:
PR jit/63854
* valgrind.supp: New.
---
contr
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
Valgrind showed a leak of 1640 bytes per iteration of one of the jit
testcases (I think this is per-function in a compile):
8,200 bytes in 5 blocks are definitely lost in loss record 214 of 223
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75D1F: xre
Valgrind showed this leaking 200 bytes per iteration in one of
my testcases:
1,000 bytes in 5 blocks are definitely lost in loss record 200 of 241
at 0x4A083AA: realloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75C5C: xrealloc (xmalloc.c:179)
by 0x4E10734: void va
This fixes various leaks of vec buffers seen via valgrind within jit
(both recording and playback).
Various vec<> within jit::recording are converted to auto_vec<>.
Various playback::wrapper subclasses containing vec<> gain a finalizer
so they can release the vec when they are collected.
gcc/jit
Valgrind showed a per-iteration leak of pass_ipa_pta (and presumably
pass_omp_simd_clone):
704 (352 direct, 352 indirect) bytes in 4 blocks are definitely lost in loss
record 198 of 241
at 0x4A06965: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by
ipa-icf.c was leaking 16 bytes per iteration in the jit testcases here:
80 bytes in 5 blocks are definitely lost in loss record 94 of 199
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D764B7: xmalloc (xmalloc.c:147)
by 0x5C962FF: ipa_icf::sem_item_
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
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D76447: xmalloc (xmalloc.c:147)
by 0x4E35C23: symbol_table
Fix this small per-iteration leak with debuginfo:
424 bytes in 4 blocks are definitely lost in loss record 185 of 230
at 0x4A0645D: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D75CA7: xmalloc (xmalloc.c:147)
by 0x4ECE9E4: gen_producer_string() (dwarf2out.c:194
This commit fixes this leak from opts-common.c, about 4KB per iteration.
==57820== 18,816 (2,560 direct, 16,256 indirect) bytes in 4 blocks are
definitely lost in loss record 907 of 917
==57820==at 0x4A083AA: realloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==57820==by
Some places in the startup code use char * values that can sometimes be
string literals, and can sometimes be dynamically built using xstrdup or
concat.
This isn't a problem for cc1 etc since this is only called once, but
for libgccjit they are small per-invocation leaks.
There's no clean way to
Paths are allocated as:
vec *path = new vec ();
i.e. the vec itself is on the heap, so a mere:
path->release ();
is merely releasing the buffer the vec holds, not the vec itself.
This patch updates the two sites that release paths to also delete them,
fixing leaks like this seen by valgri
gcc/testsuite/ChangeLog:
PR jit/63854
* jit.dg/test-fuzzer.c (fuzzer_init): Free malloced buffers.
(make_random_function): Free ff->locals.
---
gcc/testsuite/jit.dg/test-fuzzer.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/gcc/testsuite/jit.dg/test-fuzzer.c
b
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
On Wed, 2014-11-19 at 10:09 -0700, Jeff Law wrote:
> On 11/19/14 04:47, Richard Biener wrote:
> > On Wed, Nov 19, 2014 at 11:46 AM, David Malcolm wrote:
> >> Valgrind complains about uninitialized data within sparseset_bit_p.
> >> Provide a suppression fil
I've committed the cut-down version of the gimple statement subclasses
work to svn trunk [specifically the gimple-classes-v2-option-3 git
branch, having bootstrapped®rested it on x86_64-unknown-linux-gnu
(Fedora 20)].
This is the the 89-patch kit from
https://gcc.gnu.org/ml/gcc-patches/2014-04/
1901 - 2000 of 5457 matches
Mail list logo