From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32204 invoked by alias); 16 Dec 2010 22:43:00 -0000 Received: (qmail 32138 invoked by uid 22791); 16 Dec 2010 22:42:58 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gx0-f176.google.com (HELO mail-gx0-f176.google.com) (209.85.161.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Dec 2010 22:42:53 +0000 Received: by gxk4 with SMTP id 4so29283gxk.21 for ; Thu, 16 Dec 2010 14:42:51 -0800 (PST) Received: by 10.90.69.13 with SMTP id r13mr535902aga.185.1292539371192; Thu, 16 Dec 2010 14:42:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.90.165.8 with HTTP; Thu, 16 Dec 2010 14:42:10 -0800 (PST) In-Reply-To: <20101216215717.GD2198@tyan-ft48-01.lab.bos.redhat.com> References: <20101216215717.GD2198@tyan-ft48-01.lab.bos.redhat.com> From: Sebastian Pop Date: Thu, 16 Dec 2010 23:01:00 -0000 Message-ID: Subject: Re: [PATCH] Make sure free_gimple_bb is called on all graphite created bbs (PR tree-optimization/46966) To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg01339.txt.bz2 On Thu, Dec 16, 2010 at 15:57, Jakub Jelinek wrote: > Hi! > > graphite-sese-to-poly.c wasn't calling free_gimple_bb on some bbs it remo= ved > from SCOP_BBS vector, which means both small memory leak and, more > importantly, leaving bb->aux as non-NULL. =A0Later passes assert that > bb->aux is NULL. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok f= or > trunk? Yes, please install. Thanks for fixing this. Sebastian > > 2010-12-16 =A0Jakub Jelinek =A0 > > =A0 =A0 =A0 =A0PR tree-optimization/46966 > =A0 =A0 =A0 =A0* graphite-sese-to-poly.c (build_scop_drs): Call free_gimp= le_bb for > =A0 =A0 =A0 =A0for bbs that are removed from SCOP_BBS vector. > > =A0 =A0 =A0 =A0* gcc.dg/graphite/pr46966.c: New test. > > --- gcc/graphite-sese-to-poly.c.jj =A0 =A0 =A02010-12-02 11:51:32.0000000= 00 +0100 > +++ gcc/graphite-sese-to-poly.c 2010-12-16 14:42:49.000000000 +0100 > @@ -1971,6 +1971,7 @@ build_scop_drs (scop_p scop) > =A0 for (i =3D 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) > =A0 =A0 if (VEC_empty (data_reference_p, GBB_DATA_REFS (PBB_BLACK_BOX (pb= b)))) > =A0 =A0 =A0 { > + =A0 =A0 =A0 free_gimple_bb (PBB_BLACK_BOX (pbb)); > =A0 =A0 =A0 =A0VEC_ordered_remove (poly_bb_p, SCOP_BBS (scop), i); > =A0 =A0 =A0 =A0i--; > =A0 =A0 =A0 } > --- gcc/testsuite/gcc.dg/graphite/pr46966.c.jj =A02010-12-16 14:49:37.000= 000000 +0100 > +++ gcc/testsuite/gcc.dg/graphite/pr46966.c =A0 =A0 2010-12-16 14:50:48.0= 00000000 +0100 > @@ -0,0 +1,13 @@ > +/* PR tree-optimization/46966 */ > +/* { dg-do compile } */ > +/* { dg-options "-O -floop-interchange -ffast-math -fno-tree-copy-prop -= fno-tree-loop-im" } */ > + > +int a[1000][1000]; > + > +void foo () > +{ > + =A0int i, j; > + =A0for (i =3D 0; i < 1000; i++) > + =A0 =A0for (j =3D 0; j < 1000; j++) > + =A0 =A0 =A0a[i][j] =3D 0; > +} > > =A0 =A0 =A0 =A0Jakub >