From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 9FCD83888C77; Sat, 19 Mar 2022 17:43:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9FCD83888C77 Received: by mail-pf1-x42b.google.com with SMTP id u22so781320pfg.6; Sat, 19 Mar 2022 10:43:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=XhAh/bg9D2BXE5l7O0ReilNiUX5VWCgpGUwXXJ5DboU=; b=72BP+FkzQ8ty60epRVt5UNe07Rc5pynG6eHrEhIwUvE428c6/5rEA9g0iAbzsD5ZsS lXcQjbzuk0i3yZo+gFJThxswlnMQRMpZsWlsotsDnha/XirtKbGxewjzDio1fBP+MnFT OXkIBDi8//htJcaF0qvqScLI3AHRgMrC+y//+UyuGlrcMCTLf07dJWpEdoNqGTiwQgc3 x5vIf932g08Cjm1IWV5rFQTBHpezmV8c6wh+spNpgM8PA34CpkWmn3yXNqzObVBLZbQZ 7DJQ/7R6TyeFwvXjxamX2ZAtJ8ovcF4CkeFVOmjQSnQug6ze1UlonjzemjMshpXhWiMz 59Yg== X-Gm-Message-State: AOAM530I0GckVsJcxepMZRtIEBZtljvHkAUQtoiT0U4ptL+H7o5K7Mz9 F1McMOT8vGAT7RWKWH7gS3I= X-Google-Smtp-Source: ABdhPJybXmP1V2Bz5gazSHngVgg++0c/S/e865+9Z4p7ZIr8dtvZmdY+ToPd1phUupRWsYlZB1LVfA== X-Received: by 2002:a62:84d3:0:b0:4fa:72e2:1c64 with SMTP id k202-20020a6284d3000000b004fa72e21c64mr8136357pfd.29.1647711836447; Sat, 19 Mar 2022 10:43:56 -0700 (PDT) Received: from [172.31.0.204] (c-73-63-24-84.hsd1.ut.comcast.net. [73.63.24.84]) by smtp.gmail.com with ESMTPSA id kb10-20020a17090ae7ca00b001bfad03c750sm16538729pjb.26.2022.03.19.10.43.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Mar 2022 10:43:56 -0700 (PDT) Message-ID: <9892054a-466f-9f3b-210a-6a56b17c09b7@gmail.com> Date: Sat, 19 Mar 2022 11:43:54 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] gcc: pass-manager: Fix memory leak. [PR jit/63854] Content-Language: en-US To: =?UTF-8?Q?Marc_Nieper-Wi=c3=9fkirchen?= Cc: David Malcolm , gcc-patches@gcc.gnu.org, =?UTF-8?Q?Marc_Nieper-Wi=c3=9fkirchen_via_Jit?= References: <20211219213010.17113-1-marc@nieper-wisskirchen.de> <2a54fac9b37d87afb009b8eb339d5ad6927454dd.camel@redhat.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: jit@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Jit mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2022 17:44:03 -0000 On 1/31/2022 4:42 AM, Marc Nieper-Wißkirchen wrote: > Before the patch, compiling the hello world example of libgccjit with > the external driver under Valgrind shows a loss of 12,611 (48 direct) > bytes. After the patch, no memory leaks are reported anymore. > (Memory leaks occurring when using the internal driver are mostly in > the driver code in gcc/gcc.c and have to be fixed separately.) > > The patch has been tested by fully bootstrapping the compiler with the > frontends C, C++, Fortran, LTO, ObjC, JIT and running the test suite > under a x86_64-pc-linux-gnu host. > > gcc/ChangeLog: > > PR jit/63854 > * hash-traits.h (struct typed_const_free_remove): New. > (struct free_string_hash): New. > * pass_manager.h: Use free_string_hash. > * passes.cc (pass_manager::register_pass_name): Use free_string_hash. > (pass_manager::~pass_manager): Delete allocated m_name_to_pass_map I'd hoped David would handle this and I've been insanely busy. Regardless, I've pushed this to the trunk.  Thanks and sorry for the long delays. jeff