public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "schnetter at aei dot mpg dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/19182] Error messages seem to be printed slower
Date: Tue, 28 Dec 2004 22:31:00 -0000	[thread overview]
Message-ID: <20041228223149.9147.qmail@sourceware.org> (raw)
In-Reply-To: <20041228203205.19182.schnetter@aei.mpg.de>


------- Additional Comments From schnetter at aei dot mpg dot de  2004-12-28 22:31 -------
I didn't try the putc vs. fputc change, but the patch below makes all the 
difference: 
 
$ cvs diff -u error.c 
Index: error.c 
=================================================================== 
RCS file: /cvs/gcc/gcc/gcc/fortran/error.c,v 
retrieving revision 1.8 
diff -u -r1.8 error.c 
--- error.c     16 Sep 2004 16:00:41 -0000      1.8 
+++ error.c     28 Dec 2004 22:26:52 -0000 
@@ -74,6 +74,13 @@ 
 static void 
 error_char (char c) 
 { 
+  static int bufset = 0; 
+  if (! bufset) 
+    { 
+      setvbuf (stderr, 0, _IOLBF, 0); 
+      bufset = 1; 
+    } 
+ 
   if (buffer_flag) 
     { 
       if (use_warning_buffer) 
 
The call to setvbuf switches to line buffering, meaning that stderr is flushed 
only after every line and not after every character.  I assume that cc1 (as 
opposed to f951) switches to line buffered stderr at some time, or else 
outputs its error messages in some other way which is equivalent to some 
internal buffering.  f951 outputs its messages character by character, which 
leads to an unnecessary overhead. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19182


  parent reply	other threads:[~2004-12-28 22:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-28 20:32 [Bug fortran/19182] New: " schnetter at aei dot mpg dot de
2004-12-28 20:45 ` [Bug fortran/19182] " pinskia at gcc dot gnu dot org
2004-12-28 20:47 ` pinskia at gcc dot gnu dot org
2004-12-28 21:41 ` tobi at gcc dot gnu dot org
2004-12-28 22:31 ` schnetter at aei dot mpg dot de [this message]
2004-12-28 22:34   ` Andrew Pinski
2004-12-28 22:35 ` pinskia at physics dot uc dot edu
2005-01-04 23:55 ` tobi at gcc dot gnu dot org
2005-01-08  0:05 ` tobi at gcc dot gnu dot org
2005-01-16 17:44 ` cvs-commit at gcc dot gnu dot org
2005-01-16 17:51 ` tobi at gcc dot gnu dot org
2005-01-16 17:55 ` pinskia at gcc dot gnu dot org

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=20041228223149.9147.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).