From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21195 invoked by alias); 26 Feb 2013 16:33:10 -0000 Received: (qmail 20832 invoked by uid 48); 26 Feb 2013 16:32:21 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56461] [4.8 Regression] GCC is leaking lots of memory Date: Tue, 26 Feb 2013 16:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg02520.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56461 --- Comment #4 from Jakub Jelinek 2013-02-26 16:32:18 UTC --- Created attachment 29544 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29544 gcc48-pr56461-2.patch Another leak fix, this time in lra. ==31825== 161,960 bytes in 32 blocks are definitely lost in loss record 2,722 of 2,737 ==31825== at 0x4A0881C: malloc (vg_replace_malloc.c:270) ==31825== by 0x13150A7: xmalloc (xmalloc.c:147) ==31825== by 0xB09EF3: lra_spill() (lra-spills.c:531) ==31825== by 0xAEC826: lra(_IO_FILE*) (lra.c:2325) ==31825== by 0xAA1C98: do_reload() (ira.c:4619) ==31825== by 0xAA1E9C: rest_of_handle_reload() (ira.c:4731) ==31825== by 0xB5BB85: execute_one_pass(opt_pass*) (passes.c:2330) ==31825== by 0xB5BD79: execute_pass_list(opt_pass*) (passes.c:2378) ==31825== by 0xB5BDAA: execute_pass_list(opt_pass*) (passes.c:2379) ==31825== by 0x887CC5: expand_function(cgraph_node*) (cgraphunit.c:1640) ==31825== by 0x888180: expand_all_functions() (cgraphunit.c:1744) ==31825== by 0x888C0A: compile() (cgraphunit.c:2042) I see another issue in LRA, but don't have a fix for it yet: ==31825== 1,424 bytes in 1 blocks are definitely lost in loss record 2,273 of 2,737 ==31825== at 0x4A0881C: malloc (vg_replace_malloc.c:270) ==31825== by 0x131514F: xrealloc (xmalloc.c:177) ==31825== by 0x5FA554: void va_heap::reserve(vec*&, unsigned int, bool) (vec.h:300) ==31825== by 0x5FA205: vec::reserve(unsigned int, bool) (vec.h:1468) ==31825== by 0x84B952: vec::reserve_exact(unsigned int) (vec.h:1482) ==31825== by 0x84B904: vec::create(unsigned int) (vec.h:1497) ==31825== by 0xB082A9: lra_create_live_ranges(bool) (lra-lives.c:976) ==31825== by 0xAEC77E: lra(_IO_FILE*) (lra.c:2295) ==31825== by 0xAA1C98: do_reload() (ira.c:4619) ==31825== by 0xAA1E9C: rest_of_handle_reload() (ira.c:4731) ==31825== by 0xB5BB85: execute_one_pass(opt_pass*) (passes.c:2330) ==31825== by 0xB5BD79: execute_pass_list(opt_pass*) (passes.c:2378) I wonder if we shouldn't call if (live_p) lra_clear_live_ranges (); before the lra_create_live_ranges (true); call in lra.c (lra), and also call it when setting live_p to false. Vlad?