https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982
Martin Sebor changed:
What|Removed |Added
CC||msebor at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982
Steven Bosscher changed:
What|Removed |Added
Status|ASSIGNED|WAITING
Last reconfirmed|2006-02-05
--- Comment #37 from ghazi at gcc dot gnu dot org 2006-10-26 00:59 ---
A request for this optimization made by Bruce in Sept 2000. :-)
http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00877.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10 12:42
---
(In reply to comment #25)
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
POSIX defines how streams and file descriptors for the same file
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10 12:55
---
(In reply to comment #25)
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
Case (b) involves fmemopen, and I assume you refer to a case
--- Additional Comments From dnovillo at redhat dot com 2005-06-10 13:15
---
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 07:52:42PM -, joseph at codesourcery dot com wrote:
extern char *s;
extern int i;
printf(%d, i);
printf(%.5s,
--- Additional Comments From joseph at codesourcery dot com 2005-06-10
13:49 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
With regards to %d followed by %.5s, I don't see any difference
regardless
of the
--- Additional Comments From dnovillo at redhat dot com 2005-06-10 13:56
---
Subject: Re: GCC should combine adjacent stdio calls
On Fri, Jun 10, 2005 at 01:49:54PM -, joseph at codesourcery dot com wrote:
Not that I really see the benefit of printf merging in any case; without
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10 14:22
---
(In reply to comment #30)
Subject: Re: GCC should combine adjacent stdio calls
On Fri, Jun 10, 2005 at 01:49:54PM -, joseph at codesourcery dot com
wrote:
Not that I really see the benefit of printf
--- Additional Comments From dnovillo at redhat dot com 2005-06-10 14:25
---
Subject: Re: GCC should combine adjacent stdio calls
On Fri, Jun 10, 2005 at 02:22:05PM -, ghazi at gcc dot gnu dot org wrote:
I have the cpu time, but it seems premature. Your patch as it
stands only
--- Additional Comments From joseph at codesourcery dot com 2005-06-10
14:28 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
I have the cpu time, but it seems premature. Your patch as it stands only
optimizes two
--- Additional Comments From dnovillo at redhat dot com 2005-06-10 14:35
---
Subject: Re: GCC should combine adjacent stdio calls
On Fri, Jun 10, 2005 at 02:28:36PM -, joseph at codesourcery dot com wrote:
Since putc and puts are typically faster than printf (not needing to
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10 15:05
---
(In reply to comment #33)
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
Since putc and puts are typically faster than printf (not needing
--- Additional Comments From joseph at codesourcery dot com 2005-06-10
19:07 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10
15:05 ---
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-09
14:07 ---
Confirmed, this might be hard, I don't know but would be nice as it should
speed up GCC itself.
--
What|Removed |Added
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
14:36 ---
Subject: Re: GCC should combine adjacent stdio
calls
Another problem case is if the first format has excess arguments (which is
permitted by ISO C) - those arguments must be evaluated but not included
--- Additional Comments From dnovillo at gcc dot gnu dot org 2005-06-09
14:37 ---
(In reply to comment #1)
If side effects appear in the arguments, that also would be a problem, e.g.:
printf(%d, i++);
printf(%d, i++);
should not be turned into:
printf(%d%d, i++, i++);
There
--- Additional Comments From gcc-bugzilla at gcc dot gnu dot org
2005-06-09 16:11 ---
Subject: New: GCC should combine adjacent stdio calls
GCC should optimize adjacent stdio calls. For example:
printf(foo %d %d\n, i, j);
printf(bar %d %d\n, x, y);
could instead be emitted as:
--- Additional Comments From gcc-bugzilla at gcc dot gnu dot org
2005-06-09 16:11 ---
Subject: New: GCC should combine adjacent stdio calls
GCC should optimize adjacent stdio calls. For example:
printf(foo %d %d\n, i, j);
printf(bar %d %d\n, x, y);
could instead be emitted as:
--- Additional Comments From dnovillo at gcc dot gnu dot org 2005-06-09
16:18 ---
Testing patch.
--
What|Removed |Added
AssignedTo|unassigned at gcc dot gnu
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09 16:49
---
(In reply to comment #4)
(In reply to comment #1)
If side effects appear in the arguments, that also would be a problem, e.g.:
printf(%d, i++);
printf(%d, i++);
should not be turned into:
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-09
16:51 ---
(In reply to comment #8)
I'm not sure. In my specific example above, after the combination we don't
know which i++ gets executed first because the order is not guaranteed within
an argument list of a
--- Additional Comments From dnovillo at redhat dot com 2005-06-09 16:55
---
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 04:49:40PM -, ghazi at gcc dot gnu dot org wrote:
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09 16:55
---
(In reply to comment #3)
Subject: Re: GCC should combine adjacent stdio
calls
Another problem case is if the first format has excess arguments (which is
permitted by ISO C) - those arguments must be
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09 17:02
---
(In reply to comment #10)
Subject: Re: GCC should combine adjacent stdio calls
But remember that we are not optimizing C, we are optimizing
GIMPLE. And in GIMPLE we don't have those problems. Here's
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-09
17:07 ---
(In reply to comment #12)
Pushing the first printf further down, this could be reordered as:
int i=0, j=2;
j++;
printf(%d, i);
printf(%d, j);
In fact this is how SSA works, in that there a
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
17:11 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, ghazi at gcc dot gnu dot org wrote:
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09
16:55 ---
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09 17:21
---
(In reply to comment #14)
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, ghazi at gcc dot gnu dot org wrote:
--- Additional Comments From ghazi at gcc dot gnu dot org
--- Additional Comments From dnovillo at redhat dot com 2005-06-09 19:03
---
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 05:02:28PM -, ghazi at gcc dot gnu dot org wrote:
int i=0, j=2;
printf(%d, i);
j++;
printf(%d, j);
Pushing the
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
19:15 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, ghazi at gcc dot gnu dot org wrote:
We linked -Wformat into optimization before, then removed the link.
Although we could
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
19:29 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, dnovillo at redhat dot com wrote:
Oh, absolutely. The algorithm I'm using will naturally do this.
This is a purely local
--- Additional Comments From dnovillo at redhat dot com 2005-06-09 19:38
---
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 07:29:42PM -, joseph at codesourcery dot com wrote:
Although it may not be valid to manipulate the FILE * directly, it seems
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-09 19:48
---
(In reply to comment #19)
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 07:29:42PM -, joseph at codesourcery dot com
wrote:
that function on the particular
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
19:52 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, dnovillo at redhat dot com wrote:
Although it may not be valid to manipulate the FILE * directly, it seems
quite possible
--- Additional Comments From dnovillo at redhat dot com 2005-06-09 19:57
---
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 07:52:42PM -, joseph at codesourcery dot com wrote:
Suppose an implementation defines e.g. clearerr as a macro, and the
--- Additional Comments From joseph at codesourcery dot com 2005-06-09
20:13 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Thu, 9 Jun 2005, dnovillo at redhat dot com wrote:
Gah, so we'll need to parse the format string then. Oh, well.
We'll need to parse the format
--- Additional Comments From ghazi at gcc dot gnu dot org 2005-06-10 01:20
---
(In reply to comment #22)
Subject: Re: GCC should combine adjacent stdio calls
On Thu, Jun 09, 2005 at 07:52:42PM -, joseph at codesourcery dot com
wrote:
(a) It could be stdio's buffer (via
--- Additional Comments From joseph at codesourcery dot com 2005-06-10
02:00 ---
Subject: Re: GCC should combine adjacent stdio
calls
On Fri, 10 Jun 2005, ghazi at gcc dot gnu dot org wrote:
Case (b) involves fmemopen, and I assume you refer to a case where you open
memory for
38 matches
Mail list logo