[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2019-03-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2019-03-04 Thread steven at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982 Steven Bosscher changed: What|Removed |Added Status|ASSIGNED|WAITING Last reconfirmed|2006-02-05

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2006-10-25 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread dnovillo at redhat dot com
--- 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,

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-10 Thread joseph at codesourcery dot com
--- 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 ---

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread gcc-bugzilla at gcc dot gnu dot org
--- 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:

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread gcc-bugzilla at gcc dot gnu dot org
--- 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:

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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:

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread pinskia at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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 ---

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread dnovillo at redhat dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread ghazi at gcc dot gnu dot org
--- 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

[Bug tree-optimization/21982] GCC should combine adjacent stdio calls

2005-06-09 Thread joseph at codesourcery dot com
--- 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