From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8783 invoked by alias); 21 Aug 2012 10:18:14 -0000 Received: (qmail 8775 invoked by uid 22791); 21 Aug 2012 10:18:13 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 10:17:59 +0000 Received: by obc16 with SMTP id 16so12024583obc.20 for ; Tue, 21 Aug 2012 03:17:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.172.101 with SMTP id bb5mr12984085oec.44.1345544279168; Tue, 21 Aug 2012 03:17:59 -0700 (PDT) Received: by 10.76.9.200 with HTTP; Tue, 21 Aug 2012 03:17:59 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Aug 2012 10:18:00 -0000 Message-ID: Subject: Re: [PATCH] Add valgrind support to alloc-pool.c From: Richard Guenther To: Andrew Pinski Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 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: 2012-08/txt/msg01415.txt.bz2 On Sat, Aug 18, 2012 at 9:56 AM, Richard Guenther wrote: > On Sat, Aug 18, 2012 at 6:17 AM, Andrew Pinski wrote: >> Hi, >> I implemented this patch almost 6 years ago when the df branch was >> being worked on. It adds valgrind support to alloc-pool.c to catch >> cases of using memory after free the memory. >> >> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > Ok. It doesn't work. Did you check with valgrind checking? /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c: In function 'void* pool_alloc(alloc_pool)': /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected primary-expression before 'int' /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected ')' before 'int' /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:250:3: error: expected ')' before ';' token /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:263:3: error: 'size' was not declared in this scope /space/rguenther/tramp3d/trunk/gcc/alloc-pool.c:303:7: error: 'size' was not declared in this scope that's because VALGRIND_DISCARD is not what you think it is. Testing a fix ... Richard. > Thanks, > Richard. > >> Thanks, >> Andrew Pinski >> >> ChangeLog: >> * alloc-pool.c (pool_alloc): Add valgrind markers. >> (pool_free): Likewise.