public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory
@ 2012-08-21 11:41 rguenth at gcc dot gnu.org
  2012-08-21 11:50 ` [Bug rtl-optimization/54343] " steven at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-21 11:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

             Bug #: 54343
           Summary: RTL postreload leaks DF memory
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


With valgrind on the testcase from PR54146 you can see leaks of the kind

==28803== 3,984 bytes in 249 blocks are definitely lost in loss record 28,125
of 29,883
==28803==    at 0x4C29ADD: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28803==    by 0xCE28D7: xmalloc (xmalloc.c:147)
==28803==    by 0x6B064D: df_refs_add_to_chains(df_collection_rec*,
basic_block_def*, rtx_def*) (df-scan.c:2669)
==28803==    by 0x6B5144: df_bb_refs_record(int, bool) (df-scan.c:3644)
==28803==    by 0x6B524C: df_scan_blocks() (df-scan.c:678)
==28803==    by 0x7B6B7D: rest_of_handle_reload() (ira.c:4390)
==28803==    by 0x818C4A: execute_one_pass(opt_pass*) (passes.c:2157)
==28803==    by 0x818F94: execute_pass_list(opt_pass*) (passes.c:2212)
==28803==    by 0x818FA6: execute_pass_list(opt_pass*) (passes.c:2213)
==28803==    by 0x68F583: expand_function(cgraph_node*) (cgraphunit.c:1609)
==28803==    by 0x6909E8: compile() (cgraphunit.c:1714)
==28803==    by 0x690F64: finalize_compilation_unit() (cgraphunit.c:2089)

do_reload re-adds the live problem and calls run_fast_dce.  Either that
or subsequent passes that end up removing instructions do not bother
with freeing associated DF info.  At least I don't see that delete_insn
calls df_insn_delete or so.  Thus keeping DF initialized throughout
postreload may be not the best idea ...


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
@ 2012-08-21 11:50 ` steven at gcc dot gnu.org
  2012-08-21 19:20 ` steven at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-08-21 11:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-08-21
     Ever Confirmed|0                           |1

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-21 11:50:19 UTC ---
> Thus keeping DF initialized throughout
> postreload may be not the best idea ...

The problem is not in DF, but in the passes that don't properly update the info
for it. Hopefully with df_refs in an alloc-pool it'll be easier where the ref
vecs leak from...


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
  2012-08-21 11:50 ` [Bug rtl-optimization/54343] " steven at gcc dot gnu.org
@ 2012-08-21 19:20 ` steven at gcc dot gnu.org
  2012-08-21 21:25 ` dnovillo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-08-21 19:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu.org

--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-21 19:20:10 UTC ---
May be related to PR54332 ...


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
  2012-08-21 11:50 ` [Bug rtl-optimization/54343] " steven at gcc dot gnu.org
  2012-08-21 19:20 ` steven at gcc dot gnu.org
@ 2012-08-21 21:25 ` dnovillo at gcc dot gnu.org
  2012-08-22  9:33 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2012-08-21 21:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

Diego Novillo <dnovillo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu.org

--- Comment #3 from Diego Novillo <dnovillo at gcc dot gnu.org> 2012-08-21 21:25:20 UTC ---
HJ's fix for PR 54332 will probably fix this one, too.  Could you re-test?

Thanks.


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-08-21 21:25 ` dnovillo at gcc dot gnu.org
@ 2012-08-22  9:33 ` rguenth at gcc dot gnu.org
  2012-08-22 12:43 ` dnovillo at google dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-22  9:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-22 09:32:13 UTC ---
(In reply to comment #3)
> HJ's fix for PR 54332 will probably fix this one, too.  Could you re-test?
> 
> Thanks.

Doesn't fix it.

==18936== 3,984 bytes in 249 blocks are definitely lost in loss record 28,126
of 29,883
==18936==    at 0x4C29ADD: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18936==    by 0xCE2D27: xmalloc (xmalloc.c:147)
==18936==    by 0x6B05FD: df_refs_add_to_chains(df_collection_rec*,
basic_block_def*, rtx_def*) (df-scan.c:2669)
==18936==    by 0x6B50B4: df_bb_refs_record(int, bool) (df-scan.c:3644)
==18936==    by 0x6B51BC: df_scan_blocks() (df-scan.c:678)
==18936==    by 0x7B6C1D: rest_of_handle_reload() (ira.c:4390)
==18936==    by 0x818CEA: execute_one_pass(opt_pass*) (passes.c:2157)
==18936==    by 0x819034: execute_pass_list(opt_pass*) (passes.c:2212)
==18936==    by 0x819046: execute_pass_list(opt_pass*) (passes.c:2213)
==18936==    by 0x68F533: expand_function(cgraph_node*) (cgraphunit.c:1609)
==18936==    by 0x690998: compile() (cgraphunit.c:1714)
==18936==    by 0x690F14: finalize_compilation_unit() (cgraphunit.c:2089)


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-08-22  9:33 ` rguenth at gcc dot gnu.org
@ 2012-08-22 12:43 ` dnovillo at google dot com
  2012-08-22 13:02 ` rguenther at suse dot de
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at google dot com @ 2012-08-22 12:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

--- Comment #5 from dnovillo at google dot com <dnovillo at google dot com> 2012-08-22 12:43:02 UTC ---
On 2012-08-22 05:32 , rguenth at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343
>
> --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-22 09:32:13 UTC ---
> (In reply to comment #3)
>> HJ's fix for PR 54332 will probably fix this one, too.  Could you re-test?
>>
>> Thanks.
>
> Doesn't fix it.

OK, then it wasn't related.  Do you know if this started happening with 
rev 190402?


Diego.


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-08-22 12:43 ` dnovillo at google dot com
@ 2012-08-22 13:02 ` rguenther at suse dot de
  2013-03-03 17:09 ` steven at gcc dot gnu.org
  2024-02-20 14:01 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenther at suse dot de @ 2012-08-22 13:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> 2012-08-22 13:01:53 UTC ---
On Wed, 22 Aug 2012, dnovillo at google dot com wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343
> 
> --- Comment #5 from dnovillo at google dot com <dnovillo at google dot com> 2012-08-22 12:43:02 UTC ---
> On 2012-08-22 05:32 , rguenth at gcc dot gnu.org wrote:
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343
> >
> > --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-22 09:32:13 UTC ---
> > (In reply to comment #3)
> >> HJ's fix for PR 54332 will probably fix this one, too.  Could you re-test?
> >>
> >> Thanks.
> >
> > Doesn't fix it.
> 
> OK, then it wasn't related.  Do you know if this started happening with 
> rev 190402?

I don't and I don't believe it did.


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-08-22 13:02 ` rguenther at suse dot de
@ 2013-03-03 17:09 ` steven at gcc dot gnu.org
  2024-02-20 14:01 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-03 17:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54343

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-03 17:09:16 UTC ---
Perhaps Jakub can have a look at this memleak, too?
He's been on an impressive leak-plugging spree lately :-)


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

* [Bug rtl-optimization/54343] RTL postreload leaks DF memory
  2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-03-03 17:09 ` steven at gcc dot gnu.org
@ 2024-02-20 14:01 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-20 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can't reproduce with the testcase and have never seen this kind of leak in
the last years.  So assuming fixed.

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 11:41 [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory rguenth at gcc dot gnu.org
2012-08-21 11:50 ` [Bug rtl-optimization/54343] " steven at gcc dot gnu.org
2012-08-21 19:20 ` steven at gcc dot gnu.org
2012-08-21 21:25 ` dnovillo at gcc dot gnu.org
2012-08-22  9:33 ` rguenth at gcc dot gnu.org
2012-08-22 12:43 ` dnovillo at google dot com
2012-08-22 13:02 ` rguenther at suse dot de
2013-03-03 17:09 ` steven at gcc dot gnu.org
2024-02-20 14:01 ` rguenth at gcc dot gnu.org

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