public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak
@ 2024-01-18 11:34 rguenth at gcc dot gnu.org
  2024-01-18 11:35 ` [Bug tree-optimization/113475] [14 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-18 11:34 UTC (permalink / raw)
  To: gcc-bugs

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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/113475] [14 Regression] phi_analyzer::m_tab contents leak
  2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
@ 2024-01-18 11:35 ` rguenth at gcc dot gnu.org
  2024-01-18 12:23 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-18 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
            Summary|phi_analyzer::m_tab         |[14 Regression]
                   |contents leak               |phi_analyzer::m_tab
                   |                            |contents leak
   Target Milestone|---                         |14.0
                 CC|                            |amacleod at redhat dot com
           Keywords|                            |memory-hog

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/113475] [14 Regression] phi_analyzer::m_tab contents leak
  2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-18 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2024-01-18
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/113475] [14 Regression] phi_analyzer::m_tab contents leak
  2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
  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
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-18 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:895a2138265fd9cace3588404523122f73626d2a

commit r14-8229-g895a2138265fd9cace3588404523122f73626d2a
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jan 18 13:23:27 2024 +0100

    tree-optimization/113475 - fix memory leak in phi_analyzer

    phi_analyzer leaks all phi_group objects it allocates.  The following
    fixes this by maintaining a vector of allocated objects and release
    them when destroying the phi_analyzer object.

            PR tree-optimization/113475
            * gimple-range-phi.h (phi_analyzer::m_phi_groups): New.
            * gimple-range-phi.cc (phi_analyzer::phi_analyzer): Initialize.
            (phi_analyzer::~phi_analyzer): Deallocate and free collected
            phi_grous.
            (phi_analyzer::process_phi): Record allocated phi_groups.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/113475] [14 Regression] phi_analyzer::m_tab contents leak
  2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-18 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.  The index optimization isn't implemented.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/113475] [14 Regression] phi_analyzer::m_tab contents leak
  2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-01-18 13:14 ` rguenth at gcc dot gnu.org
@ 2024-01-18 14:31 ` amacleod at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: amacleod at redhat dot com @ 2024-01-18 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> ---
yoinks.   Not sure how I missed that.  thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-18 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 11:34 [Bug tree-optimization/113475] New: phi_analyzer::m_tab contents leak rguenth at gcc dot gnu.org
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

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).