This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21982] GCC should combine adjacent stdio calls
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2005 14:36:46 -0000
- Subject: [Bug tree-optimization/21982] GCC should combine adjacent stdio calls
- References: <20050609125653.21982.ghazi@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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
in the concatenated argument list.
Even if arguments don't have side effects you have problems if arguments
of the second printf might refer to anything modifed by printf (the FILE
structure, its buffers, the contents of the file written to, ...) - they
should have the appropriate values for after the first call. It's OK if
the arguments are e.g. local integer variables whose addresses have not
escaped, but in general you need to prove that the arguments to the second
printf, and anything they point to, cannot be changed by the first printf.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21982