public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steven Bosscher <stevenb.gcc@gmail.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [patch] More cleanups for CFG dumping
Date: Fri, 20 Jul 2012 09:03:00 -0000	[thread overview]
Message-ID: <CABu31nMLt9+DtY4s_7-L_+m8hp8=6s_EQh+K65LKpmK1_Xw4-Q@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc1E0RM7QcSAzG+tr5bJ1qjngcN4bG2tW-AB5pYwpjJqGg@mail.gmail.com>

On Thu, Jul 19, 2012 at 11:09 AM, Richard Guenther
<richard.guenther@gmail.com> 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:

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;
 }

I suppose that's OK?

Ciao!
Steven

  reply	other threads:[~2012-07-20  9:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 17:18 Steven Bosscher
2012-07-19  9:10 ` Richard Guenther
2012-07-20  9:03   ` Steven Bosscher [this message]
2012-07-20  9:29     ` Richard Guenther
2012-07-23 13:10       ` Steven Bosscher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABu31nMLt9+DtY4s_7-L_+m8hp8=6s_EQh+K65LKpmK1_Xw4-Q@mail.gmail.com' \
    --to=stevenb.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).