public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements
@ 2015-03-24  9:32 jakub at gcc dot gnu.org
  2015-03-24  9:44 ` [Bug tree-optimization/65538] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-24  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65538
           Summary: [5 Regression] Memory leak of ipa_node_params_sum
                    elements
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: hubicka at gcc dot gnu.org, marxin at gcc dot gnu.org

Seen recently in valgrind output (e.g. on the pr65533.c testcase):

==19246== 216 (48 direct, 168 indirect) bytes in 1 blocks are definitely lost
in loss record 501 of 594
==19246==    at 0x4A070D7: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19246==    by 0xAEBAAE: function_summary<ipa_node_params*>::allocate_new()
(symbol-summary.h:106)
==19246==    by 0xAEAF20: function_summary<ipa_node_params*>::get(int)
(symbol-summary.h:232)
==19246==    by 0xAE9B97: function_summary<ipa_node_params*>::get(cgraph_node*)
(symbol-summary.h:112)
==19246==    by 0xAF9C38: ipa_analyze_node(cgraph_node*) (ipa-prop.c:2386)
==19246==    by 0x15B5578: ipcp_generate_summary() (ipa-cp.c:4449)
==19246==    by 0xC255AF: execute_ipa_summary_passes(ipa_opt_pass_d*)
(passes.c:2154)
==19246==    by 0x841202: ipa_passes() (cgraphunit.c:2179)
==19246==    by 0x8415E5: symbol_table::compile() (cgraphunit.c:2295)
==19246==    by 0x841907: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2444)
==19246==    by 0x69CEB8: c_write_global_declarations() (c-decl.c:10801)
==19246==    by 0xD1EBAC: compile_file() (toplev.c:608)
==19246== 
==19246== 384 (192 direct, 192 indirect) bytes in 4 blocks are definitely lost
in loss record 519 of 594
==19246==    at 0x4A070D7: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19246==    by 0xAEBAAE: function_summary<ipa_node_params*>::allocate_new()
(symbol-summary.h:106)
==19246==    by 0xAEAF20: function_summary<ipa_node_params*>::get(int)
(symbol-summary.h:232)
==19246==    by 0xAE9B97: function_summary<ipa_node_params*>::get(cgraph_node*)
(symbol-summary.h:112)
==19246==    by 0xAF42FC: ipa_initialize_node_params(cgraph_node*)
(ipa-prop.c:293)
==19246==    by 0xAE323D: estimate_function_body_sizes(cgraph_node*, bool)
(ipa-inline-analysis.c:2518)
==19246==    by 0xAE4F54: compute_inline_parameters(cgraph_node*, bool)
(ipa-inline-analysis.c:2951)
==19246==    by 0xAE5051: compute_inline_parameters_for_current()
(ipa-inline-analysis.c:2978)
==19246==    by 0xAE50D8: (anonymous
namespace)::pass_inline_parameters::execute(function*)
(ipa-inline-analysis.c:3008)
==19246==    by 0xC25B24: execute_one_pass(opt_pass*) (passes.c:2328)
==19246==    by 0xC25D5E: execute_pass_list_1(opt_pass*) (passes.c:2380)
==19246==    by 0xC25DCC: execute_pass_list(function*, opt_pass*)
(passes.c:2391)

inline summaries are ggc allocated and so not a problem, but the ipa-prop
summaries are not, and thus something should arrange that the ipa_node_params
class objects allocated by allocate_new are destructed when m_map is
destructed.
So, perhaps summary_hashmap_traits needs to implement the remove template
method?  Though, it is unclear how it could find out if the hash_map is ggc or
not.  Perhaps the decision ggc vs. non-ggc should be done as function_summary
template parameter or similar.


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

* [Bug tree-optimization/65538] [5 Regression] Memory leak of ipa_node_params_sum elements
  2015-03-24  9:32 [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements jakub at gcc dot gnu.org
@ 2015-03-24  9:44 ` jakub at gcc dot gnu.org
  2015-03-24 10:34 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-24  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


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

* [Bug tree-optimization/65538] [5 Regression] Memory leak of ipa_node_params_sum elements
  2015-03-24  9:32 [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements jakub at gcc dot gnu.org
  2015-03-24  9:44 ` [Bug tree-optimization/65538] " jakub at gcc dot gnu.org
@ 2015-03-24 10:34 ` rguenth at gcc dot gnu.org
  2015-03-24 10:51 ` marxin at gcc dot gnu.org
  2015-03-25 12:53 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-24 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-24
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug tree-optimization/65538] [5 Regression] Memory leak of ipa_node_params_sum elements
  2015-03-24  9:32 [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements jakub at gcc dot gnu.org
  2015-03-24  9:44 ` [Bug tree-optimization/65538] " jakub at gcc dot gnu.org
  2015-03-24 10:34 ` rguenth at gcc dot gnu.org
@ 2015-03-24 10:51 ` marxin at gcc dot gnu.org
  2015-03-25 12:53 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-24 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #0)
> Seen recently in valgrind output (e.g. on the pr65533.c testcase):
> 
> ==19246== 216 (48 direct, 168 indirect) bytes in 1 blocks are definitely
> lost in loss record 501 of 594
> ==19246==    at 0x4A070D7: operator new(unsigned long) (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==19246==    by 0xAEBAAE: function_summary<ipa_node_params*>::allocate_new()
> (symbol-summary.h:106)
> ==19246==    by 0xAEAF20: function_summary<ipa_node_params*>::get(int)
> (symbol-summary.h:232)
> ==19246==    by 0xAE9B97:
> function_summary<ipa_node_params*>::get(cgraph_node*) (symbol-summary.h:112)
> ==19246==    by 0xAF9C38: ipa_analyze_node(cgraph_node*) (ipa-prop.c:2386)
> ==19246==    by 0x15B5578: ipcp_generate_summary() (ipa-cp.c:4449)
> ==19246==    by 0xC255AF: execute_ipa_summary_passes(ipa_opt_pass_d*)
> (passes.c:2154)
> ==19246==    by 0x841202: ipa_passes() (cgraphunit.c:2179)
> ==19246==    by 0x8415E5: symbol_table::compile() (cgraphunit.c:2295)
> ==19246==    by 0x841907: symbol_table::finalize_compilation_unit()
> (cgraphunit.c:2444)
> ==19246==    by 0x69CEB8: c_write_global_declarations() (c-decl.c:10801)
> ==19246==    by 0xD1EBAC: compile_file() (toplev.c:608)
> ==19246== 
> ==19246== 384 (192 direct, 192 indirect) bytes in 4 blocks are definitely
> lost in loss record 519 of 594
> ==19246==    at 0x4A070D7: operator new(unsigned long) (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==19246==    by 0xAEBAAE: function_summary<ipa_node_params*>::allocate_new()
> (symbol-summary.h:106)
> ==19246==    by 0xAEAF20: function_summary<ipa_node_params*>::get(int)
> (symbol-summary.h:232)
> ==19246==    by 0xAE9B97:
> function_summary<ipa_node_params*>::get(cgraph_node*) (symbol-summary.h:112)
> ==19246==    by 0xAF42FC: ipa_initialize_node_params(cgraph_node*)
> (ipa-prop.c:293)
> ==19246==    by 0xAE323D: estimate_function_body_sizes(cgraph_node*, bool)
> (ipa-inline-analysis.c:2518)
> ==19246==    by 0xAE4F54: compute_inline_parameters(cgraph_node*, bool)
> (ipa-inline-analysis.c:2951)
> ==19246==    by 0xAE5051: compute_inline_parameters_for_current()
> (ipa-inline-analysis.c:2978)
> ==19246==    by 0xAE50D8: (anonymous
> namespace)::pass_inline_parameters::execute(function*)
> (ipa-inline-analysis.c:3008)
> ==19246==    by 0xC25B24: execute_one_pass(opt_pass*) (passes.c:2328)
> ==19246==    by 0xC25D5E: execute_pass_list_1(opt_pass*) (passes.c:2380)
> ==19246==    by 0xC25DCC: execute_pass_list(function*, opt_pass*)
> (passes.c:2391)
> 
> inline summaries are ggc allocated and so not a problem, but the ipa-prop
> summaries are not, and thus something should arrange that the
> ipa_node_params class objects allocated by allocate_new are destructed when
> m_map is destructed.
> So, perhaps summary_hashmap_traits needs to implement the remove template
> method?  Though, it is unclear how it could find out if the hash_map is ggc
> or not.  Perhaps the decision ggc vs. non-ggc should be done as
> function_summary template parameter or similar.

I think the correct way is to traverse all items in
function_summary<T>::release (in case of GGC-based map) and delete them all.

Working on the patch.

Martin
>From gcc-bugs-return-481384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 24 10:34:34 2015
Return-Path: <gcc-bugs-return-481384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5639 invoked by alias); 24 Mar 2015 10:34:34 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 118370 invoked by uid 48); 24 Mar 2015 10:34:31 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
Date: Tue, 24 Mar 2015 10:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-59978-4-oUFnYgtYyY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59978-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59978-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg02528.txt.bz2
Content-length: 407

https://gcc.gnu.org/bugzilla/show_bug.cgi?idY978

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-24
     Ever confirmed|0                           |1


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

* [Bug tree-optimization/65538] [5 Regression] Memory leak of ipa_node_params_sum elements
  2015-03-24  9:32 [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-24 10:51 ` marxin at gcc dot gnu.org
@ 2015-03-25 12:53 ` marxin at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-25 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Author: marxin
Date: Wed Mar 25 11:47:04 2015
New Revision: 221658

URL: https://gcc.gnu.org/viewcvs?rev=221658&root=gcc&view=rev
Log:
Fix PR65538.

    PR tree-optimization/65538
    * symbol-summary.h (function_summary::~function_summary):
    Relese memory for allocated summaries.
    (function_summary::release): New function.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/symbol-summary.h
>From gcc-bugs-return-481589-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 25 12:08:05 2015
Return-Path: <gcc-bugs-return-481589-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17435 invoked by alias); 25 Mar 2015 12:08:05 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17389 invoked by uid 48); 25 Mar 2015 12:08:01 -0000
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65538] [5 Regression] Memory leak of ipa_node_params_sum elements
Date: Wed, 25 Mar 2015 12:54:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: marxin at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-65538-4-yJ0XGYxTRf@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65538-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65538-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg02733.txt.bz2
Content-length: 442

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in 5.0.0.
>From gcc-bugs-return-481591-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 25 12:22:44 2015
Return-Path: <gcc-bugs-return-481591-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 78118 invoked by alias); 25 Mar 2015 12:22:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 78092 invoked by uid 48); 25 Mar 2015 12:22:40 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65547] Gcc not giving preprocessor error for invalid invocation of variadic macro
Date: Wed, 25 Mar 2015 12:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65547-4-XA5HJDyL0V@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65547-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65547-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg02735.txt.bz2
Content-length: 368

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide547

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And as has been documented forever, the way to get diagnostics for GNU
extensions that contradict the ISO standard is the -pedantic switch:

https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html#index-pedantic-279

There is no bug here.


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

end of thread, other threads:[~2015-03-25 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24  9:32 [Bug tree-optimization/65538] New: [5 Regression] Memory leak of ipa_node_params_sum elements jakub at gcc dot gnu.org
2015-03-24  9:44 ` [Bug tree-optimization/65538] " jakub at gcc dot gnu.org
2015-03-24 10:34 ` rguenth at gcc dot gnu.org
2015-03-24 10:51 ` marxin at gcc dot gnu.org
2015-03-25 12:53 ` marxin 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).