From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11484 invoked by alias); 21 Aug 2012 11:41:11 -0000 Received: (qmail 11427 invoked by uid 22791); 21 Aug 2012 11:41:10 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 11:40:50 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/54343] New: RTL postreload leaks DF memory Date: Tue, 21 Aug 2012 11:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: 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: 2012-08/txt/msg01455.txt.bz2 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 ...