From patchwork Fri Jul 20 09:02:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 172181 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 066422C0384 for ; Fri, 20 Jul 2012 19:03:10 +1000 (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=1343379791; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Hcw5+Fayc7sSvvNRaH9SukSabKQ=; b=BTOosJfbuUH9OaN I1rPGofF1kLCeWy9tIwYTVOktaxN0hvGfBLBmBQl5CluW9jjbHTkhemKF3Qf0hU2 2u45+9OGy3h15yFMLdrV8joZLvsc9aRkhupXuhooh7BkMPGsrR5EfpHYikSD8nwI /sN0ivjncXWG1fBEBK42sSzRCw2c= 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:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Fn/mjMqQIjxGkst5QuZ0FRpKQRqtXf+SDMtLmfqMcgGdLCpxtkkiVPRDlwGoj7 Cpf1A9TEUZ9vfQ+Ju4y+7F/rMi2+61FZyRNGxYjXTk5zHzmi5y0bLyExca/yjjgq UImy3ilzwbuMsZ4xBEJ1gdf9S67udNgwgp2nqxMyPrMJY=; Received: (qmail 13641 invoked by alias); 20 Jul 2012 09:03:06 -0000 Received: (qmail 13608 invoked by uid 22791); 20 Jul 2012 09:03:03 -0000 X-SWARE-Spam-Status: No, hits=-5.0 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-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 09:02:51 +0000 Received: by lbol5 with SMTP id l5so5640514lbo.20 for ; Fri, 20 Jul 2012 02:02:49 -0700 (PDT) Received: by 10.152.131.68 with SMTP id ok4mr5303086lab.47.1342774969499; Fri, 20 Jul 2012 02:02:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.4.229 with HTTP; Fri, 20 Jul 2012 02:02:29 -0700 (PDT) In-Reply-To: References: From: Steven Bosscher Date: Fri, 20 Jul 2012 11:02:29 +0200 Message-ID: Subject: Re: [patch] More cleanups for CFG dumping To: Richard Guenther Cc: GCC Patches , "H.J. Lu" 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 Thu, Jul 19, 2012 at 11:09 AM, Richard Guenther wrote: > Hmm, pp_flush looks like a lot more expensive compared to pp_newline > for example in > > @@ -74,7 +74,7 @@ maybe_init_pretty_print (FILE *file) > static void > newline_and_indent (pretty_printer *buffer, int spc) > { > - pp_newline (buffer); > + pp_flush (buffer); > INDENT (spc); > } > > And I'm pretty sure that newline_and_indent callers that after it directly > dump to the stream should be fixed instead. In fact, constant flushing > will just make things slow (yes, it's only dumping ...). Right, it's only dumping. I'm surprised one would care about its performance. And the patch actually helps in the debugger also: if for some reason a piece of invalid gimple is encountered then at least the part that was OK is still dumped. But oh well :-) I will need this additional patch to avoid test suite failures: I suppose that's OK? Ciao! Steven Index: pretty-print.c =================================================================== --- pretty-print.c (revision 189705) +++ pretty-print.c (working copy) @@ -759,6 +759,7 @@ void pp_base_newline (pretty_printer *pp) { obstack_1grow (pp->buffer->obstack, '\n'); + pp_needs_newline (pp) = false; pp->buffer->line_length = 0; }