From patchwork Fri Feb 9 23:23:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 871650 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473005-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wbPDtGrR"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zdnGD0PKgz9s7h for ; Sat, 10 Feb 2018 20:49:37 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=PuLc38GnBNug5PeOLvukHGMYsN2QObxbrLikjteTLv0 jPp6InafGGNkONy+SgvD3GrBdn3ui+DFya+9sQZtzCTWM+q+DCO7GAPPd6pPWzKP B9RhSfa0TlkEebXiPebzem9zTNPUvaheUHEcCk2Y69AHE3FmBCz0H5gMsA7o9yrk = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=8eUfn72Lzu9XZ0415ufChPAFX5E=; b=wbPDtGrRNrp0WTZ9h Ak3rUnXXcjbuua/VhkyyBz4ZQ+E19h480sxeHJRkzKoknegDsm/DAHC2jRTDsKni NwOQqRJ/dHpBcBPbEjzemoTItAm31ZkYmKBj3YDhn7UNAVW14GPEGZozGd+sohXl 3dZbxEsu1sJtUGTinQh5areStw= Received: (qmail 114245 invoked by alias); 10 Feb 2018 09:49:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 114234 invoked by uid 89); 10 Feb 2018 09:49:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=leaking X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 10 Feb 2018 09:49:27 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75D0B407519B for ; Sat, 10 Feb 2018 09:49:21 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-85.brq.redhat.com [10.40.204.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34B2B10083B3 for ; Sat, 10 Feb 2018 09:49:21 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w19NNudj021927 for ; Sat, 10 Feb 2018 00:23:57 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w19NNujZ021926 for gcc-patches@gcc.gnu.org; Sat, 10 Feb 2018 00:23:56 +0100 Date: Sat, 10 Feb 2018 00:23:56 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix shrink-wrapping memory leak (PR rtl-optimization/84308) Message-ID: <20180209232356.GO5867@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes Hi! We are leaking the todo vector in spread_components, fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2018-02-10 Jakub Jelinek PR rtl-optimization/84308 * shrink-wrap.c (spread_components): Release todo vector. Jakub --- gcc/shrink-wrap.c.jj 2018-01-03 10:19:55.000000000 +0100 +++ gcc/shrink-wrap.c 2018-02-09 13:19:10.019553075 +0100 @@ -1370,6 +1370,8 @@ spread_components (sbitmap components) bitmap_clear_bit (seen, bb->index); } + todo.release (); + /* Finally, mark everything not not needed both forwards and backwards. */ FOR_EACH_BB_FN (bb, cfun)