public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak
Date: Thu, 18 Jan 2024 11:34:26 +0000	[thread overview]
Message-ID: <bug-113475-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113475

            Bug ID: 113475
           Summary: phi_analyzer::m_tab contents leak
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

We allocate phi_group in gimple-range-phi.cc:460:

          // Try to create a group based on m_current. If a result comes back
          // with a range that isn't varying, create the group.
          phi_group cyc (m_current, init_range, mod, &m_global);
          if (!cyc.range ().varying_p ())
            {
              g = new phi_group (cyc);

which we store in

  // Now set all entries in the group to this record.
  unsigned i;
  bitmap_iterator bi;
  EXECUTE_IF_SET_IN_BITMAP (m_current, 0, i, bi)
    {
      // Can't be in more than one group.
      gcc_checking_assert (m_tab[i] == NULL);
      m_tab[i] = g;

but we dever deallocate them.  One way would be to have a dense

  vec<phi_group *> m_groups;

we put all allocated groups into and then make m_tab store an index
into that array

  vec<unsigned> m_tab;

             reply	other threads:[~2024-01-18 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 11:34 rguenth at gcc dot gnu.org [this message]
2024-01-18 11:35 ` [Bug tree-optimization/113475] [14 Regression] " rguenth at gcc dot gnu.org
2024-01-18 12:23 ` rguenth at gcc dot gnu.org
2024-01-18 13:14 ` cvs-commit at gcc dot gnu.org
2024-01-18 13:14 ` rguenth at gcc dot gnu.org
2024-01-18 14:31 ` amacleod at redhat dot com

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=bug-113475-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).