public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, jit@gcc.gnu.org
Subject: Re: [PATCH 08/21] PR jit/63854: Add ira_costs_c_finalize
Date: Wed, 01 Jan 2014 00:00:00 -0000	[thread overview]
Message-ID: <CAFiYyc3Z7yKitQBOB=A=42cD_j+gbFaAtqC-pevTrDXMCMrbQw@mail.gmail.com> (raw)
In-Reply-To: <1416393981-39626-9-git-send-email-dmalcolm@redhat.com>

On Wed, Nov 19, 2014 at 11:46 AM, David Malcolm <dmalcolm@redhat.com> wrote:
> 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/etc, just by libgccjit.so).
>
> Doing so eliminates about 27KB of "leak" from the valgrind report.

Ok.

Thanks,
Richard.

> gcc/ChangeLog:
>         PR jit/63854
>         * ira-costs.c (ira_costs_c_finalize): New function.
>         * ira.h (ira_costs_c_finalize): New prototype.
>         * toplev.c (toplev::finalize): Call ira_costs_c_finalize.
> ---
>  gcc/ira-costs.c | 6 ++++++
>  gcc/ira.h       | 3 +++
>  gcc/toplev.c    | 1 +
>  3 files changed, 10 insertions(+)
>
> diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
> index 122815b..2dabead 100644
> --- a/gcc/ira-costs.c
> +++ b/gcc/ira-costs.c
> @@ -2356,3 +2356,9 @@ ira_adjust_equiv_reg_cost (unsigned regno, int cost)
>    else
>      regno_equiv_gains[regno] += cost;
>  }
> +
> +void
> +ira_costs_c_finalize (void)
> +{
> +  this_target_ira_int->free_ira_costs ();
> +}
> diff --git a/gcc/ira.h b/gcc/ira.h
> index b294ea1..d62656c 100644
> --- a/gcc/ira.h
> +++ b/gcc/ira.h
> @@ -199,4 +199,7 @@ extern bool ira_bad_reload_regno (int, rtx, rtx);
>
>  extern void ira_adjust_equiv_reg_cost (unsigned, int);
>
> +/* ira-costs.c */
> +extern void ira_costs_c_finalize (void);
> +
>  #endif /* GCC_IRA_H */
> diff --git a/gcc/toplev.c b/gcc/toplev.c
> index 0d617c2..0181a3f 100644
> --- a/gcc/toplev.c
> +++ b/gcc/toplev.c
> @@ -2168,6 +2168,7 @@ toplev::finalize (void)
>    gcse_c_finalize ();
>    ipa_cp_c_finalize ();
>    ipa_reference_c_finalize ();
> +  ira_costs_c_finalize ();
>    params_c_finalize ();
>
>    finalize_options_struct (&global_options);
> --
> 1.8.5.3
>

  reply	other threads:[~2014-11-19 11:44 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-01  0:00 [PATCH 00/21] PR 63854: Fix various memory leaks David Malcolm
2014-01-01  0:00 ` [PATCH 19/21] PR jit/63854: Fix leak of ipa hooks David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00     ` PING " David Malcolm
2014-01-01  0:00       ` Jan Hubicka
2014-01-01  0:00 ` [PATCH 05/21] PR jit/63854: Fix memory leak of save_decoded_options David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 14/21] PR jit/63854: Fix leak of paths within jump threading David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 07/21] PR jit/63854: Fix leak of optimization_summary_obstack David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 02/21] PR jit/63854: Fix memory leak of reginfo.c: valid_mode_changes_obstack David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 08/21] PR jit/63854: Add ira_costs_c_finalize David Malcolm
2014-01-01  0:00   ` Richard Biener [this message]
2014-01-01  0:00 ` [PATCH 04/21] PR jit/63854: Fix memory leak within bb-reorder.c David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 09/21] PR jit/63854: Don't leak producer_string in dwarf2out.c David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 10/21] PR jit/63854: Fix leak of worklist within jit-recording.c David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00     ` David Malcolm
2014-01-01  0:00       ` Richard Biener
2014-01-01  0:00         ` Jeff Law
2014-01-01  0:00 ` [PATCH 20/21] PR jit/63854: Fix leak in ipa-icf.c David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 12/21] PR jit/63854: Add a valgrind suppresion file David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00     ` Jeff Law
2014-01-01  0:00       ` David Malcolm
2015-01-01  0:00         ` Hans-Peter Nilsson
2014-01-01  0:00 ` [PATCH 21/21] PR jit/63854: Fix leaks in test-fuzzer.c David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00 ` [PATCH 13/21] PR jit/63854: Add support for running "make check-jit" under valgrind David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00     ` Running cc1 etc under valgrind (was Re: [PATCH 13/21] PR jit/63854: Add support for running "make check-jit" under valgrind) David Malcolm
2014-01-01  0:00       ` David Malcolm
2014-01-01  0:00     ` [PATCH 00/05] Fixes to jit.exp David Malcolm
2014-01-01  0:00       ` [PATCH 03/05] jit.exp: fix timeout bug inherited from dejagnu.exp David Malcolm
2014-01-01  0:00       ` [PATCH 01/05] jit.exp: Avoid embedding full paths into test results David Malcolm
2014-01-01  0:00         ` Mike Stump
2014-01-01  0:00       ` [PATCH 05/05] Add command-line option-parsing to jit testcases David Malcolm
2014-01-01  0:00         ` PING: " David Malcolm
2014-01-01  0:00           ` Mike Stump
2014-01-01  0:00             ` David Malcolm
2014-01-01  0:00               ` Mike Stump
2014-01-01  0:00       ` [PATCH 04/05] jit.exp: Verify the exit status of the spawnee David Malcolm
2014-01-01  0:00       ` [PATCH 02/05] PR jit/63854: Add support for running "make check-jit" under valgrind David Malcolm
2014-01-01  0:00     ` [PATCH 13/21] " David Malcolm
2014-01-01  0:00       ` Jeff Law
2014-01-01  0:00     ` [PATCH 00/05] Fixes to jit.exp David Malcolm
2014-01-01  0:00 ` [PATCH 18/21] PR jit/63854: Add "long-term" allocator to gcc::context David Malcolm
2014-01-01  0:00   ` Joseph Myers
2015-01-01  0:00     ` PING: " David Malcolm
2015-01-01  0:00       ` Joseph Myers
2014-01-01  0:00 ` [PATCH 01/21] PR jit/63854: Fix memory leak within gcc_options David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 15/21] PR jit/63854: lra.c: Fix leak of point_freq_vec's buffer when calling lra_inheritance David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00 ` [PATCH 06/21] PR jit/63854: Fix leak of opts_obstack David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 11/21] PR jit/63854: Fix leak of "avail" within tree-ssa-pre.c David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 16/21] PR jit/63854: Add all_late_ipa_passes to GCC_PASS_LISTS David Malcolm
2014-01-01  0:00   ` Richard Biener
2014-01-01  0:00 ` [PATCH 17/21] PR jit/63854: Fix leaking vec in jit David Malcolm
2014-01-01  0:00   ` Jeff Law
2014-01-01  0:00 ` [PATCH 03/21] PR jit/63854: Fix memory leaks within context/pass_manager/dump_manager David Malcolm
2014-01-01  0:00   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc3Z7yKitQBOB=A=42cD_j+gbFaAtqC-pevTrDXMCMrbQw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).