From patchwork Sat Aug 31 04:58:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 271507 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 308CC2C009E for ; Sat, 31 Aug 2013 14:58:37 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=F4tZFDIaZLBp4wYkm9 j/VfDe5YJ4uYJVFlox0IC3zuVVL0cQy0KB/kizbp5TX+ywBmcb7d3jDcyDmEEI9E Aiv3jBAEwy/mv78vWSFZoBTkG+ZDuDNfQyrUCxyS0NyD5coSgGVDFTqekg0tCQgO IhpIAo7IyhQGCDyuekkpiaLZ4= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=GZQFbSBGn4ucDC3YEh1fDP5Q JBE=; b=uuuu9Xj7jmHCpbiO8Jiol2ejiXKgPmgllz/4TeMcGa2iwjxBf/tUVPAv 6mOdyAeZy0v887/Vnr1wb2G0L1fc3Tk5KQRR9T/aR30sWZVfH65RRLAN/UL4Mm7C LupOGhoS7WXT3GeNUfI8eBXx4Ls1o2qCjD24PepWsoygFIa6AcY= Received: (qmail 3216 invoked by alias); 31 Aug 2013 04:58: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 3206 invoked by uid 89); 31 Aug 2013 04:58:29 -0000 Received: from mail-qa0-f42.google.com (HELO mail-qa0-f42.google.com) (209.85.216.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 31 Aug 2013 04:58:29 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f42.google.com Received: by mail-qa0-f42.google.com with SMTP id cm18so112842qab.1 for ; Fri, 30 Aug 2013 21:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PJehEdgRkrLTpgOsV0tW1IzuiBA8kSzXk0xsF2KpyDg=; b=YJS9oSq3UhoIMLfxivoksRU4eOVYHGhOtDY57s+6MjzAnPcf7/1+ocOq+mmdNWaz84 tNVpbwGsBrkiU93uFQTd7kUppC+HVWwM9FId7aZKfyqFd4eupoR+sZrHLu8UMYE6Oa2c EhHtUljNcOYYxF4/M3dbbEP/E7eQ3urxS4TrW7fwHl1qxnOp8vN5w2oPe/QyfftKe9HS 0qgai4scIDldIW/3e0rSXaywpggwnfa+fKJ5vAV6mfzG/hW6Cte5yDerD9TDjUbS+oz7 KttSZuRMsEhi2Eemu7LkF/6U0cLSPs4r3VSqkPSbC5VFbddwaEAmt2C46SUPHe1Ra6dk rKHg== X-Gm-Message-State: ALoCoQm19vF0y7Ux5Bswy3TizV83YJwWLd9R9nER936k8H5umYb0uPSvhrOqFx/VLKFNMKzbp21zvOGkvEwohHCES71TG44a5GQeNlE66mT7YB9dzCG1CdTbx54Fu95eh7N4c2/6s9zqxZC+pXXnvK3PcDtYnoItas40TbJmHlp39/R0EZN8e2UxpPWxBDM9dwZ61T5yo1AyVUMRHiRmOxlYOAgIFVDx3g== MIME-Version: 1.0 X-Received: by 10.224.96.194 with SMTP id i2mr16516847qan.26.1377925106858; Fri, 30 Aug 2013 21:58:26 -0700 (PDT) Received: by 10.49.40.161 with HTTP; Fri, 30 Aug 2013 21:58:26 -0700 (PDT) In-Reply-To: References: <20130806123714.GD3166@virgil.suse> <20130806160102.GE3166@virgil.suse> Date: Fri, 30 Aug 2013 21:58:26 -0700 Message-ID: Subject: Re: [PATCH] Convert more passes to new dump framework From: Teresa Johnson To: Xinliang David Li Cc: Richard Biener , "gcc-patches@gcc.gnu.org" , Dehao Chen , Sharad Singhai X-IsSubscribed: yes >>>> Besides, we might also want to >>>> use the same machinery (dump_printf_loc etc) for dump file dumping. >>>> The current behavior of using '-details' to turn on opt-info-all >>>> messages for dump files are not desirable. >>> >>> Interestingly, this doesn't even work. When I do >>> -fdump-ipa-inline-details=stderr (with my patch containing the inliner >>> messages) I am not getting those inliner messages emitted to stderr. >>> Even though in dumpfile.c "details" is set to (TDF_DETAILS | >>> MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION | MSG_NOTE). I'm not >>> sure why, but will need to debug this. >> >> It works for vectorizer pass. > > Ok, let me see what is going on - I just confirmed that it is not > working for the loop unroller messages either. > Found the issue. The stream was incorrectly being closed when it was stderr/stdout. So only the dump output before the first dump_finish call was being emitted to stderr. I fixed this the same way the alt_dump_file was being handled just below - don't close if it is stderr/stdout. Confirmed that this fixes the problem. (So the real ratio between the volume of -fdump-...=stderr and -fopt-info is much higher than what I reported in an earlier email) Is the following patch ok, pending regression tests? 2013-08-30 Teresa Johnson * dumpfile.c (dump_finish): Don't close stderr/stdout. Thanks, Teresa Index: dumpfile.c =================================================================== --- dumpfile.c (revision 202059) +++ dumpfile.c (working copy) @@ -450,7 +450,8 @@ dump_finish (int phase) if (phase < 0) return; dfi = get_dump_file_info (phase); - if (dfi->pstream) + if (dfi->pstream && strcmp("stderr", dfi->pfilename) != 0 + && strcmp("stdout", dfi->pfilename) != 0) fclose (dfi->pstream); if (dfi->alt_stream && strcmp("stderr", dfi->alt_filename) != 0