From patchwork Tue Jan 3 15:22:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Marlier X-Patchwork-Id: 134014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DBFAC1007D8 for ; Wed, 4 Jan 2012 02:22:27 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326208949; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC: Subject:References:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=1jsSr5KkwWAZLR6cdjXYCMuuPiM=; b=gy7yM0JnJuEtnxZ 2qkal8pu65xg5PPGOmR/yYgYZ7cV2T9OJmlBsuZOSB54zUvgh6Kn/SBYFxp/VFyR iNnAzaaADDHybYccguJrMS7qNme4emMhwO2M9sUWGRX/8iZeGTSPW1Mkp72VKeya h3quFhIDhWfZvZL5dmxDA62LQWj0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=DdPbHDcjHhme/A+qAM3mLExzd60Ow0XIqkOYlChRfu9yDNTkmUgC6wUeaj0ZDP uXF/lSKtaAWj83lAgJEap/BpreFA2XYQ0KUxx7RY5I4Hz3Nf9O2AtqdZo4+0O8Il uYR6IS4MmuTNnM4RAQL/pJMYKjeHhUzYyKih43uiQVkrs=; Received: (qmail 32146 invoked by alias); 3 Jan 2012 15:22:21 -0000 Received: (qmail 32135 invoked by uid 22791); 3 Jan 2012 15:22:20 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Jan 2012 15:22:07 +0000 Received: by qcqw6 with SMTP id w6so9691427qcq.20 for ; Tue, 03 Jan 2012 07:22:07 -0800 (PST) Received: by 10.224.202.8 with SMTP id fc8mr62629096qab.10.1325604127258; Tue, 03 Jan 2012 07:22:07 -0800 (PST) Received: from [192.168.2.3] (cpe-69-207-95-157.rochester.res.rr.com. [69.207.95.157]) by mx.google.com with ESMTPS id q14sm100522874qap.4.2012.01.03.07.22.06 (version=SSLv3 cipher=OTHER); Tue, 03 Jan 2012 07:22:06 -0800 (PST) Message-ID: <4F031D1D.5050607@gmail.com> Date: Tue, 03 Jan 2012 10:22:05 -0500 From: Patrick Marlier User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: jakub@redhat.com CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Use ggc allocated strings instead of malloced for debug macro sections (PR pch/51722) References: <20120103132524.GV18937@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20120103132524.GV18937@tyan-ft48-01.lab.bos.redhat.com> X-IsSubscribed: yes 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 On 01/03/2012 08:25 AM, Jakub Jelinek wrote: > Hi! > > Referring to malloced strings from GC hashtable macinfo_table entries > and then freeing them at the end of compilation process is problematic > with PCH, because without PCH the strings are malloced, but with PCH > ggc allocated after restore and thus free on them is invalid. > > Fixed by making the strings GC allocated all the time. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > @@ -20909,7 +20905,6 @@ output_macinfo (void) > if (!VEC_empty (macinfo_entry, files)) > { > macinfo_entry *file = VEC_last (macinfo_entry, files); > - free (CONST_CAST (char *, file->info)); > VEC_pop (macinfo_entry, files); > } > break; This breaks bootstrap: ../../trunk/gcc/dwarf2out.c: In function ‘void output_macinfo()’: ../../trunk/gcc/dwarf2out.c:20907:23: error: unused variable ‘file’ [-Werror=unused-variable] cc1plus: all warnings being treated as errors I guess it is a way to fix it. Patrick Marlier. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 182848) +++ gcc/dwarf2out.c (working copy) @@ -20904,7 +20904,6 @@ output_macinfo (void) case DW_MACINFO_end_file: if (!VEC_empty (macinfo_entry, files)) { - macinfo_entry *file = VEC_last (macinfo_entry, files); VEC_pop (macinfo_entry, files); } break;